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

Eval metrix calculated with model_performance() differ from those with caret::confusionMatrix() #250

Closed
FrieseWoudloper opened this issue Jun 22, 2020 · 7 comments
Assignees
Labels
feature 💡 New feature or enhancement request R 🐳 Related to R

Comments

@FrieseWoudloper
Copy link

I'd like to compare a decision tree with a random forest, So I first trained a decision tree and calculated some evaluation measures on a test set using caret::confusionMatrix(). I did the same using the DALEX package. Although the trees and predictions are the same, the metrics (precision, recall, F1) calculated by model_performance() differ from those calculated with caret::confusionMatrix(). Why is this? Am I doing something wrong?
See: https://rpubs.com/friesewoudloper/630778

@hbaniecki
Copy link
Member

hbaniecki commented Jun 22, 2020

Hi,
I believe that caret uses 0 as the positive class and DALEX uses 1 as the positive class.
https://stackoverflow.com/questions/38263137/set-positive-class-to-1-in-r

@hbaniecki hbaniecki added the R 🐳 Related to R label Jun 22, 2020
@pbiecek
Copy link
Member

pbiecek commented Jun 22, 2020

@maksymiuks can we take care about this in the default predict function?

@maksymiuks
Copy link
Member

It is, but the solution would require modification of the input model (adding an attribute in explainer function)

@hbaniecki
Copy link
Member

Why not in model_performance?

@pbiecek
Copy link
Member

pbiecek commented Jun 22, 2020

imho either explainer or predict function should know which label is positive

@hbaniecki hbaniecki added feature 💡 New feature or enhancement request long term 📆 TODO long term labels Jul 22, 2020
@maksymiuks maksymiuks self-assigned this Aug 3, 2020
@maksymiuks
Copy link
Member

Let's focus on it after DALEX 2.0.0 release.

@maksymiuks maksymiuks added short term ⏰ TODO short term and removed long term 📆 TODO long term labels Aug 27, 2020
@maksymiuks maksymiuks added this to the DALEX v2.0.0 milestone Aug 27, 2020
@pbiecek pbiecek removed this from the DALEX v2.0.0 milestone Aug 29, 2020
@pbiecek pbiecek removed the short term ⏰ TODO short term label Aug 29, 2020
maksymiuks added a commit that referenced this issue Aug 29, 2020
pbiecek pushed a commit that referenced this issue Aug 29, 2020
* Positive class support

* Update README.md

* Remove #250 content

* typo fix

* News added

* Added tests for new warnings

* Typo fix

* Update NEWS.md
pbiecek pushed a commit that referenced this issue Nov 15, 2020
* yhat changed

* typo fix

* Ver upgrade

* Extend test, fix documantation

* add external tests

* Update NEWS.md

* Parameter name change

* New param name

* add predict column for multiclass

* Update misc_yhat.R

* Change name of the parameter
@maksymiuks
Copy link
Member

Solved in #353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 💡 New feature or enhancement request R 🐳 Related to R
Projects
None yet
Development

No branches or pull requests

4 participants