Skip to content Skip to sidebar Skip to footer

Mapping Back Any Sklearn Result To The Original Dataframe

I'd like to analyze the predicted values of my random forest results in excel with the original test data as a reference. The predicted result comes in an array as i use this: pred

Solution 1:

EdChum's answered the question.

(Edit) His answer:

You should be able to just add this back as a new column: test['prediction'] = rf.predict(test[columns])

My apologies for the delay.

Regards, Sunil

Post a Comment for "Mapping Back Any Sklearn Result To The Original Dataframe"