scikit-learn-contrib / DESlib

A Python library for dynamic classifier and ensemble selection
BSD 3-Clause "New" or "Revised" License
479 stars 106 forks source link

'METADES' object has no attribute 'meta_classifier_' #187

Closed s0rel closed 4 years ago

s0rel commented 4 years ago

Hello, thanks for your work.Today I use metades and pass sklearn.linear_model.LogisticRegression as meta_classifier.Unfortunately, it doesn't work and throw an exception "AttributeError: 'METADES' object has no attribute 'metaclassifier'"Here is my code:

from sklearn.ensemble import RandomForestClassifier
pool_classifiers = RandomForestClassifier()
pool_classifiers.fit(X_train, y_train)
from deslib.des.meta_des import METADES
from sklearn.linear_model import LogisticRegression
meta_classifier = LogisticRegression()
clf = METADES(pool_classifiers, meta_classifier=meta_classifier) 
clf.fit(X_dsel, y_dsel)

my envirement:python 3.7.3 sklearn 0.22.2 deslib 0.3 Please help me

Menelau commented 4 years ago

@s0rel Hello,

This is a bug that was fixed in recent patches. In order to fix that you need to install the latest version of the library using the following command:

pip install git+https://github.com/scikit-learn-contrib/DESlib -U

That will install the current development version which has several bug fixes since version version 0.3 release