Santiago Roman commited on
Commit
e57d1ba
1 Parent(s): 495d6b8
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -23,19 +23,19 @@ model = mr.get_model("cohort_model", version=1)
23
  model_dir = model.download()
24
  model = joblib.load(model_dir + "/xgb_.pkl")
25
 
26
- # Get feature view in a dataframe
27
- data, labels = feature_view.get_training_data(training_dataset_version=1)
28
- data["percentage_future"] = labels
29
 
30
- # Convert it to pandas datetime
31
- data["cohort_first_month"] = pd.to_datetime(data["cohort_first_month"])
32
- data["month"] = pd.to_datetime(data["month"])
33
 
34
- # Sort and assert
35
- data = data.sort_values(by=["cohort_first_product", "cohort_first_month", "month"])
 
36
 
 
 
 
37
 
38
- def cohort_predict(cohort_start, start_date, product):
 
39
 
40
  new_seq = generate_new_data(data, cohort_start, start_date, product, model, X_columns_to_drop, 12)
41
  hist_seq = get_sequence(data, cohort_start, product)
 
23
  model_dir = model.download()
24
  model = joblib.load(model_dir + "/xgb_.pkl")
25
 
 
 
 
26
 
27
+ def cohort_predict(cohort_start, start_date, product):
 
 
28
 
29
+ # Get feature view in a dataframe
30
+ data, labels = feature_view.get_training_data(training_dataset_version=1)
31
+ data["percentage_future"] = labels
32
 
33
+ # Convert it to pandas datetime
34
+ data["cohort_first_month"] = pd.to_datetime(data["cohort_first_month"])
35
+ data["month"] = pd.to_datetime(data["month"])
36
 
37
+ # Sort and assert
38
+ data = data.sort_values(by=["cohort_first_product", "cohort_first_month", "month"])
39
 
40
  new_seq = generate_new_data(data, cohort_start, start_date, product, model, X_columns_to_drop, 12)
41
  hist_seq = get_sequence(data, cohort_start, product)