I would like to get eli5's permutation score of the features, but keep getting ValueError: Unknown label type: 'continuous'
How can I fix that?
import eli5
from eli5.sklearn import PermutationImportance
from sklearn.svm import SVC
from sklearn.feature_selection import SelectFromModel
my_model = RandomForestClassifier()
# ... load data
clf = lgb.LGBMClassifier(nthread=4, boosting_type= 'gbdt',
metric= 'auc', n_estimators= 5000 )
perm = PermutationImportance(clf, cv=5)
perm.fit(df[feat], df.CSI)
# perm.feature_importances_ attribute is now available, it can be used
# for feature selection - let's e.g. select features which increase
# accuracy by at least 0.05:
sel = SelectFromModel(perm, threshold=0.05, prefit=True)
X_trans = sel.transform(X)
This is fixed the problem:
perm.fit(df[feat].values, df.CSI.values)