Guiding business to better decisions

Introduction to Predictive Analytics in Python

Nele Verbiest, Ph.D

Data Scientist @PythonPredictions

Estimating profit

Introduction to Predictive Analytics in Python

Estimating profit

population_size = 100000
target_incidence = 0.05
reward_target = 50
cost_campaign = 2

def profit(perc_targets, perc_selected, population_size,reward_target, cost_campaign) cost = cost_campaign * perc_selected * population_size reward = reward_target * perc_targets * perc_selected * population_size return(reward - cost)
Introduction to Predictive Analytics in Python

Estimating profit

perc_selected = 0.20
lift = 2.5
perc_targets = lift * target_incidence
print(profit(perc_targets, perc_selected, population_size,
            reward_target, cost_campaign))
60000
print(profit(target_incidence, 1, population_size, reward_target, cost_campaign))
-50000
Introduction to Predictive Analytics in Python

Campaign selection

Introduction to Predictive Analytics in Python
# Information about the campaign
population_size = 1000000
target_incidence = 0.02

# Number of targets you want to reach number_targets_toreach = 16000 perc_targets = number_targets_toreach/(target_incidence*population_size) print(perc_targets_toreach)
0.8
cumulative_gains = 0.60
# Number of donors to reach
number_donors_toreach = cumulative_gains*population_size
print(number_donors_toreach)
600000
Introduction to Predictive Analytics in Python

Let's practice!

Introduction to Predictive Analytics in Python

Preparing Video For Download...