Predicting CTR with Machine Learning in Python
Kevin Huo
Instructor
TP / (TP + FP)
TP / (TP + FN)
print(precision_score(
y_test, y_pred, average = 'weighted'))
0.73
print(recall_score(
y_test, y_pred, average = 'weighted'))
0.75
y_pred = np.asarray([0 for x in range(len(X_test))])
[[0]
[0] ...]
tp
and fp
will be zeroconfusion_matrix()
along with ravel()
to get the four categories of outcomestotal_return = tp * r
total_spent = (tp + fp) * cost
roi = total_return / total_spent
Predicting CTR with Machine Learning in Python