ValueError('You appear to be using a legacy multi-label data'
使用sklearn时,遇到该问题,可能是因为scikit-learn版本过旧或者太新pip install -U scikit-learn==0.16.1 就能解决当然在0.17之后,已经不允许直接使用多类标分类Direct support for sequence of sequences multilabel representation will be unavailab
·
使用sklearn时,遇到该问题,可能是因为scikit-learn版本过旧或者太新
pip install -U scikit-learn==0.16.1 就能解决
当然在0.17之后,已经不允许直接使用多类标分类
Direct support for sequence of sequences multilabel representation will be unavailable from version 0.17
而使用sklearn.preprocessing.MultiLabelBinarizer to convert to a label indicator representation.
例如
from sklearn.preprocessing import MultiLabelBinarizer
y_train = MultiLabelBinarizer().fit_transform(y_train)
y_test = MultiLabelBinarizer().fit_transform(y_test)
preds = MultiLabelBinarizer().fit_transform(preds)
更多推荐
所有评论(0)