sketchgraphs.pipeline.graph_model.quantization.EntityFeatureMapping¶
-
class
sketchgraphs.pipeline.graph_model.quantization.
EntityFeatureMapping
(bin_centers_by_target=None)¶ Helper class for extracting sparse features from entities.
In addition to features shared by all entity types (e.g. isConstruction), many entity types have their own features. In order to process them appropriately in batched fashion, they must be extracted into a set of sparse features.
-
__init__
(bin_centers_by_target=None)¶ Initialize a new mapping from the given bin definitions.
- Parameters
bin_centers_by_target (dict) – A dictionary specifying bin center locations for each target type (i.e. entity type)
-
features_from_index
(index, target)¶ Obtains categorical features from the given indices.
-
numerical_features
(ops, target) → numpy.ndarray¶ Produces a dense array of numerical features.
The operations in the
ops
array must all match the given target type.
-