def test_default_metric_getter_works_as_expected_regressor(self): linreg = Model(LinearRegression()) assert linreg.config.CLASSIFIER_METRIC == "accuracy" assert linreg.config.REGRESSION_METRIC == "r2" assert linreg.default_metric == "r2" linreg.default_metric = "neg_mean_squared_error" assert linreg.config.CLASSIFIER_METRIC == "accuracy" assert linreg.config.REGRESSION_METRIC == "neg_mean_squared_error" assert linreg.default_metric == "neg_mean_squared_error" linreg.config.reset_config()
def test_default_metric_getter_works_as_expected_classifier(self): rf = Model(RandomForestClassifier(n_estimators=10)) assert rf.config.CLASSIFIER_METRIC == "accuracy" assert rf.config.REGRESSION_METRIC == "r2" assert rf.default_metric == "accuracy" rf.default_metric = "fowlkes_mallows_score" assert rf.config.CLASSIFIER_METRIC == "fowlkes_mallows_score" assert rf.config.REGRESSION_METRIC == "r2" assert rf.default_metric == "fowlkes_mallows_score" rf.config.reset_config()