Predicting CTR with Machine Learning in Python
Kevin Huo
Instructor
.isin()
: df.columns.isin(['device'])]
y
is a column of clicks, CTR can be found by: y.sum()/len(y)
print(df.device_type.value_counts())
1 45902
0 2947
print(df.groupby('device_type')['click'].sum())
0 633
1 7890
Predicting CTR with Machine Learning in Python