def test_alive_features_can_hide_bad_samples(self):
        # While a Feature is alive, each time he failed, the sample causing the
        # failure is hidden to the rest of the features, in an attempt to
        # minimize damage of rare bad samples.
        self.ev = TolerantFeatureEvaluator([DescriptionFeature, AgeFeature,
                                            DumbFeatureA])
        self.ev.FEATURE_STRICT_UNTIL = 0  # No strict mode
        self.ev.FEATURE_MAX_ERRORS_ALLOWED = 1  # No feature failure tolerated
        no_age = {'description': u'i have'}
        bad_sample = {'nothing': u'this sample has no description, not age'}
        samples = [bad_sample, no_age]
        # Since the 2nd sample will succeed when evaluated on
        # DescriptionFeature but fail when evaluated with AgeFeature, we want
        # to check if at the end the AgeFeature is alive or not. If not, it's
        # because it suffered 2 failures, so the bad_sample wasn't hidden.
        self.apply_fit(samples)
        # Checking the preconditions of our test
        assert DescriptionFeature in self.ev.alive_features
        self.assertIn(AgeFeature, self.ev.alive_features)
dataset/ETHPy150Open machinalis/featureforge/tests/test_feature_evaluator.py/TolerantFittingCases.test_alive_features_can_hide_bad_samples/original