models.feature_vectorizer

Module Contents

Functions

create_feature_vectorizer(input_features,output_feature_name,known_size_map=dict) Creates a feature vectorizer from input features, return the spec for
create_feature_vectorizer(input_features, output_feature_name, known_size_map=dict)

Creates a feature vectorizer from input features, return the spec for a feature vectorizer that puts everything into a single array of length equal to the total size of all the input features. Returns a 2-tuple (spec, num_dimension)

input_features: [list of 2-tuples]

Name(s) of the input features, given as a list of (‘name’, datatype) tuples. The datatypes entry is one of the data types defined in the datatypes module. Allowed datatypes are datatype.Int64, datatype.Double, datatypes.Dictionary, or datatype.Array.

If the feature is a dictionary type, then the dictionary must have integer keys, and the number of dimensions to expand it into must be given by known_size_map.

Feature indices in the final array are counted sequentially from the from 0 through the total number of features.

output_feature_name: str
The name of the output feature. The type is an Array List of output feature of the network.
known_size_map:
A dictionary mapping the feature name to the expanded size in the final array. This is most useful for specifying the size of sparse vectors given as dictionaries of index to value.