2
我正在使用OneVsRestClassifier處理多標籤分類問題。我將RandomForestClassifier傳入它。從OneVsRestClassifier獲取隨機森林feature_importances_用於多標籤分類
from sklearn.multiclass import OneVsRestClassifier
from sklearn.ensemble import RandomForestClassifier
clf = OneVsRestClassifier(RandomForestClassifier(random_state=0,class_weight='auto',min_samples_split=10,n_estimators=50))
clf.fit(train,dv_train)
print clf.feature_importances_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'OneVsRestClassifier' object has no attribute 'feature_importances_'
如何獲取OneVsRestClassifier中每個隨機森林的功能重要性?