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

I get "TypeError: 'module' object is not subscriptable" for cm module #616

Open
Sunprince22 opened this issue May 30, 2023 · 2 comments
Open

Comments

@Sunprince22
Copy link

image

"3rd Chapter - Classification"

from matplotlib import cm
cm[1, 1] / (cm[1, 1] + (cm[1, 0] + cm[0, 1]) / 2)

for the above code I get this typerror. It will so helpful if you could help me resolve this issue with my system.

TypeError Traceback (most recent call last)
in <cell line: 2>()
1 from matplotlib import cm
----> 2 cm[1, 1] / (cm[1, 1] + (cm[1, 0] + cm[0, 1]) / 2)

TypeError: 'module' object is not subscriptable

@rupeshchiluka001
Copy link

The cm mentioned in the chapter is referring to confusion_matrix (which is imported from sklearn.metrics), not matplotlib.cm.

@Sunprince22
Copy link
Author

Thank you so much @rupeshchiluka001

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