March 2019
Beginner to intermediate
464 pages
10h 57m
English
First, we are going to look at the aggregate conversion rate. We can calculate this metric by dividing the total number of clients subscribed to a term deposit by the total number of clients in the data. Since we have already encoded the output variable as 1 for those who have converted and 0 for those who have not, in a column named conversion, we can simply sum over this column to get the total number of conversions.
The following code snippet shows how we can sum over the conversion column and get the total number of clients in the data:
# total number of conversionsdf.conversion.sum()# total number of clients in the data (= number of rows in the data)df.shape[0]
The following is what our code for conversion rate ...
Read now
Unlock full access