Air quality challenge

Sir, is the code almost same as what Prateek sir taught in the Multivariate LR video? I’ve prepared the predicted values of target and the LR score of X_test, y_pred is coming out to be 1.0. Is this fine?

Hello @geekayd,
Please share the code that produced the score.

Thanks :slight_smile:

Hello @geekayd,

The LR score is calculated between the true values and the predicted value. You have here calculated with xtest and ypred(assuming x_test is the testing dataset) which is wrong and obviously 1.0. As what you have given as the true value is the prediction value itself.

What score function internally does is, it predicts the values for x provided and then computes the r2 score with the predicted value and the true value.
Here you have provided xtest and ypred, so, when the score function predicts the values for xtest, its ypred only, hence giving a 1.0 score.

Hope it cleared your doubt.
Happy Learning :blush:
Thanks

Okay, You mean to say that the LR score must be calculated between y_test(given values) and y_pred(predicted values)?
But, in this challenge, we have no y_test values. how can I calculate correct LR score?

Exactly, that’s why you cant calculate the test accuracy. Only the online judge can calculate it, and thats what your score for that challenge is.
You need to train your model with the training data such that, it performs well on unseen data. The only thing you have to guide you in this is the training accuracy and the training data.

Happy Learning :slight_smile:

Thank you loads!
I appreciate your patience and help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like

how to read the target values into y?
i have read the train X values using the pd.read_csv how to read the target value in y ??