I'm dealing with an unbalanced dataset, so I decided to use a weight dictionary for classification.
Documentation says that a weight dict must be defined as shown below: https://imbalanced-learn.org/stable/generated/imblearn.ensemble.BalancedRandomForestClassifier.html
weight_dict = [{0: 1, 1: 1}, {0: 1, 1: 5}, {0: 1, 1: 1}, {0: 1, 1: 1}]
So, since I want to predict 12 classes which are located in the last column. I assume that the setting would be like:
weight_dict = [{0: 1, 1: 5.77390289e-01}, {0: 1, 1: 6.48317326e-01},
{0: 1, 1: 1.35324885e-01}, {0: 1, 1: 2.92665797e+00},
{0: 1, 1: 5.77858906e+01}, {0: 1, 1: 1.73193507e+00},
{0: 1, 1: 9.27828244e+00}, {0: 1, 1: 1.18766082e+01},
{0: 1, 1: 8.99009985e+01}, {0: 1, 1: 6.39833279e+00},
{0: 1, 1: 2.55347077e+01}, {0: 1, 1: 9.47015372e+02}]
Honestly, I don't clearly understand the notation of the first indicators, I mean the:
0:1 of {0: 1, 1: 1}
or the:
1: value.
Do they represent column position, label order?
What is the right way to set it?
I'll be grateful for your insights.
The notation is
{<class label> : <count>}
. The class label is in its original (ie. untransformed) representation.For example, the following would order the generation of an Iris training set that contains 25 samples of "setosa", and 50 samples of "versicolor" and "virginica" each: