I want to output the prediction values of the random forest results from my test data into Excel and generate a map, but I need to know which line this result is for and use its coordinates, that is, how can I see the index of that test data along with the prediction?(with sklearn)
y_pred=regr.predict(X_test) print(mean_squared_error(y_test,y_pred)) np.savetxt("y_pred.csv",y_pred)
I would use pandas to create a dataframe containing X_test and y_pred and save that.