The scikit-learn
implementation of DecisionTreeClassifier
has a parameter as class_weight
.
As per documentation:
Weights associated with classes in the form {class_label: weight}. If not given, all classes are supposed to have weight one.
and
The “balanced” mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as n_samples / (n_classes * np.bincount(y))
My understanding is that it should be used in case of imbalanced classes.
Question: How does the DT (classification) algorithm use this parameter while determining the ideal split for a given node? Does it consider some kind of "weighted" majority class instead of simple majority class in a region in the prediction space?