The basetable timeline

Intermediate Predictive Analytics in Python

Nele Verbiest Ph. D.

Senior Data Scientist @PythonPredictions

The predictive modeling process

Foundations of predictive analytics I:

  • Build predictive models
  • Evaluate predictive models
  • Present predictive models to business stakeholders

Foundations of predictive analytics II:

  • Construct the basetable
Intermediate Predictive Analytics in Python

The basetable (1)

Intermediate Predictive Analytics in Python

The basetable (2)

Intermediate Predictive Analytics in Python

The basetable (3)

Intermediate Predictive Analytics in Python

The basetable (4)

Intermediate Predictive Analytics in Python

The timeline (1)

Intermediate Predictive Analytics in Python

The timeline (2)

Intermediate Predictive Analytics in Python

The timeline (3)

Intermediate Predictive Analytics in Python

The timeline (4)

Intermediate Predictive Analytics in Python

Reconstructing history (1)

Intermediate Predictive Analytics in Python

Reconstructing history (2)

Intermediate Predictive Analytics in Python

Reconstructing history (3)

Intermediate Predictive Analytics in Python

Selecting relevant data in Python

import pandas as pd
gifts = pd.read_csv("gifts.csv")
gifts["date"] = pd.to_datetime(gifts["date"])
print(gifts.head())
   id       date  amount
0   1 2015-10-16    75.0
1   1 2014-02-11   111.0
2   1 2012-03-28    93.0
3   1 2013-12-13   113.0
4   1 2012-01-10    93.0
start_target = datetime(year = 2018, month = 5, day = 1)
end_target = datetime(year = 2018, month = 8, day = 1)

gifts_target = gifts[(gifts["date"]>=start_target) & (gifts["date"]<end_target)]
gifts_pred_variables = gifts[(gifts["date"]<start_target]
Intermediate Predictive Analytics in Python

Let's practice!

Intermediate Predictive Analytics in Python

Preparing Video For Download...