What does this function mathematically do?

Dec 2018
42
2
Amsterdam
On the website:
https://chrisalbon.com/machine_learning/trees_and_forests/handle_imbalanced_classes_in_random_forests/

There is the following explanation:

wherein classes are automatically weighted inversely proportional to how frequently they appear in the data. Specifically

$w_j = \frac{n}{kn_{j}}$

where $w_j$ is the weight to class $j$, $n$ is the number of observations, $n_j$ is the number of observations in class $j$, and $k$ is the total number

What does this function mathematically do?
 
May 2013
68
6
okay, lets say there are 10 classes. and we observe the following..
the first class has 25 ob.
the second class has 37 ob.
the third class has 44 ob.
the fourth class has 12 ob.
the fifth class has 20 ob.
the sixth class has 30 ob
the seventh class has 50 ob
the eighth class has 15 ob.
the ninth class has 7 ob.
and the tenth class has 10 ob.

for a total of 250 observations.
so, the second class would have a weight of 250/(10*37) = 0.676
what this tells us is that the more a class is observed, the less "important" it is.