Session Ready
Exercise

Evaluate individual classifiers

In this exercise you'll evaluate the performance of the models in the list classifiers that we defined in the previous exercise. You'll do so by fitting each classifier on the training set and evaluating its test set accuracy.

The dataset is already loaded and preprocessed for you (numerical features are standardized) and it is split into 70% train and 30% test. The features matrices X_train and X_test, as well as the arrays of labels y_train and y_test are available in your workspace. In addition, we have loaded the list classifiers from the previous exercise, as well as the function accuracy_score() from sklearn.metrics.

Instructions
100 XP
  • Iterate over the tuples in classifiers. Use clf_name and clf as the for loop variables:
    • Fit clf to the training set.
    • Predict clf's test set labels and assign the results to y_pred.
    • Evaluate the test set accuracy of clf and print the result.