Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "valency", with regards to machine learning?

Tags:

tensorflow

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.

like image 559
T.R. Avatar asked Mar 10 '19 07:03

T.R.


1 Answers

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

like image 67
evan_b Avatar answered Oct 19 '22 12:10

evan_b