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?