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 report shows classes inverted if passed from sklearn label encoder #1313

Open
alessandrofilisetti opened this issue May 9, 2024 · 0 comments

Comments

@alessandrofilisetti
Copy link

Describe the bug
The same classes passed through sklearn label encoder are shown inverted in classification report. I tried the same with confusion matrix and classes are correctly shown

To Reproduce

 # CLASSIFICATION REPORT
  visualizer = ClassificationReport(
      pipeline,
      classes = label_encoder.classes_,
      cmap="YlGn", 
      support=True
  )
  visualizer.fit(X_train, y_train)
  visualizer.score(X_test, y_test) 

  # CONFUSION MATRIX
  cm = ConfusionMatrix(
      pipeline, 
      classes= label_encoder.classes_,
      cmap='Greens'
  )
  
  cm.fit(X_train, y_train)
  cm.score(X_test, y_test)

Dataset
Whatever dataset you prefer

Expected behavior
Coherent classes visualization

Desktop (please complete the following information):

  • OS: Cloud Jupiter notebook
  • Python Version 3.11
  • Yellowbrick Version 1.5
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

1 participant