Exemplo n.º 1
0
 def _unit_test_params(cls):
     yield {
         "models": [
             linear_model.LogisticRegression(),
             tree.HoeffdingTreeClassifier(),
             naive_bayes.GaussianNB(),
         ]
     }
Exemplo n.º 2
0
@pytest.mark.parametrize(
    "estimator, check",
    [
        pytest.param(estimator, check, id=f"{estimator}:{check.__name__}")
        for estimator in list(get_all_estimators()) + [
            feature_extraction.TFIDF(),
            linear_model.LogisticRegression(),
            preprocessing.StandardScaler() | linear_model.LinearRegression(),
            preprocessing.StandardScaler() | linear_model.PAClassifier(),
            (preprocessing.StandardScaler()
             | multiclass.OneVsRestClassifier(
                 linear_model.LogisticRegression())),
            (preprocessing.StandardScaler()
             | multiclass.OneVsRestClassifier(linear_model.PAClassifier())),
            naive_bayes.GaussianNB(),
            preprocessing.StandardScaler(),
            cluster.KMeans(n_clusters=5, seed=42),
            preprocessing.MinMaxScaler(),
            preprocessing.MinMaxScaler() + preprocessing.StandardScaler(),
            feature_extraction.PolynomialExtender(),
            (feature_extraction.PolynomialExtender()
             | preprocessing.StandardScaler()
             | linear_model.LinearRegression()),
            feature_selection.VarianceThreshold(),
            feature_selection.SelectKBest(similarity=stats.PearsonCorr()),
        ] for check in utils.estimator_checks.yield_checks(estimator)
        if check.__name__ not in estimator._unit_test_skips()
    ],
)
def test_check_estimator(estimator, check):
Exemplo n.º 3
0
                                         sampling_rate=SAMPLING_RATE)),
    ('EvoAutoML Bagging Best',
     EvolutionaryBaggingClassifier(population_size=POPULATION_SIZE,
                                   model=AUTOML_CLASSIFICATION_PIPELINE,
                                   param_grid=CLASSIFICATION_PARAM_GRID,
                                   sampling_rate=SAMPLING_RATE)),
    ('ARF', ensemble.AdaptiveRandomForestClassifier()),
    ('Leveraging Bagging',
     ensemble.LeveragingBaggingClassifier(model=ENSEMBLE_CLASSIFIER())),
    ('Bagging',
     ensemble.BaggingClassifier(model=ENSEMBLE_CLASSIFIER(), n_models=10)),
    ('SRPC', ensemble.SRPClassifier(n_models=10)),
    ('Hoeffding Tree', tree.HoeffdingTreeClassifier()),
    ('Logistic Regression', linear_model.LogisticRegression()),
    ('HAT', tree.HoeffdingAdaptiveTreeClassifier()),
    ('GaussianNB', naive_bayes.GaussianNB()),
    ('KNN', neighbors.KNNClassifier()),
]

if __name__ == '__main__':

    RESULT_PATH.mkdir(parents=True, exist_ok=True)
    #output = evaluate_ensemble(CLASSIFICATION_TRACKS[1], ENSEMBLE_EVALUATION_MODELS[2])

    pool = Pool(60)  # Create a multiprocessing Pool
    output = pool.starmap(
        evaluate_ensemble,
        list(
            itertools.product(CLASSIFICATION_TRACKS,
                              ENSEMBLE_EVALUATION_MODELS)))
    pool.close()