Beispiel #1
0
    def test_ada_boost1(self):
        from sklearn.tree import DecisionTreeClassifier

        from lale.lib.sklearn import AdaBoostClassifier

        clf = AdaBoostClassifier(base_estimator=DecisionTreeClassifier())
        clf.fit(self.X_train, self.y_train)
Beispiel #2
0
    def test_ada_boost(self):
        from lale.lib.sklearn import AdaBoostClassifier, DecisionTreeClassifier

        clf = AdaBoostClassifier(base_estimator=DecisionTreeClassifier())
        trained = clf.auto_configure(
            self.X_train, self.y_train, optimizer=Hyperopt, max_evals=1
        )
        # Checking that the inner decision tree does not get the default value for min_samples_leaf, not sure if this will always pass
        self.assertNotEqual(
            trained.hyperparams()["base_estimator"].hyperparams()["min_samples_leaf"], 1
        )
 def test_adaboost_post_estimator_mitigation_base(self):
     model = AdaBoostClassifier(
         base_estimator=CalibratedEqOddsPostprocessing(
             **self.fairness_info, estimator=DecisionTreeClassifier()
         )
     )
     self._attempt_fit_predict(model)
Beispiel #4
0
 def test_trainable_pipeline(self):
     trainable_pipeline = StandardScaler() >> AdaBoostClassifier()
     trainable_pipeline.fit(self.X_train, self.y_train)
     with self.assertWarns(DeprecationWarning):
         _ = trainable_pipeline.predict_log_proba(self.X_test)
Beispiel #5
0
 def test_trained_pipeline(self):
     trainable_pipeline = StandardScaler() >> AdaBoostClassifier()
     trained_pipeline = trainable_pipeline.fit(self.X_train, self.y_train)
     _ = trained_pipeline.predict_log_proba(self.X_test)
Beispiel #6
0
 def test_adaboost_pre_estimator_mitigation_base(self):
     model = AdaBoostClassifier(base_estimator=DisparateImpactRemover(
         **self.fairness_info) >> DecisionTreeClassifier())
     self._attempt_fit_predict(model)
Beispiel #7
0
 def test_adaboost_in_estimator_mitigation_base(self):
     model = AdaBoostClassifier(base_estimator=PrejudiceRemover(
         **self.fairness_info))
     self._attempt_fit_predict(model)