我正在尝试在我的 pandas 数据帧上运行 MLKnn 分类器,当我尝试拟合分类器时,我收到以下错误消息:
Series object has no attribute 'getformat'
这是代码:
from skmultilearn.adapt import MLkNN
from sklearn.model_selection import GridSearchCV
parameters = {'k': range(1,3), 's': [0.5, 0.7, 1.0]}
score = 'f1_macro'
X = dados.drop(['defects'], axis=1)
y = dados['defects']
X_train, X_test, y_train, y_test = train_test_split(X, y,random_state=1)
classifier = GridSearchCV(MLkNN(), parameters,scoring=score)
classifier.fit(X_train, y_train)
我的数据框如下所示: