Code Monkey home page Code Monkey logo

Comments (4)

reiinakano avatar reiinakano commented on May 17, 2024

Hi @ArmandGiraud , could you give small sample code demonstrating the problem?

from scikit-plot.

ArmandGiraud avatar ArmandGiraud commented on May 17, 2024

Hi @reiinakano i tried to reproduce the issue with the digits dataset

from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from scikitplot import plotters as skplt
import pandas as pd
digits = load_digits()
%matplotlib inline

X = digits.data
y = digits.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
test = pd.DataFrame(X_test)
test['target'] = y_test

test_reduced = test.ix[test.target!=0,:]
X_test_reduced = test_reduced.drop('target',axis=1)
y_test_reduced = test_reduced.target
print(set(y_test_reduced)) # we removed 0 from test set. 
lr = LogisticRegression(tol=5) # i set high tolerance so that the classifier sitll predicts some 0's
lr.fit(X_train,y_train)


y_pred  = lr.predict(X_test_reduced)
skplt.plot_confusion_matrix(y_test_reduced, y_pred)

image
From the matrix we can read that the true values contains no occurrences of 1, but it actually does, this first line should refer to 0.

sorry for the ugly syntax, i'm kind of new to python.
thx

from scikit-plot.

reiinakano avatar reiinakano commented on May 17, 2024

Hi @ArmandGiraud , you're absolutely right, this was a bug in the implementation. Rest assured this has been fixed in #29 and is now in the v0.2.5 release. Just run pip install scikit-plot --upgrade and you should be good to go. :)

Thanks for using scikit-plot!

from scikit-plot.

ArmandGiraud avatar ArmandGiraud commented on May 17, 2024

@reiinakano
Thanks a lot, that was a fast fix!

Thank you as well for developping this useful package, it saves a lot of time!

from scikit-plot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.