we can determine how the raw pixel data looks the flattened vector representation and the number (class label)which is represented by the image using the following code actual image pixel matrix in [ ]digits images[ out[ ]array([ ] ] ] ] ] ] ] ]]flattened vector in [ ]digits data[ out[ ]array( ]image class label in [ ]digits target[ out[ ] we will later see that we can frame this problem in variety of ways but for this tutorial we will use logistic regression model to do this classification before we proceed to model buildingwe will split the dataset into separate test and train sets the size of the test set is generally dependent on the total amount of data available in our examplewe will use test setwhich is of the overall dataset the total data points in each dataset is printed for ease of understanding in [ ]x_digits digits data y_digits digits target num_data_points len(x_digitsx_train x_digits[:int num_data_points)y_train y_digits[:int num_data_points)x_test x_digits[int num_data_points):y_test y_digits[int num_data_points):print(x_train shapex_test shape( ( from the preceding outputwe can see our train dataset has data points and the test dataset has data points the next step in the process is specifying the model that we will be using and the hyperparameter values that we want to use the values of these hyperparameters do not depend on the underlying data and are usually set prior to model training and are fine tuned for extracting the best model you will learn about tuning later on in this for the time beingwe will use the default values as depicted when we initialize the model estimator and fit our model on the training set