嗨,我正在尝试创建一个具有高召回率和精度值的员工晋升算法,试图适应我的模型,但得到这个错误请帮助下面是我到目前为止的作品的协作链接 https://colab.research.google。 com/drive/1ugKUswSjwnrfActsu2E-1gSg94ylwUJK
import catboost as ctb
from sklearn import metrics
# fit a CART model to the data
parameters = {'depth' : [6,8,10],
'learning_rate' : [0.01, 0.05, 0.1],
'iterations' : [30, 50, 100]
}
model = ctb.CatBoostClassifier(silent=True)
model.fit(X_train, y_train)
print(); print(model)
# make predictions
expected_y = y_train
predicted_y = model.predict(X_test)
# summarize the fit of the model
print(); print(metrics.classification_report(expected_y, predicted_y))
print(); print(metrics.confusion_matrix(expected_y, predicted_y))
ValueError Traceback (most recent call last)
<ipython-input-26-abdfdbe585e3> in <module>()
16
17 # summarize the fit of the model
---> 18 print(); print(metrics.classification_report(expected_y, predicted_y))
19 print(); print(metrics.confusion_matrix(expected_y, predicted_y))
2 frames
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in check_consistent_length(*arrays)
203 if len(uniques) > 1:
204 raise ValueError("Found input variables with inconsistent numbers of"
--> 205 " samples: %r" % [int(l) for l in lengths])
206
207
ValueError: Found input variables with inconsistent numbers of samples: [30649, 7663]