Predicting CTR with Machine Learning in Python
Kevin Huo
Instructor
print(confusion_matrix(y_test, y_pred))
[[8163 166]
[1517 154]]
# Order: tn, fp, fn, tp
print(confusion_matrix(y_test, y_pred).ravel())
[8163, 166, 1517, 154]
c
and return r
per X number of impressionstotal_return = tp * r
total_cost = (tp + fp) * c
tp * r > (tp + fp) * c
roi = total_return / total_spent
Predicting CTR with Machine Learning in Python