Question: Consider the digits data set from Exercise12. In this exercise, we would like to train a binary classifier for the identification of digit 8 .

Consider the digits data set from Exercise12.

In this exercise, we would like to train a binary classifier for the identification of digit 8 .

(a) Divide the data such that the first 1000 rows are used as the training set and the rest are used as the test set.

(b) Train the LogisticRegression classifier from the sklearn.linear_model package.

(c) "Train" a naïve classifier that always returns 0 . That is, the naïve classifier identifies each instance as being not 8 .

(d) Compare the zero-one test losses of the logistic regression and the naïve classifiers.

(e) Find the confusion matrix, the precision, and the recall of the logistic regression classifier.

(f) Find the fraction of eights that are correctly detected by the logistic regression classifier.

Step by Step Solution

3.45 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The fraction of eights that ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Statistical Techniques in Business Questions!