ageron / ageron/handson-ml2

Problem with the creation of confusion matix

Open
#182 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
30k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

The given code to return a confusion matrix for the MNIST dataset
y_train_pred = cross_val_predict(sgd_clf, X_train_scaled, y_train, cv=3)
conf_mx = confusion_matrix(y_train, y_train_pred.ravel())
print(conf_mx)

gives the error:
TypeError: 'numpy.ndarray' object is not callable

Does anyone know why?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the MNIST code shown in the issue, including the cross_val_predict and confusion_matrix calls, and inspect the relevant notebook cell and imported functions. Determine why the reported ndarray call error occurs and document a reproducible correction or clarification for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python, scikit-learn
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.