Esempio n. 1
0
    def __lt__(self, other_feature_or_val):
        """Compares if less than other_feature_or_val

        See also:
            :meth:`PrimitiveBase.less_than`
        """
        from featuretools.primitives import LessThan
        return LessThan(self, other_feature_or_val)
Esempio n. 2
0
def test_override_boolean(es):
    count = Count(es['log']['value'], es['sessions'])
    count_lo = GreaterThan(count, 1)
    count_hi = LessThan(count, 10)

    to_test = [[True, True, True], [True, True, False], [False, False, True]]

    features = []
    features.append(count_lo.OR(count_hi))
    features.append(count_lo.AND(count_hi))
    features.append(~(count_lo.AND(count_hi)))

    pandas_backend = PandasBackend(es, features)
    df = pandas_backend.calculate_all_features(instance_ids=[0, 1, 2],
                                               time_last=None)
    for i, test in enumerate(to_test):
        v = df[features[i].get_name()].values.tolist()
        assert v == test