Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def OR(self, other_feature):
"""Logical OR with other_feature"""
return Feature([self, other_feature], primitive=primitives.Or)
def _handle_binary_comparision(self, other, Primitive, PrimitiveScalar):
if isinstance(other, FeatureBase):
return Feature([self, other], primitive=Primitive)
return Feature([self], primitive=PrimitiveScalar(other))
def __rsub__(self, other):
return Feature([self], primitive=primitives.ScalarSubtractNumericFeature(other))
ft.load_features(f)
feature_str = f.read()
ft.load_features(feature_str)
.. seealso::
:func:`.save_features`
"""
return FeaturesDeserializer.load(features, profile_name).to_list()
class FeaturesDeserializer(object):
FEATURE_CLASSES = {
'AggregationFeature': AggregationFeature,
'DirectFeature': DirectFeature,
'Feature': Feature,
'FeatureBase': FeatureBase,
'GroupByTransformFeature': GroupByTransformFeature,
'IdentityFeature': IdentityFeature,
'TransformFeature': TransformFeature,
'FeatureOutputSlice': FeatureOutputSlice
}
def __init__(self, features_dict):
self.features_dict = features_dict
self._check_schema_version()
self.entityset = deserialize_es(features_dict['entityset'])
self._deserialized_features = {} # name -> feature
self._primitives_deserializer = PrimitivesDeserializer()
@classmethod
def load(cls, features, profile_name):
def NOT(self):
"""Creates inverse of feature"""
return Feature([self], primitive=primitives.Not)
def is_null(self):
"""Compares feature to null by equality"""
return Feature([self], primitive=primitives.IsNull)
def __rdiv__(self, other):
return Feature([self], primitive=primitives.DivideByFeature(other))