When using the Random Forest algorithm, there are, as the name suggests, some "random" ones for it.
You get a different F1 score because the Random Forest Algorithm (RFA) uses a subset of your data to generate decision trees, and then averages over all of your trees. Therefore, I am not surprised that you have similar (but not identical) F1 scores for each of your runs.
I tried balancing the scales before. You can try balancing weights according to the size of each class in the population. For example, if you must have two classes:
Class A: 5 members Class B: 2 members
You can balance the scales by assigning 2/7 for each Class A member and 5/7 for each Class B member. However, this is just an idea as a starting place. How you weigh your classes will depend on your problem.
ericmjl
source share