I would like to use SKlearn random forest feature selection function to understand what are the key factors impacting my independent variable (TN pollutant concentration). I have one categorical variables - Climate type, with five types of climate (Temperature-hot, temperature-dry, temperatre warm, tropical and arid), I knew that the climate type has big impact on my independent variable, however, when I used the One hot encoding approach (through pandas get_dummies),I found these climate types (that become five variables with false/true after one hot encoding) were least important, which is not true.
As shown here, the climate variables have the least feature importance score:
My question is that whether the feature selection of random forest is still useful when dealing with categorical variables? and if I did something wrong about it?
This is part of my code:
model = RandomForestRegressor(n_estimators=100, bootstrap = True,max_features = 'sqrt')
model.fit(x_train, y_train)
fi = pd.DataFrame({'feature': list(x_train),'importance':
model.feature_importances_}).sort_values('importance', ascending = False)
plt.bar(fi['feature'],fi['importance'])