Converting into csv file

Sir, i’m not able to convert my output into a csv file can you please help me out.

Hey Sachin,
Once you get the predictions values for X_test data. You simply need to perform these 2 steps

y_test  = hypothesis(X_test,theta)
df = pd.DataFrame(data=y_test, columns=["y"])
df.to_csv("y_test.csv", index=False)

I hope this piece of code is self explanatory. If still you face any doubt. Do let me know.

Thanks :slight_smile:

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.