0407_Vectorised GD Algorithms: Error using accuracy_score: ValueError: continuous is not supported

I am trying to use 0407_VectorisedGDAlgorithms-1554564131433.ipynb file for a regression problem with my data.

I have made sufficient changes as per my knowledge.

I have a strong feeling that while defining accuracy, the use of argmax is creating some issues. Kindly help in this regard



It’s because accuracy_score is for classification tasks only. For regression you should use something different, for example:

clf.score(X_test, y_test)

Where X_test is samples, y_test is corresponding ground truth values. It will compute predictions inside.

But still I wasn’t able to come out of error.

1 Like

Running your code, throws error ‘ValueError: continuous is not supported’.
And as you pointed out, this is happening because you are passing ‘Y_pred_train’ and ‘Y_train’ to accuracy_score. These arguments are continuous, not binary or multiclass and cannot be passed to accuracy_score.
for regression, you should look for other metric

See example screenshot below. :

1 Like

list of sklearn metrics (classification, regression and others)


1 Like