Exercise

Simple digit recognition

In this exercise, you want to build, train and test the simplest digit recognition algorithm.

However simple or complex the Machine Learning problem at hand may be, it will always contain the following steps:

  • Data loading, preparation and splitting into the train and test partitions
  • Model selection and training ("fitting")
  • Model performance assessment

For this purpose, you will load a dataset containing 1797 images of individual digits, 8x8 pixels in size.

Just remember that you use regressors for predicting quantities and classifiers when dealing with categories as the output.

evaluate_predictions() has been defined for you.

Instructions

100 XP
  • Select the right model to recognize digits: use LinearRegression() if it’s a regression problem and DecisionTreeClassifier() if it’s a classification problem.
  • Use .fit() to fit the model using the training inputs X_train and training labels y_train.
  • Use .predict() to generate predictions on the X_test DataFrame.
  • Evaluate model performance using testing inputs y_test and testing labels prediction_results.