marcotcr / lime

Lime: Explaining the predictions of any machine learning classifier
BSD 2-Clause "Simplified" License
11.59k stars 1.81k forks source link

Prediction_local = sum (feature_weight*scaled_feature_value) + intercept #530

Closed charlie9526 closed 4 years ago

charlie9526 commented 4 years ago

I found the following solution from a early solved issue. """Prediction_local is intercept + weights * features. Sorry, this is poorly documented, but the weights are actually relative to the scaled data, so your feature_value column should be scaled. You can get the scaled values by running: (data_toexplain - explainer.scaler.mean) / explainer.scaler.scale_ Or you can believe that I did it right when computing prediction_local : )"""

But I tried this formula to compare the prediction_local with the manual calculated prediction using the feature weights. But unfortunately they are different. (In my case "discretize_continuous" to false.)

Has the Prediction_local = sum (feature_weight*scaled_feature_value) + intercept formula been changed now?

charlie9526 commented 4 years ago

https://github.com/marcotcr/lime/issues/210