“”
1. Information Gain (IG)
Information Gain measures the reduction in entropy when splitting a dataset based on a feature. It helps to select features by evaluating how much information a feature provides about the target variable.
The formula for Information Gain is:
$$ IG(Y, X) = H(Y) - H(Y | X) $$Where \( H(Y) \) is the entropy of the target variable:
$$ H(Y) = -\sum_{i=1}^{n} p(y_i) \log_2 p(y_i) $$\( H(Y | X) \) is the conditional entropy of the target variable given the feature.
2. Chi-Square Test (\(\chi^2\))
The Chi-Square Test determines the relationship between categorical features and the target. It compares observed and expected frequencies to determine if the feature significantly impacts the target variable.
The formula for the Chi-square statistic is:
$$ \chi^2 = \sum \frac{(O_i - E_i)^2}{E_i} $$Where \( O_i \) is the observed frequency and \( E_i \) is the expected frequency.
3. Fisher’s Score
Fisher’s Score ranks features based on their ability to discriminate between different classes. Features with higher Fisher’s Scores are more useful for classification tasks.
The formula for Fisher’s Score is:
$$ F_j = \frac{(\mu_1 - \mu_2)^2}{\sigma_1^2 + \sigma_2^2} $$Where \( \mu_1 \) and \( \mu_2 \) are the means of the feature values for the two classes, and \( \sigma_1^2 \) and \( \sigma_2^2 \) are the variances for the two classes.
4. Variance Threshold
The Variance Threshold method removes features with variance below a specified threshold. Features with low variance do not contribute much to distinguishing between samples.
The formula for the variance of a feature is:
$$ \text{Var}(X) = \frac{1}{n} \sum_{i=1}^{n} (x_i - \bar{x})^2 $$Where \( x_i \) is the feature value for the \( i^{th} \) sample, and \( \bar{x} \) is the mean of the feature values.