# ML Modelling

1. Query db (sql) for tracks that have just reached X

2. Shape rows from db

   - clean and interpolate timeseries
   - delta for daily
     -> clean dataframe

3. Create 'Features' Dataset
   `make_features(...)`

   - handle bad first few days
   - age, mins, maxes,
   - 1 row per track (scid)

4. Create XGBoost
   `xgb.DMatrix(feature_dataframe)`

5. Load the trained XGBoost model
   `m = pickle.load()`
   `load_model(m)`

6. Predict the DMatrix

   - returns numpy array of predictions, which is the numberr of days above threshold.

7. Add predictions to the result, for spreadsheet.
