我正在尝试使用BinaryCorrelation和SVC对数据(情感(进行分类。此代码位于
http://scikit.ml/tutorial.html
from skmultilearn.dataset import load_dataset
X_train, y_train, feature_names, label_names = load_dataset('emotions', 'train')
X_test, y_test, _, _ = load_dataset('emotions', 'test')
from skmultilearn.problem_transform import BinaryRelevance
from sklearn.svm import SVC
clf = BinaryRelevance(
classifier=SVC(),
require_dense=[False, True]
)
clf.fit(X_train, y_train)
clf.classifiers
我有这个问题
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-11-5aa82f5c3cc2> in <module>()
----> 1 clf.classifiers
AttributeError: 'BinaryRelevance' object has no attribute 'classifiers'
本教程有点过时,如果您键入clf.classifiers_
它应该可以工作。