Selecting Feature weights

I use the knn Classifier for a binary classification problem. To improve the classification results I would like to multiply features by weights that are learned from data.

I found different ways to find feature importance values, e.g., the feature_importance of RandomForest or the mutual information value for each feature.

Is it meaningfull to use these values as weights for the features and use them for the distance calculation in the knn classifier?

• I wanted to multiply the feature with weights, so that the distance between not important feature will not have a big influence on the whole distance. $d(x,y)=\sum_i (w_i * |x_i-y_i|)$ – methus Dec 30 '19 at 10:40