Closed shubhamjn1 closed 6 years ago
In the ensemble layers the scorer is expected to be a function: ensemble(scorer=roc_auc_score)
.
You should only use make_scorer
for the Evaluator
.
Yes, I am using it the same way.
from mlens.metrics import make_scorer
auc_scorer = make_scorer(roc_auc_score, greater_is_better=True)
ensemble = SuperLearner(scorer= auc_scorer , random_state= 2, verbose =2)
Don't use make_scorer
:
from sklearn.metrics import roc_auc_score
ensemble = SuperLearner(..., scorer=roc_auc_score)
While adding any model in the ensemble layer, it is throwing an error as:
RuntimeError: Cannot clone object Learner(attr='predict', backend='threading', dtype=<class 'numpy.float32'>, estimator=RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini', max_depth=6, max_features='sqrt', max_leaf_nodes=None, min_impurity_decrease=0.0, min_impurity_split=None, min_samples_leaf=1, min_samples_split=2, min_weight_fraction_leaf=0.0, n_estimators=300, n_jobs=1, oob_score=True, random_state=1, verbose=0, warm_start=False), indexer=FoldIndex(X=None, folds=2, raise_on_exception=True), n_jobs=-1, name='randomforestclassifier', preprocess=None, proba=False, raise_on_exception=True, scorer=make_scorer(roc_auc_score)), as the constructor does not seem to set parameter scorer