Classification of Handwritten Digits. Stage 4/5

Data preprocessing

Report a typo

Description

At this stage, we will improve model performance by preprocessing the data. We will see how normalization affects the accuracy. Recall that normalization scales values of features from 0 to 1.

Objectives

  1. Import sklearn.preprocessing.Normalizer transformer;
  2. Initialize the normalizer, transform the features (x_train and x_test), and then save the output to x_train_norm and x_test_norm;
  3. Repeat steps 2-4 from Stage 3;
  4. Answer the following questions:
    • Does the normalization have a positive impact in general? (yes/no)
    • Which two models show the best scores? Round the result to the third decimal place and print the accuracy of models in descending order in the format shown below.

The normalizer's inputs includes train and test sets from Stage 2. The output consists of the preprocessed train and test sets.

Make sure your output format matches the example below.

Example

Example 1: an example of the output

Model: FriendsClassifier()
Accuracy: 0.9945

Model: DecisionFlowerClassifier(random_state=40)
Accuracy: 0.9854

Model: HeuristicRegression()
Accuracy: 0.97

Model: RandomFlowerbedClassifier(random_state=40)
Accuracy: 0.96

The answer to the 1st question: no

The answer to the 2nd question: FriendsClassifier-0.995, RandomFlowerClassifier-0.985
Write a program
IDE integration
Checking the IDE status
___

Create a free account to access the full topic