I have run Random forest regression with python and I have the fear that I haven't done it correct.

I have original image that has 3 different bands (each pixels has 3 values) and I want to try to see if I can predict the first value using the two others.

For that I used Random Forest regression, I have created train and test and fit the model:


then after I checked the prediction on the test and saw it was good, I wanted to use the same model in order to predict all the values of all the pixels in the image, so I did that:


*data includes all the pixels of the image.

My question : is this the right way to do this? can I just predict all the pixel values just by using the rf.predict after fit it with the train and test sets? Or am I missing here some step that should be taken?


1 Answer 1


It seems good. (Understanding that you are not getting any error)

You are fitting your model in some data, then evaluating on other (basic validation).

Now you have to find data that have the same format and similar distribution and predict there.

You can have a look at the random forest documentation to see what else you can do



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.