Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classification: Inconsistent labelling of learner predictions #4

Open
gildasmorvan opened this issue Nov 17, 2023 · 2 comments
Open

Comments

@gildasmorvan
Copy link
Contributor

gildasmorvan commented Nov 17, 2023

The problem occurs when running the predict method of the Learner class:

prediction = explainer.predict(instance)

In this case, labels predicted by the learner are not the labels themselves but the order in which they appear in the dataset.

For example, if the first label in the dataset is 1 and the second is 0, then the learner will respectively predict 0 and 1. Conversely if the first label in the dataset is 0 and the second is 1, then the learner will respectively predict 0 and 1 as expected.

@szczepanskiNicolas
Copy link
Collaborator

szczepanskiNicolas commented Nov 19, 2023

Hello,

Thank you for reporting this problem.

By default, PyXAI renames labels to integers in order to support string labels.

learner.get_label_from_value(value) and learner.get_value_from_label(label) allow to get the right values.
The python dictionary variable learner.dict_labels contains the encoding performed.

I understand that this can be confusing when the labels are already integers ranging from 0 to X.
I'll make a patch to keep the order in this case. I'll keep you posted.

@szczepanskiNicolas
Copy link
Collaborator

In our schedule, the implementation of this feature has been delayed to the 1.0.11 version, which will be released at a later date.

szczepanskiNicolas pushed a commit that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants