Rndom forest classification steps

Hi all,
When I am using this Random forest classification process with only 2 vector data classes water and non-water, I see this error “bound must be positive” as in the screen capture below.
I try to do again all the previous steps as you said above and I even check the Pixel Info, the intensity of pixel in each band > 0 but this error still appear.
Do you know how to solve this problem?
Thank you in advance.

hi, I also encountered the same problem. Did you solve it?

Thank you.

it has something to do with the projection of your data. Which coordinate reference system did you select in the terrain correction step?

Yes I solved it. Because in the terrain correction step I chose WGS 84, then it happend. So I need to reproject my data. Go to Raster >> Geometric Operations >> Reprojection, and then choose the project as Geographic Lat/Lon (WGS84)

glad to see this worked.
Did the reprojection change your values in any way? If I undestand you correctly you selected WGS84 in the terrain correction and then reprojected also to WGS84?

I reproject the data into Geographic Lat/Lon. After that, the values do not change.
I try some times with some different data and I find out that in the classification step, it works with the Lat/Lon project.

2 Likes

good to know, although it is ab bit strange that this step is required.

hi , i need help
you have created polygon on sigma0_hh_db,s o how you had applied on _glcm product ,as both are different
or i have to stack sigma0_vv_db band to _glcm product.
where to give polygon on sigma0_vv_db or any one of the glcm product

create the GLCM layer and stack it with your oiriginal Sigma0 file. The final product will contain both the intensity and the textures.

1 Like

after following your step ,i got this classification


can help in identifying the black area
as that is a river area, but i made two classes blue showing water area , then why black?
and what does confidence image tells.

areas which are not classified do not fulfill the confidence criterion of Random Forest, that means they cannot be assigned to one of the classes.
You should read a bit about the classifier before applying it:
http://wgrass.media.osaka-cu.ac.jp/gisideas10/papers/04aa1f4a8beb619e7fe711c29b7b.pdf

Please also use the search function for common questions:

1 Like

Did you uesd the raster layer to train the samples ?there I had uesd the raster to classfy the study areas with 3 types .if you do please tell me .

you see in the screenshot that she used training vectors (red squares).

You can only use rasters as training inputs if they represent the final classes (e.g. land cover maps).

Please have a look here: Supervised and unsupervised classification, Sentinel 2

hi,sir it didn’t work when I classfy with RF, as follows ,

what should i do?

Classification of S2 products only works with reprojected data, please have a look here:

thank you sir ,i had get it.

dear ABraun sir,I had a train classification results,as follows,but it failed when i try to run the RFclassfication(my study area is moutain glacier ,need to classfied with wet snow,dry snow ,moranie,and ice) [图片]

please specify the problem.

Dear @ABraun,
I am running Random Forest to classify a stack image (between SAR band and several texture band created from DEM). Bearing in mind that Random Forest can work with data quite flexibly. However, I faced this error and did not know why. Do you have a clue for that?
Thank you!

Another issue is my stacking image could not be opened (after subsetting and applying Land/sea mask). And I don’t know why. Can you please help me to solve it?

image