# Lable values in Random forest classifier

Dear all,
I have one question about Random forest classification or maybe for others is like this.
I applied RF classifier on the image and I got below result. Their values are from 0 to 7. Is it possible to change their value here in SNAP-for example: 1 to 4 or 2to7?
I do not know how can I manage values of lables?
Thanks,

If you are using “Train on Vectors”, the label values are determined by the number of
“Training vectors” you have chosen. If you have chosen 4 vectors, then
they will have values 0, 1, 2, 3. You cannot change them. You can howevr
use Band Maths to create a virtual band and map 0, 1, 2, 3 to other values
that you want.

1 Like

Yes I think it is not possible to change it. Another question about values; I can be thankful, if you answer this;
I have an image that it has discrete values (from 0 to 9) and I want to display image by this way that every color can be for one value; for example:

0 ----for red
1----for blue
2----for green
and so on till 9

I used ‘range from data’ and ‘display range’ is based on image values from 0 to 9 (as you can see in below image) but I do not know why when I chose ‘Table’, they do not have discrete values?
I have expected that every value can be for one color.
Do you have any idea for changing it?
I read its help but it did not hep……

Hi,

You have mentioned that you have 9 classes. By choosing a range between 0 and 9, this creates 12 classes with values range between 0 and 9.
You should specify 9 classes (this is your actual number of different classes you have) and give it a different color.

Thanks for reply. I have 0 to 9 values, I mean
0……for class 1
1……for class 2
.
.
9……for class 10
As you know when I chose any ‘color ramp’, any of them makes amount of different rows in ‘Table’. For example,
‘cc-chl’ colur map makes 8 rows:

or
‘spectrum_cycle’ makes 12 rows:

But how it is possible to change number of rows or add or remove them until I can have 10 rows ?

You do not have to choose color pallets. The color pallets contain pre-defined classes and colors.
You should add the 9 classes and colors for each class manually as shown in figure below.

Move your cursor on the bottom left window, right click on the color pallet-> add slider. You can add as many sliders as you need. The select table and choose the colors you want for each class

Thank you so much. Your information helps a lot:slight_smile: