Effects of Categorical Encoding, Normalization, and Feature Reduction on Ensemble Learning for Mushroom Edibility Classification

Mushroom edibility classification is an important problem because poisonous mushrooms may cause serious health risks. Machine learning methods can be useful for classifying mushrooms using their different characteristics. However, preprocessing methods and the number of features can affect classification performance. In this study, the effects of categorical encoding, normalization, and feature reduction are investigated using the Secondary Mushroom dataset. Two categorical encoding methods, label encoding and frequency encoding, are considered. Min-max normalization is also applied to examine its effect on the results. Four ensemble machine learning models, namely Random Forest, XGBoost, LightGBM, and AdaBoost, are evaluated. The features are ranked according to their importance, and the models are tested using the top 2 to 20 features. The experiments use an 80:20 hold-out split with a fixed random state. The results show that frequency encoding improves the performance of XGBoost and LightGBM for different feature subsets. Normalization produces almost no change in the accuracy and feature ranking of the investigated tree-based models. Random Forest and LightGBM achieve at least 99.9% accuracy using only eight features. The results indicate that categorical encoding and feature reduction can affect the performance and feature requirement of ensemble models for mushroom classification.