Issue
I’m trying to combine the actual target values and predicted target value as a dataframe. However, I’m getting the following error. Not sure why this is happening.
a = pd.DataFrame(y_test, columns=['Actual'])
b = pd.DataFrame(final_model.predict(X_test), columns=['Predictions'])
c = pd.concat([a, b])
c.head()
Solution
@nimbous already answered but if you want less intermediate steps, use a dictionary to create a df.
c = pd.DataFrame({"Actual": y_test, "Predictions": final_model.predict(X_test)})
Answered By - Shahidur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.