Predicting CTR with Machine Learning in Python
Kevin Huo
Instructor
Precision: ROI on ad spend through clicks
Recall: targeting relevant audience
It may be sensible to weight the two differently
$$F_\beta = (1+\beta^2)\cdot\frac{\text{precision}\cdot\text{recall}}{(\beta^2 \cdot \text{precision}) + \text{recall}}$$
Beta coefficient: represents relative weighting of two metrics
Implementation available in sklearn
via: fbeta_score(y_true, y_pred, beta)
y_true
is true targets and y_pred
the predicted targetsroc_auc = roc_auc_score(y_test, y_score[:, 1])
fpr = 1 - tn / (tn + fp)
precision = tp / (tp + fp)
fpr
can be low when precision
is also low.fpr = 1 - 100 / (100 + 10) = 0.091
precision = tp / (tp + fp) = 0.5
F-beta score
c
and return r
total_return = tp * r
total_spent = (tp + fp) * cost
roi = total_return / total_spent
= (tp) / (tp + fp) * (r / cost)
= precision * (r / cost)
Predicting CTR with Machine Learning in Python