aerdem4 / lofo-importance

Leave One Feature Out Importance
MIT License
810 stars 83 forks source link

Multiclass models #36

Open AndreaPesce opened 3 years ago

AndreaPesce commented 3 years ago

The algorithm doesn't support multiclass classification. In infer_model function the classification task is defined only for two unique values of the target.

aerdem4 commented 3 years ago

Hi @AndreaPesce , thanks for your interest in this package. Default model has only simple checks and try to infer the most common use cases. You can provide your multi-class model object (without training) and use LOFO. If you are aware of it and still want to have multi-class in default model, please let me know.

AndreaPesce commented 3 years ago

Hi @aerdem4, thanks for the answer. I'll define the model to be a Classifier.

I think that if I define a classification metric as scoring param, then the model can be for multiclass or binary classification, so the model has to be a classifier. The choice should not depends on the number of unique value, but on the scoring metric.

If there's no need for you to add this option, then I'll close the issue. Thank you again!

aerdem4 commented 3 years ago

If the choice depends on the metric, then I have to keep a static list of all metrics, which will need to be updated every time sklearn is updated. Besides LOFO allows you to have your own metric, then it won't be possible to guess for these custom metrics. I also want the default model to understand if it is a multi-class problem but I am looking for the most convenient solution.

ybdesire commented 2 years ago

the same as https://github.com/aerdem4/lofo-importance/issues/40