Session Ready
Exercise

Classifier comparison

The ROI framework can be run across different classifiers to see how higher precision and recall lead to higher ROI values. Note that the baseline classifier you created would have a total return and cost of 0 since both the true positives tp and false positives fp will be 0 by design. In this exercise, you will use the ROI framework to compare a logistic regression and decision tree classifier.

X_train, y_train, X_test, y_test are available in your workspace along with pandas as pd, numpy as np. LogisticRegression() from sklearn.linear_model is available as well.

Instructions 1/2
undefined XP
  • 1
    • Create a logistic regression classifier and generate test predictions.
    • Calculate total return, total spent, and ROI.
    • 2
      • Create a decision tree classifier and generate test predictions.
      • Calculate total return, total cost, and ROI.