5

This term came up a few times in the Tensorflow Dev Summit, and it shows up in the Tensorflow Extended documentation, but without any sort of definition. After a fair amount of googling, I don't see reference to it in any Statistics-related setting. Searching the Tensorflow repositories produces a few hits, but they're similarly unhelpful. The term does seem to be used in Chemistry, Psychology, and Linguistics, but those definitions appear to be unrelated.

2 Answers 2

7

Per the 2017 TFX paper http://stevenwhang.com/tfx_paper.pdf, TFX can calculate a number of stats on a dataset, including:

"The expected valency of the feature in each example, i.e., minimum and maximum number of values."

We can also look at the code that calculates valency in TFX. From what I can tell, it's designed to run on a feature that is an array, and counts the minimum and maximum number of values within that array for that feature:

# Extract the valency information of the feature.
valency = ''
if feature.HasField('value_count'):
  if (feature.value_count.min == feature.value_count.max and
      feature.value_count.min == 1):
    valency = 'single'
  else:
    min_value_count = ('[%d' % feature.value_count.min
                       if feature.value_count.HasField('min') else '[0')
    max_value_count = ('%d]' % feature.value_count.max
                       if feature.value_count.HasField('max') else 'inf)')
    valency = min_value_count + ',' + max_value_count

from: https://github.com/tensorflow/data-validation/blob/master/tensorflow_data_validation/utils/display_util.py#L68

2

As discussed in this blog,

Valency indicates the number of values required per training example. In the case of categorical features, single indicates that each training example must have exactly one category for the feature.

More broadly speaking, it applies to features with multiple values (IMHO not that common for features in Machine Learning), e.g., lists and arrays. In that case, valency refers to the minimum or maximum number of values in these data types. For lists, one can compute the valency by applying np.min()/np.max() on the list lengths from all available feature examples.

After experimenting with both numerical and categorical features, it turns out that there only appears values (e.g., "single") in the "Valency" column when the value in the corresponding "Presence" column is "optional" (tfdv 1.6.0).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.