Machine-Learning-with-Iris-Dataset icon indicating copy to clipboard operation
Machine-Learning-with-Iris-Dataset copied to clipboard

ERROR: metrics has not been imported

Open thisisashwinraj opened this issue 5 years ago • 0 comments

metrics module has not been imported from sklearn before calculating the accuracy score from sklearn.linear_model import LogisticRegression from sklearn import metrics ... ... model = LogisticRegression() model.fit(train_X, train_y) prediction = model.predict(test_X) print('The accuracy of Logistic Regression is: ', metrics.accuracy_score(prediction, test_y))

thisisashwinraj avatar Mar 25 '20 08:03 thisisashwinraj