Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

Right now, I'm using IMDB data on my regression model, to predict IMDB value. But, On my regression (Linear regression), I couldn't able to get the accuracy score

Look at my code:

metrics.accuracy_score(test_y, linear_predicted_rating)

The error message that I'm getting:

ValueError: continuous is not supported

I can able to get an r2 score without any error if I change the line to:

metrics.r2_score(test_y,linear_predicted_rating)

Anyone, please help me?

1 Answer

0 votes
by (26.4k points)

Basically, 

from scikit.metrics import accuracy_score

helps to measure the classification accuracy, it cannot be used to find the accuracy of the regression model. 

Moreover,  If the predictions differ from the expected values by 1%, Even though if the predictions were great the accuracy will be zero.

Click on this link, to know more about metrics for regression.

Wanna become a python expert? Come and join: Python course

Browse Categories

...