I am trying to run below code on 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)
When trying to execute this, I am getting the below error:
---------------------------------------------------------------------------
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
Can't seem to figure out what I am doing wrong.