109k views
2 votes
Follow these steps:

Create a file called mnist_task.ipynb.

Load the MNIST dataset. Use a library such as SKLearn to access the dataset (from sklearn.datasets import load_digits).

Split the training data into a training and test set.

Add a comment explaining the purpose of the train and test sets

Use the RandomForestClassifier built into sklearn to create a classification model.

Pick one parameter to tune, and explain why you chose this parameter.

Choose which value for the parameter to set for testing on the test data and explain why.

Print the confusion matrix for your Random Forest model on the test set.

Report which classes the model struggles with the most.

Report the accuracy, precision, recall, and f1-score

User Metaphori
by
8.1k points

1 Answer

6 votes

Final answer:

The student's task is to develop a RandomForestClassifier using the MNIST dataset, select and tune a parameter, and evaluate the model's performance through metrics like accuracy, precision, recall, and f1-score.

Step-by-step explanation:

The student's question involves creating a machine learning model to classify handwritten digits using the MNIST dataset, a classic problem in the field of computer vision and machine learning. The steps involve writing code in a Jupyter Notebook, loading the dataset, splitting it into training and testing sets, and explaining the rationale behind this. Next, a RandomForestClassifier from the sklearn library is used to build the model. One parameter must be selected for tuning to improve the model's performance; a common choice might be the number of trees (n_estimators) because it can significantly affect the model's accuracy and overfitting. After choosing a parameter value, the student should test the model on the test data and print out a confusion matrix to visualize the model's performance. Finally, the student is expected to report the model's accuracy, precision, recall, and f1-score, and discuss which classes are most challenging for the model to predict correctly.

User Nimatullah Razmjo
by
7.0k points