1# import the class
2from sklearn.linear_model import LogisticRegression
3
4# instantiate the model (using the default parameters)
5logreg = LogisticRegression()
6
7# fit the model with data
8logreg.fit(X_train,y_train)
9
10#
11y_pred=logreg.predict(X_test)
12
1print("Accuracy:",metrics.accuracy_score(y_test, y_pred))
2print("Precision:",metrics.precision_score(y_test, y_pred))
3print("Recall:",metrics.recall_score(y_test, y_pred))
4
1# import the metrics class
2from sklearn import metrics
3cnf_matrix = metrics.confusion_matrix(y_test, y_pred)
4cnf_matrix
5