The issue over here is that the Linear Regression algorithm is much more suited and tailored towards the regression or predictive tasks for continuous data rather than classification tasks. Hence the evaluation metrics in this case are expected to be MSE, R2_score, MAE. But since here we are using accuracy_score as a metric for prediction that expects to compare the results based on the classes predicted correctly for categorical data.
Hence the given error is generated
Though, if you want to still work on the same, correct way is:
accuracy_score(y_true, y_pred.round(), normalise=False)
But the suitable approach is finding the best fit line
r2_score(y_true, y_pred)