我正在尝试在 Jupyter Notebook 上运行以下代码:lr = LogisticRegression(class_weight='balanced')lr.fit(X_train,y_train)y_pred = lr.predict(X_train)acc_log = round(lr.score(X_train, y_train) * 100, 2)prec_log = round(precision_score(y_train,y_pred) * 100,2)recall_log = round(recall_score(y_train,y_pred) * 100,2)f1_log = round(f1_score(y_train,y_pred) * 100,2)roc_auc_log = roc_auc_score(y_train,y_pred)当尝试执行此操作时,我收到以下错误:---------------------------------------------------------------------------TypeError Traceback (most recent call last)<ipython-input-46-bcb2d9729eb6> in <module> 6 prec_log = round(precision_score(y_train,y_pred) * 100,2) 7 recall_log = round(recall_score(y_train,y_pred) * 100,2)----> 8 f1_log = round(f1_score(y_train,y_pred) * 100,2) 9 roc_auc_log = roc_auc_score(y_train,y_pred)TypeError: 'numpy.float64' object is not callable似乎无法弄清楚我做错了什么。
添加回答
举报
0/150
提交
取消