Repository: Aarhus-Psychiatry-Research/timeseriesflattener

Issue:
feat: add option to specify time range in predictions
Creating features in bins of e.g. 0-7, 7-30, 30-90, 90-365, 365-... days from prediction time instead of always going from 0-n as we do now, could potentially keep more temporal information and create better predictors. 



Discussion:

Patch:
diff --git a/docs/tutorials/01_basic.ipynb b/docs/tutorials/01_basic.ipynb
index 9bdd35d..a354fae 100644
--- a/docs/tutorials/01_basic.ipynb
+++ b/docs/tutorials/01_basic.ipynb
@@ -52,6 +52,15 @@
    "execution_count": 1,
    "metadata": {},
    "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/Users/au554730/Desktop/Projects/timeseriesflattener/.venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:\n",
+      "* 'allow_mutation' has been removed\n",
+      "  warnings.warn(message, UserWarning)\n"
+     ]
+    },
     {
      "data": {
       "text/html": [
@@ -877,7 +886,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 11,
+   "execution_count": 5,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -908,6 +917,8 @@
     "\n",
     "We also specify that the outcome is not incident. This means that patient ID (dw_ek_borger) can experience the outcome more than once. If the outcome was marked as incident, all prediction times after the patient experiences the outcome are dropped. This is useful for cases where an event is permanent - for example, whether a patient has type 1 diabetes or not.\n",
     "\n",
+    "Here, we specifiy that we want to look 365 days forward from the prediction time to search for outcomes. If we wanted to require a certain period of time from the prediction time before we look for outcome values, we can specify `lookahead_days` as an interval of (min_days, max_days) as a tuple instead. \n",
+    "\n",
     "Lastly, we specify a name of the outcome which'll be used when generating its column."
    ]
   },
@@ -956,6 +967,30 @@
     "Values within the *lookbehind* window are aggregated using `aggregation_fn`, for example the mean as shown in this example, or max/min etc. "
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Temporal predictors can also be specified to look for values within a certain time range from the prediction time, similar to outcome specifications. For instance, you might want to create multiple predictors, where one looks for values within (0, 30) days, and another within (31, 182) days.  \n",
+    "\n",
+    "This can easily be specified by passing a tuple[min_days, max_days] to the lookbehind_days parameter."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "temporal_interval_predictor_spec = PredictorSpec(\n",
+    "    timeseries_df=df_synth_predictors,\n",
+    "    lookbehind_days=(30, 90),\n",
+    "    fallback=np.nan,\n",
+    "    aggregation_fn=mean,\n",
+    "    feature_base_name=\"predictor_interval_name\",\n",
+    ")"
+   ]
+  },
   {
    "attachments": {},
    "cell_type": "markdown",
@@ -1146,30 +1181,33 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 12,
+   "execution_count": 10,
    "metadata": {},
    "outputs": [],
    "source": [
-    "ts_flattener.add_spec([sex_predictor_spec, temporal_predictor_spec, outcome_spec])"
+    "ts_flattener.add_spec([sex_predictor_spec, temporal_predictor_spec, temporal_interval_predictor_spec, outcome_spec])"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 13,
+   "execution_count": 11,
    "metadata": {},
    "outputs": [
     {
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "2023-06-14 16:11:40 [INFO] There were unprocessed specs, computing...\n",
-      "2023-06-14 16:11:40 [INFO] _drop_pred_time_if_insufficient_look_distance: Dropped 5999 (59.99%) rows\n",
-      "2023-06-14 16:11:40 [INFO] Processing 2 temporal features in parallel with 1 workers. Chunksize is 2. If this is above 1, it may take some time for the progress bar to move, as processing is batched. However, this makes for much faster total performance.\n",
-      "100%|██████████| 2/2 [00:00<00:00,  2.14it/s]\n",
-      "2023-06-14 16:11:41 [INFO] Checking alignment of dataframes - this might take a little while (~2 minutes for 1.000 dataframes with 2.000.000 rows).\n",
-      "2023-06-14 16:11:41 [INFO] Starting concatenation. Will take some time on performant systems, e.g. 30s for 100 features and 2_000_000 prediction times. This is normal.\n",
-      "2023-06-14 16:11:41 [INFO] Concatenation took 0.003 seconds\n",
-      "2023-06-14 16:11:41 [INFO] Merging with original df\n"
+      "2024-01-18 11:34:22 [INFO] There were unprocessed specs, computing...\n",
+      "2024-01-18 11:34:22 [INFO] _drop_pred_time_if_insufficient_look_distance: Dropped 5999 (59.99%) rows\n",
+      "2024-01-18 11:34:22 [INFO] Processing 3 temporal features in parallel with 1 workers. Chunksize is 3. If this is above 1, it may take some time for the progress bar to move, as processing is batched. However, this makes for much faster total performance.\n",
+      "  0%|          | 0/3 [00:00<?, ?it/s]/Users/au554730/Desktop/Projects/timeseriesflattener/.venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:\n",
+      "* 'allow_mutation' has been removed\n",
+      "  warnings.warn(message, UserWarning)\n",
+      "100%|██████████| 3/3 [00:01<00:00,  2.11it/s]\n",
+      "2024-01-18 11:34:24 [INFO] Checking alignment of dataframes - this might take a little while (~2 minutes for 1.000 dataframes with 2.000.000 rows).\n",
+      "2024-01-18 11:34:24 [INFO] Starting concatenation. Will take some time on performant systems, e.g. 30s for 100 features and 2_000_000 prediction times. This is normal.\n",
+      "2024-01-18 11:34:24 [INFO] Concatenation took 0.005 seconds\n",
+      "2024-01-18 11:34:24 [INFO] Merging with original df\n"
      ]
     },
     {
@@ -1180,20 +1218,21 @@
        "│ ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ ┏━━━━━━━━━━━━━┳━━━━━━━┓                                                          │\n",
        "│ ┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> dataframe         </span>┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> Values </span>┃ ┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> Column Type </span>┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> Count </span>┃                                                          │\n",
        "│ ┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ ┡━━━━━━━━━━━━━╇━━━━━━━┩                                                          │\n",
-       "│ │ Number of rows    │ 4001   │ │ int64       │ 2     │                                                          │\n",
-       "│ │ Number of columns │ 6      │ │ float64     │ 2     │                                                          │\n",
+       "│ │ Number of rows    │ 4001   │ │ float64     │ 3     │                                                          │\n",
+       "│ │ Number of columns │ 7      │ │ int64       │ 2     │                                                          │\n",
        "│ └───────────────────┴────────┘ │ datetime64  │ 1     │                                                          │\n",
        "│                                │ string      │ 1     │                                                          │\n",
        "│                                └─────────────┴───────┘                                                          │\n",
        "│ <span style=\"font-style: italic\">                                                    number                                                    </span>  │\n",
-       "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓  │\n",
-       "│ ┃<span style=\"font-weight: bold\"> column_name                </span>┃<span style=\"font-weight: bold\"> NA  </span>┃<span style=\"font-weight: bold\"> NA %   </span>┃<span style=\"font-weight: bold\"> mean    </span>┃<span style=\"font-weight: bold\"> sd     </span>┃<span style=\"font-weight: bold\"> p0      </span>┃<span style=\"font-weight: bold\"> p25    </span>┃<span style=\"font-weight: bold\"> p75   </span>┃<span style=\"font-weight: bold\"> p100   </span>┃<span style=\"font-weight: bold\"> hist    </span>┃  │\n",
-       "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩  │\n",
-       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">entity_id                 </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   5000</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2900</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      3</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2600</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 7500</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 10000</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█████▇ </span> │  │\n",
-       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_predictor_name_      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 72</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.097</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   3.9</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   9.9</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▁▃██▃▁ </span> │  │\n",
-       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">outc_outcome_name_wi      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.064</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.25</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     1</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█    ▁ </span> │  │\n",
-       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_female               </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.49</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     1</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█    █ </span> │  │\n",
-       "│ └────────────────────────────┴─────┴────────┴─────────┴────────┴─────────┴────────┴───────┴────────┴─────────┘  │\n",
+       "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┓  │\n",
+       "│ ┃<span style=\"font-weight: bold\"> column_name               </span>┃<span style=\"font-weight: bold\"> NA     </span>┃<span style=\"font-weight: bold\"> NA %   </span>┃<span style=\"font-weight: bold\"> mean    </span>┃<span style=\"font-weight: bold\"> sd     </span>┃<span style=\"font-weight: bold\"> p0      </span>┃<span style=\"font-weight: bold\"> p25   </span>┃<span style=\"font-weight: bold\"> p75   </span>┃<span style=\"font-weight: bold\"> p100   </span>┃<span style=\"font-weight: bold\"> hist   </span>┃  │\n",
+       "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━┩  │\n",
+       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">entity_id                </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   5000</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2900</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      3</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 2600</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 7500</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 10000</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█████▇</span> │  │\n",
+       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_predictor_name_     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    72</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.097</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  3.9</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   9.9</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▁▃██▃▁</span> │  │\n",
+       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_predictor_inter     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2900</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    72</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   2.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.02</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  7.4</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▇▇▇██▇</span> │  │\n",
+       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">outc_outcome_name_wi     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.064</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.25</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     1</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█    ▁</span> │  │\n",
+       "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_female              </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.49</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     1</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█    █</span> │  │\n",
+       "│ └───────────────────────────┴────────┴────────┴─────────┴────────┴─────────┴───────┴───────┴────────┴────────┘  │\n",
        "│ <span style=\"font-style: italic\">                                                   datetime                                                   </span>  │\n",
        "│ ┏━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓  │\n",
        "│ ┃<span style=\"font-weight: bold\"> column_name      </span>┃<span style=\"font-weight: bold\"> NA   </span>┃<span style=\"font-weight: bold\"> NA %    </span>┃<span style=\"font-weight: bold\"> first                      </span>┃<span style=\"font-weight: bold\"> last                       </span>┃<span style=\"font-weight: bold\"> frequency    </span>┃  │\n",
@@ -1215,20 +1254,21 @@
        "│ ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ ┏━━━━━━━━━━━━━┳━━━━━━━┓                                                          │\n",
        "│ ┃\u001b[1;36m \u001b[0m\u001b[1;36mdataframe        \u001b[0m\u001b[1;36m \u001b[0m┃\u001b[1;36m \u001b[0m\u001b[1;36mValues\u001b[0m\u001b[1;36m \u001b[0m┃ ┃\u001b[1;36m \u001b[0m\u001b[1;36mColumn Type\u001b[0m\u001b[1;36m \u001b[0m┃\u001b[1;36m \u001b[0m\u001b[1;36mCount\u001b[0m\u001b[1;36m \u001b[0m┃                                                          │\n",
        "│ ┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ ┡━━━━━━━━━━━━━╇━━━━━━━┩                                                          │\n",
-       "│ │ Number of rows    │ 4001   │ │ int64       │ 2     │                                                          │\n",
-       "│ │ Number of columns │ 6      │ │ float64     │ 2     │                                                          │\n",
+       "│ │ Number of rows    │ 4001   │ │ float64     │ 3     │                                                          │\n",
+       "│ │ Number of columns │ 7      │ │ int64       │ 2     │                                                          │\n",
        "│ └───────────────────┴────────┘ │ datetime64  │ 1     │                                                          │\n",
        "│                                │ string      │ 1     │                                                          │\n",
        "│                                └─────────────┴───────┘                                                          │\n",
        "│ \u001b[3m                                                    number                                                    \u001b[0m  │\n",
-       "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓  │\n",
-       "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mmean   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1msd    \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp0     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp25   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp75  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp100  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mhist   \u001b[0m\u001b[1m \u001b[0m┃  │\n",
-       "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩  │\n",
-       "│ │ \u001b[38;5;141mentity_id                 \u001b[0m │ \u001b[36m  0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m   5000\u001b[0m │ \u001b[36m  2900\u001b[0m │ \u001b[36m      3\u001b[0m │ \u001b[36m  2600\u001b[0m │ \u001b[36m 7500\u001b[0m │ \u001b[36m 10000\u001b[0m │ \u001b[32m█████▇ \u001b[0m │  │\n",
-       "│ │ \u001b[38;5;141mpred_predictor_name_      \u001b[0m │ \u001b[36m 72\u001b[0m │ \u001b[36m   1.8\u001b[0m │ \u001b[36m      5\u001b[0m │ \u001b[36m   1.6\u001b[0m │ \u001b[36m  0.097\u001b[0m │ \u001b[36m   3.9\u001b[0m │ \u001b[36m    6\u001b[0m │ \u001b[36m   9.9\u001b[0m │ \u001b[32m▁▃██▃▁ \u001b[0m │  │\n",
-       "│ │ \u001b[38;5;141moutc_outcome_name_wi      \u001b[0m │ \u001b[36m  0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m  0.064\u001b[0m │ \u001b[36m  0.25\u001b[0m │ \u001b[36m      0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m     1\u001b[0m │ \u001b[32m█    ▁ \u001b[0m │  │\n",
-       "│ │ \u001b[38;5;141mpred_female               \u001b[0m │ \u001b[36m  0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m   0.49\u001b[0m │ \u001b[36m   0.5\u001b[0m │ \u001b[36m      0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m    1\u001b[0m │ \u001b[36m     1\u001b[0m │ \u001b[32m█    █ \u001b[0m │  │\n",
-       "│ └────────────────────────────┴─────┴────────┴─────────┴────────┴─────────┴────────┴───────┴────────┴─────────┘  │\n",
+       "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┓  │\n",
+       "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name              \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA    \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mmean   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1msd    \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp0     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp25  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp75  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp100  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mhist  \u001b[0m\u001b[1m \u001b[0m┃  │\n",
+       "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━┩  │\n",
+       "│ │ \u001b[38;5;141mentity_id                \u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m   5000\u001b[0m │ \u001b[36m  2900\u001b[0m │ \u001b[36m      3\u001b[0m │ \u001b[36m 2600\u001b[0m │ \u001b[36m 7500\u001b[0m │ \u001b[36m 10000\u001b[0m │ \u001b[32m█████▇\u001b[0m │  │\n",
+       "│ │ \u001b[38;5;141mpred_predictor_name_     \u001b[0m │ \u001b[36m    72\u001b[0m │ \u001b[36m   1.8\u001b[0m │ \u001b[36m      5\u001b[0m │ \u001b[36m   1.6\u001b[0m │ \u001b[36m  0.097\u001b[0m │ \u001b[36m  3.9\u001b[0m │ \u001b[36m    6\u001b[0m │ \u001b[36m   9.9\u001b[0m │ \u001b[32m▁▃██▃▁\u001b[0m │  │\n",
+       "│ │ \u001b[38;5;141mpred_predictor_inter     \u001b[0m │ \u001b[36m  2900\u001b[0m │ \u001b[36m    72\u001b[0m │ \u001b[36m      5\u001b[0m │ \u001b[36m   2.8\u001b[0m │ \u001b[36m   0.02\u001b[0m │ \u001b[36m  2.6\u001b[0m │ \u001b[36m  7.4\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m▇▇▇██▇\u001b[0m │  │\n",
+       "│ │ \u001b[38;5;141moutc_outcome_name_wi     \u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m  0.064\u001b[0m │ \u001b[36m  0.25\u001b[0m │ \u001b[36m      0\u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m     1\u001b[0m │ \u001b[32m█    ▁\u001b[0m │  │\n",
+       "│ │ \u001b[38;5;141mpred_female              \u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m   0.49\u001b[0m │ \u001b[36m   0.5\u001b[0m │ \u001b[36m      0\u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m    1\u001b[0m │ \u001b[36m     1\u001b[0m │ \u001b[32m█    █\u001b[0m │  │\n",
+       "│ └───────────────────────────┴────────┴────────┴─────────┴────────┴─────────┴───────┴───────┴────────┴────────┘  │\n",
        "│ \u001b[3m                                                   datetime                                                   \u001b[0m  │\n",
        "│ ┏━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓  │\n",
        "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mfirst                     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mlast                      \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mfrequency   \u001b[0m\u001b[1m \u001b[0m┃  │\n",
@@ -1253,12 +1293,13 @@
        "['entity_id',\n",
        " 'timestamp',\n",
        " 'prediction_time_uuid',\n",
-       " 'pred_predictor_name_within_730_days_mean_fallback_nan',\n",
-       " 'outc_outcome_name_within_365_days_maximum_fallback_0_dichotomous',\n",
+       " 'pred_predictor_name_within_0_to_730_days_mean_fallback_nan',\n",
+       " 'pred_predictor_interval_name_within_30_to_90_days_mean_fallback_nan',\n",
+       " 'outc_outcome_name_within_0_to_365_days_maximum_fallback_0_dichotomous',\n",
        " 'pred_female']"
       ]
      },
-     "execution_count": 13,
+     "execution_count": 11,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1273,7 +1314,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 14,
+   "execution_count": 12,
    "metadata": {},
    "outputs": [
     {
@@ -1281,117 +1322,128 @@
       "text/html": [
        "<style type=\"text/css\">\n",
        "</style>\n",
-       "<table id=\"T_003c4\" style=\"font-size: 14px\">\n",
+       "<table id=\"T_4dbad\" style=\"font-size: 14px\">\n",
        "  <thead>\n",
        "    <tr>\n",
        "      <th class=\"blank level0\" >&nbsp;</th>\n",
-       "      <th id=\"T_003c4_level0_col0\" class=\"col_heading level0 col0\" >entity_id</th>\n",
-       "      <th id=\"T_003c4_level0_col1\" class=\"col_heading level0 col1\" >timestamp</th>\n",
-       "      <th id=\"T_003c4_level0_col2\" class=\"col_heading level0 col2\" >prediction_time_uuid</th>\n",
-       "      <th id=\"T_003c4_level0_col3\" class=\"col_heading level0 col3\" >pred_X</th>\n",
-       "      <th id=\"T_003c4_level0_col4\" class=\"col_heading level0 col4\" >outc_Y</th>\n",
-       "      <th id=\"T_003c4_level0_col5\" class=\"col_heading level0 col5\" >pred_female</th>\n",
+       "      <th id=\"T_4dbad_level0_col0\" class=\"col_heading level0 col0\" >entity_id</th>\n",
+       "      <th id=\"T_4dbad_level0_col1\" class=\"col_heading level0 col1\" >timestamp</th>\n",
+       "      <th id=\"T_4dbad_level0_col2\" class=\"col_heading level0 col2\" >prediction_time_uuid</th>\n",
+       "      <th id=\"T_4dbad_level0_col3\" class=\"col_heading level0 col3\" >pred_X</th>\n",
+       "      <th id=\"T_4dbad_level0_col4\" class=\"col_heading level0 col4\" >pred_X_30_to_90</th>\n",
+       "      <th id=\"T_4dbad_level0_col5\" class=\"col_heading level0 col5\" >outc_Y</th>\n",
+       "      <th id=\"T_4dbad_level0_col6\" class=\"col_heading level0 col6\" >pred_female</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
-       "      <td id=\"T_003c4_row0_col0\" class=\"data row0 col0\" >9903</td>\n",
-       "      <td id=\"T_003c4_row0_col1\" class=\"data row0 col1\" >1968-05-09 21:24:00</td>\n",
-       "      <td id=\"T_003c4_row0_col2\" class=\"data row0 col2\" >9903-1968-05-09-21-24-00</td>\n",
-       "      <td id=\"T_003c4_row0_col3\" class=\"data row0 col3\" >0.990763</td>\n",
-       "      <td id=\"T_003c4_row0_col4\" class=\"data row0 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row0_col5\" class=\"data row0 col5\" >0</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
-       "      <td id=\"T_003c4_row1_col0\" class=\"data row1 col0\" >6447</td>\n",
-       "      <td id=\"T_003c4_row1_col1\" class=\"data row1 col1\" >1967-09-25 18:08:00</td>\n",
-       "      <td id=\"T_003c4_row1_col2\" class=\"data row1 col2\" >6447-1967-09-25-18-08-00</td>\n",
-       "      <td id=\"T_003c4_row1_col3\" class=\"data row1 col3\" >5.582745</td>\n",
-       "      <td id=\"T_003c4_row1_col4\" class=\"data row1 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row1_col5\" class=\"data row1 col5\" >1</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
-       "      <td id=\"T_003c4_row2_col0\" class=\"data row2 col0\" >4927</td>\n",
-       "      <td id=\"T_003c4_row2_col1\" class=\"data row2 col1\" >1968-06-30 12:13:00</td>\n",
-       "      <td id=\"T_003c4_row2_col2\" class=\"data row2 col2\" >4927-1968-06-30-12-13-00</td>\n",
-       "      <td id=\"T_003c4_row2_col3\" class=\"data row2 col3\" >4.957251</td>\n",
-       "      <td id=\"T_003c4_row2_col4\" class=\"data row2 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row2_col5\" class=\"data row2 col5\" >0</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
-       "      <td id=\"T_003c4_row3_col0\" class=\"data row3 col0\" >5475</td>\n",
-       "      <td id=\"T_003c4_row3_col1\" class=\"data row3 col1\" >1967-01-09 03:09:00</td>\n",
-       "      <td id=\"T_003c4_row3_col2\" class=\"data row3 col2\" >5475-1967-01-09-03-09-00</td>\n",
-       "      <td id=\"T_003c4_row3_col3\" class=\"data row3 col3\" >5.999336</td>\n",
-       "      <td id=\"T_003c4_row3_col4\" class=\"data row3 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row3_col5\" class=\"data row3 col5\" >0</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
-       "      <td id=\"T_003c4_row4_col0\" class=\"data row4 col0\" >9793</td>\n",
-       "      <td id=\"T_003c4_row4_col1\" class=\"data row4 col1\" >1968-12-15 12:59:00</td>\n",
-       "      <td id=\"T_003c4_row4_col2\" class=\"data row4 col2\" >9793-1968-12-15-12-59-00</td>\n",
-       "      <td id=\"T_003c4_row4_col3\" class=\"data row4 col3\" >7.294038</td>\n",
-       "      <td id=\"T_003c4_row4_col4\" class=\"data row4 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row4_col5\" class=\"data row4 col5\" >0</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
-       "      <td id=\"T_003c4_row5_col0\" class=\"data row5 col0\" >9768</td>\n",
-       "      <td id=\"T_003c4_row5_col1\" class=\"data row5 col1\" >1967-07-04 23:09:00</td>\n",
-       "      <td id=\"T_003c4_row5_col2\" class=\"data row5 col2\" >9768-1967-07-04-23-09-00</td>\n",
-       "      <td id=\"T_003c4_row5_col3\" class=\"data row5 col3\" >4.326286</td>\n",
-       "      <td id=\"T_003c4_row5_col4\" class=\"data row5 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row5_col5\" class=\"data row5 col5\" >1</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
-       "      <td id=\"T_003c4_row6_col0\" class=\"data row6 col0\" >7916</td>\n",
-       "      <td id=\"T_003c4_row6_col1\" class=\"data row6 col1\" >1968-12-20 03:38:00</td>\n",
-       "      <td id=\"T_003c4_row6_col2\" class=\"data row6 col2\" >7916-1968-12-20-03-38-00</td>\n",
-       "      <td id=\"T_003c4_row6_col3\" class=\"data row6 col3\" >4.629502</td>\n",
-       "      <td id=\"T_003c4_row6_col4\" class=\"data row6 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row6_col5\" class=\"data row6 col5\" >0</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
-       "      <td id=\"T_003c4_row7_col0\" class=\"data row7 col0\" >33</td>\n",
-       "      <td id=\"T_003c4_row7_col1\" class=\"data row7 col1\" >1967-07-28 03:16:00</td>\n",
-       "      <td id=\"T_003c4_row7_col2\" class=\"data row7 col2\" >33-1967-07-28-03-16-00</td>\n",
-       "      <td id=\"T_003c4_row7_col3\" class=\"data row7 col3\" >4.628500</td>\n",
-       "      <td id=\"T_003c4_row7_col4\" class=\"data row7 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row7_col5\" class=\"data row7 col5\" >0</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
-       "      <td id=\"T_003c4_row8_col0\" class=\"data row8 col0\" >2883</td>\n",
-       "      <td id=\"T_003c4_row8_col1\" class=\"data row8 col1\" >1968-01-28 21:50:00</td>\n",
-       "      <td id=\"T_003c4_row8_col2\" class=\"data row8 col2\" >2883-1968-01-28-21-50-00</td>\n",
-       "      <td id=\"T_003c4_row8_col3\" class=\"data row8 col3\" >8.257742</td>\n",
-       "      <td id=\"T_003c4_row8_col4\" class=\"data row8 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row8_col5\" class=\"data row8 col5\" >1</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th id=\"T_003c4_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
-       "      <td id=\"T_003c4_row9_col0\" class=\"data row9 col0\" >1515</td>\n",
-       "      <td id=\"T_003c4_row9_col1\" class=\"data row9 col1\" >1968-07-18 08:28:00</td>\n",
-       "      <td id=\"T_003c4_row9_col2\" class=\"data row9 col2\" >1515-1968-07-18-08-28-00</td>\n",
-       "      <td id=\"T_003c4_row9_col3\" class=\"data row9 col3\" >2.973084</td>\n",
-       "      <td id=\"T_003c4_row9_col4\" class=\"data row9 col4\" >0.000000</td>\n",
-       "      <td id=\"T_003c4_row9_col5\" class=\"data row9 col5\" >0</td>\n",
+       "      <th id=\"T_4dbad_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
+       "      <td id=\"T_4dbad_row0_col0\" class=\"data row0 col0\" >9903</td>\n",
+       "      <td id=\"T_4dbad_row0_col1\" class=\"data row0 col1\" >1968-05-09 21:24:00</td>\n",
+       "      <td id=\"T_4dbad_row0_col2\" class=\"data row0 col2\" >9903-1968-05-09-21-24-00</td>\n",
+       "      <td id=\"T_4dbad_row0_col3\" class=\"data row0 col3\" >0.990763</td>\n",
+       "      <td id=\"T_4dbad_row0_col4\" class=\"data row0 col4\" >nan</td>\n",
+       "      <td id=\"T_4dbad_row0_col5\" class=\"data row0 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row0_col6\" class=\"data row0 col6\" >0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
+       "      <td id=\"T_4dbad_row1_col0\" class=\"data row1 col0\" >6447</td>\n",
+       "      <td id=\"T_4dbad_row1_col1\" class=\"data row1 col1\" >1967-09-25 18:08:00</td>\n",
+       "      <td id=\"T_4dbad_row1_col2\" class=\"data row1 col2\" >6447-1967-09-25-18-08-00</td>\n",
+       "      <td id=\"T_4dbad_row1_col3\" class=\"data row1 col3\" >5.582745</td>\n",
+       "      <td id=\"T_4dbad_row1_col4\" class=\"data row1 col4\" >7.577100</td>\n",
+       "      <td id=\"T_4dbad_row1_col5\" class=\"data row1 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row1_col6\" class=\"data row1 col6\" >1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
+       "      <td id=\"T_4dbad_row2_col0\" class=\"data row2 col0\" >4927</td>\n",
+       "      <td id=\"T_4dbad_row2_col1\" class=\"data row2 col1\" >1968-06-30 12:13:00</td>\n",
+       "      <td id=\"T_4dbad_row2_col2\" class=\"data row2 col2\" >4927-1968-06-30-12-13-00</td>\n",
+       "      <td id=\"T_4dbad_row2_col3\" class=\"data row2 col3\" >4.957251</td>\n",
+       "      <td id=\"T_4dbad_row2_col4\" class=\"data row2 col4\" >nan</td>\n",
+       "      <td id=\"T_4dbad_row2_col5\" class=\"data row2 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row2_col6\" class=\"data row2 col6\" >0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
+       "      <td id=\"T_4dbad_row3_col0\" class=\"data row3 col0\" >5475</td>\n",
+       "      <td id=\"T_4dbad_row3_col1\" class=\"data row3 col1\" >1967-01-09 03:09:00</td>\n",
+       "      <td id=\"T_4dbad_row3_col2\" class=\"data row3 col2\" >5475-1967-01-09-03-09-00</td>\n",
+       "      <td id=\"T_4dbad_row3_col3\" class=\"data row3 col3\" >5.999336</td>\n",
+       "      <td id=\"T_4dbad_row3_col4\" class=\"data row3 col4\" >9.497229</td>\n",
+       "      <td id=\"T_4dbad_row3_col5\" class=\"data row3 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row3_col6\" class=\"data row3 col6\" >0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
+       "      <td id=\"T_4dbad_row4_col0\" class=\"data row4 col0\" >9793</td>\n",
+       "      <td id=\"T_4dbad_row4_col1\" class=\"data row4 col1\" >1968-12-15 12:59:00</td>\n",
+       "      <td id=\"T_4dbad_row4_col2\" class=\"data row4 col2\" >9793-1968-12-15-12-59-00</td>\n",
+       "      <td id=\"T_4dbad_row4_col3\" class=\"data row4 col3\" >7.294038</td>\n",
+       "      <td id=\"T_4dbad_row4_col4\" class=\"data row4 col4\" >8.182348</td>\n",
+       "      <td id=\"T_4dbad_row4_col5\" class=\"data row4 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row4_col6\" class=\"data row4 col6\" >0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
+       "      <td id=\"T_4dbad_row5_col0\" class=\"data row5 col0\" >9768</td>\n",
+       "      <td id=\"T_4dbad_row5_col1\" class=\"data row5 col1\" >1967-07-04 23:09:00</td>\n",
+       "      <td id=\"T_4dbad_row5_col2\" class=\"data row5 col2\" >9768-1967-07-04-23-09-00</td>\n",
+       "      <td id=\"T_4dbad_row5_col3\" class=\"data row5 col3\" >4.326286</td>\n",
+       "      <td id=\"T_4dbad_row5_col4\" class=\"data row5 col4\" >nan</td>\n",
+       "      <td id=\"T_4dbad_row5_col5\" class=\"data row5 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row5_col6\" class=\"data row5 col6\" >1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
+       "      <td id=\"T_4dbad_row6_col0\" class=\"data row6 col0\" >7916</td>\n",
+       "      <td id=\"T_4dbad_row6_col1\" class=\"data row6 col1\" >1968-12-20 03:38:00</td>\n",
+       "      <td id=\"T_4dbad_row6_col2\" class=\"data row6 col2\" >7916-1968-12-20-03-38-00</td>\n",
+       "      <td id=\"T_4dbad_row6_col3\" class=\"data row6 col3\" >4.629502</td>\n",
+       "      <td id=\"T_4dbad_row6_col4\" class=\"data row6 col4\" >nan</td>\n",
+       "      <td id=\"T_4dbad_row6_col5\" class=\"data row6 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row6_col6\" class=\"data row6 col6\" >0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
+       "      <td id=\"T_4dbad_row7_col0\" class=\"data row7 col0\" >33</td>\n",
+       "      <td id=\"T_4dbad_row7_col1\" class=\"data row7 col1\" >1967-07-28 03:16:00</td>\n",
+       "      <td id=\"T_4dbad_row7_col2\" class=\"data row7 col2\" >33-1967-07-28-03-16-00</td>\n",
+       "      <td id=\"T_4dbad_row7_col3\" class=\"data row7 col3\" >4.628500</td>\n",
+       "      <td id=\"T_4dbad_row7_col4\" class=\"data row7 col4\" >nan</td>\n",
+       "      <td id=\"T_4dbad_row7_col5\" class=\"data row7 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row7_col6\" class=\"data row7 col6\" >0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
+       "      <td id=\"T_4dbad_row8_col0\" class=\"data row8 col0\" >2883</td>\n",
+       "      <td id=\"T_4dbad_row8_col1\" class=\"data row8 col1\" >1968-01-28 21:50:00</td>\n",
+       "      <td id=\"T_4dbad_row8_col2\" class=\"data row8 col2\" >2883-1968-01-28-21-50-00</td>\n",
+       "      <td id=\"T_4dbad_row8_col3\" class=\"data row8 col3\" >8.257742</td>\n",
+       "      <td id=\"T_4dbad_row8_col4\" class=\"data row8 col4\" >nan</td>\n",
+       "      <td id=\"T_4dbad_row8_col5\" class=\"data row8 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row8_col6\" class=\"data row8 col6\" >1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th id=\"T_4dbad_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
+       "      <td id=\"T_4dbad_row9_col0\" class=\"data row9 col0\" >1515</td>\n",
+       "      <td id=\"T_4dbad_row9_col1\" class=\"data row9 col1\" >1968-07-18 08:28:00</td>\n",
+       "      <td id=\"T_4dbad_row9_col2\" class=\"data row9 col2\" >1515-1968-07-18-08-28-00</td>\n",
+       "      <td id=\"T_4dbad_row9_col3\" class=\"data row9 col3\" >2.973084</td>\n",
+       "      <td id=\"T_4dbad_row9_col4\" class=\"data row9 col4\" >0.671010</td>\n",
+       "      <td id=\"T_4dbad_row9_col5\" class=\"data row9 col5\" >0.000000</td>\n",
+       "      <td id=\"T_4dbad_row9_col6\" class=\"data row9 col6\" >0</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n"
       ],
       "text/plain": [
-       "<pandas.io.formats.style.Styler at 0x107535f70>"
+       "<pandas.io.formats.style.Styler at 0x13b5dd9f0>"
       ]
      },
-     "execution_count": 14,
+     "execution_count": 12,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1399,12 +1451,14 @@
    "source": [
     "# For displayability, shorten col names\n",
     "shortened_pred = \"pred_X\"\n",
+    "shortened_pred_interval = \"pred_X_30_to_90\"\n",
     "shortened_outcome = \"outc_Y\"\n",
     "\n",
     "df = df.rename(\n",
     "    {\n",
-    "        \"pred_predictor_name_within_730_days_mean_fallback_nan\": shortened_pred,\n",
-    "        \"outc_outcome_name_within_365_days_maximum_fallback_0_dichotomous\": shortened_outcome,\n",
+    "        \"pred_predictor_name_within_0_to_730_days_mean_fallback_nan\": shortened_pred,\n",
+    "        \"pred_predictor_interval_name_within_30_to_90_days_mean_fallback_nan\": shortened_pred_interval,\n",
+    "        \"outc_outcome_name_within_0_to_365_days_maximum_fallback_0_dichotomous\": shortened_outcome,\n",
     "    },\n",
     "    axis=1,\n",
     ")\n",
@@ -1424,6 +1478,11 @@
     "4. Our predictor columns, prefixed with `pred_` and\n",
     "5. Our outcome columns, prefixed with `outc_`"
    ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": []
   }
  ],
  "metadata": {
@@ -1442,7 +1501,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.9.17"
+   "version": "3.10.13"
   },
   "orig_nbformat": 4,
   "vscode": {
diff --git a/docs/tutorials/02_advanced.ipynb b/docs/tutorials/02_advanced.ipynb
index 9c2a725..1147e11 100644
--- a/docs/tutorials/02_advanced.ipynb
+++ b/docs/tutorials/02_advanced.ipynb
@@ -32,7 +32,7 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 24,
+            "execution_count": 9,
             "metadata": {},
             "outputs": [],
             "source": [
@@ -47,7 +47,7 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 25,
+            "execution_count": 10,
             "metadata": {},
             "outputs": [],
             "source": [
@@ -55,7 +55,7 @@
                 "    named_dataframes=[\n",
                 "        NamedDataframe(df=load_synth_predictor_float(), name=\"synth_predictor_float\")\n",
                 "    ],\n",
-                "    lookbehind_days=[365, 730],\n",
+                "    lookbehind_days=[(0, 365), (365, 730), 1095],\n",
                 "    fallback=[np.nan],\n",
                 "    aggregation_fns=[mean, maximum],\n",
                 ").create_combinations()"
@@ -76,26 +76,32 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 26,
+            "execution_count": 11,
             "metadata": {},
             "outputs": [
                 {
                     "name": "stdout",
                     "output_type": "stream",
                     "text": [
-                        "––––––––– We created 4 combinations of predictors. ––––––––––\n",
+                        "––––––––– We created 6 combinations of predictors. ––––––––––\n",
                         "[{'aggregation_fn': 'mean',\n",
                         "  'feature_name': 'synth_predictor_float',\n",
-                        "  'lookbehind_days': 365.0},\n",
+                        "  'lookbehind_days': LookPeriod(min_days=0.0, max_days=365.0)},\n",
                         " {'aggregation_fn': 'maximum',\n",
                         "  'feature_name': 'synth_predictor_float',\n",
-                        "  'lookbehind_days': 365.0},\n",
+                        "  'lookbehind_days': LookPeriod(min_days=0.0, max_days=365.0)},\n",
                         " {'aggregation_fn': 'mean',\n",
                         "  'feature_name': 'synth_predictor_float',\n",
-                        "  'lookbehind_days': 730.0},\n",
+                        "  'lookbehind_days': LookPeriod(min_days=365.0, max_days=730.0)},\n",
                         " {'aggregation_fn': 'maximum',\n",
                         "  'feature_name': 'synth_predictor_float',\n",
-                        "  'lookbehind_days': 730.0}]\n"
+                        "  'lookbehind_days': LookPeriod(min_days=365.0, max_days=730.0)},\n",
+                        " {'aggregation_fn': 'mean',\n",
+                        "  'feature_name': 'synth_predictor_float',\n",
+                        "  'lookbehind_days': LookPeriod(min_days=0, max_days=1095.0)},\n",
+                        " {'aggregation_fn': 'maximum',\n",
+                        "  'feature_name': 'synth_predictor_float',\n",
+                        "  'lookbehind_days': LookPeriod(min_days=0, max_days=1095.0)}]\n"
                     ]
                 }
             ],
@@ -104,7 +110,7 @@
                 "pred_spec_batch_summary = [\n",
                 "    {\n",
                 "        \"feature_name\": pred_spec.feature_base_name,\n",
-                "        \"lookbehind_days\": pred_spec.lookbehind_days,\n",
+                "        \"lookbehind_days\": pred_spec.lookbehind_period,\n",
                 "        \"aggregation_fn\": pred_spec.aggregation_fn.__name__,\n",
                 "    }\n",
                 "    for pred_spec in pred_spec_batch\n",
@@ -141,7 +147,7 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 27,
+            "execution_count": 12,
             "metadata": {},
             "outputs": [],
             "source": [
@@ -154,14 +160,14 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 28,
+            "execution_count": 13,
             "metadata": {},
             "outputs": [
                 {
                     "name": "stderr",
                     "output_type": "stream",
                     "text": [
-                        "2023-06-14 16:19:04 [INFO] Overriding pred_time_uuid_col_name in cache with pred_time_uuid_col_name passed to init of flattened dataset\n"
+                        "2024-01-18 11:38:02 [INFO] Overriding pred_time_uuid_col_name in cache with pred_time_uuid_col_name passed to init of flattened dataset\n"
                     ]
                 }
             ],
@@ -192,7 +198,7 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 29,
+            "execution_count": 14,
             "metadata": {},
             "outputs": [],
             "source": [
@@ -201,21 +207,30 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 30,
+            "execution_count": 15,
             "metadata": {},
             "outputs": [
                 {
                     "name": "stderr",
                     "output_type": "stream",
                     "text": [
-                        "2023-06-14 16:19:04 [INFO] There were unprocessed specs, computing...\n",
-                        "2023-06-14 16:19:04 [INFO] _drop_pred_time_if_insufficient_look_distance: Dropped 4038 (40.38%) rows\n",
-                        "2023-06-14 16:19:04 [INFO] Processing 4 temporal features in parallel with 4 workers. Chunksize is 1. If this is above 1, it may take some time for the progress bar to move, as processing is batched. However, this makes for much faster total performance.\n",
-                        "100%|██████████| 4/4 [00:01<00:00,  2.75it/s]\n",
-                        "2023-06-14 16:19:05 [INFO] Checking alignment of dataframes - this might take a little while (~2 minutes for 1.000 dataframes with 2.000.000 rows).\n",
-                        "2023-06-14 16:19:05 [INFO] Starting concatenation. Will take some time on performant systems, e.g. 30s for 100 features and 2_000_000 prediction times. This is normal.\n",
-                        "2023-06-14 16:19:05 [INFO] Concatenation took 0.007 seconds\n",
-                        "2023-06-14 16:19:05 [INFO] Merging with original df\n"
+                        "2024-01-18 11:38:03 [INFO] There were unprocessed specs, computing...\n",
+                        "2024-01-18 11:38:03 [INFO] _drop_pred_time_if_insufficient_look_distance: Dropped 6053 (60.53%) rows\n",
+                        "2024-01-18 11:38:03 [INFO] Processing 6 temporal features in parallel with 4 workers. Chunksize is 2. If this is above 1, it may take some time for the progress bar to move, as processing is batched. However, this makes for much faster total performance.\n",
+                        "  0%|          | 0/6 [00:00<?, ?it/s]/Users/au554730/Desktop/Projects/timeseriesflattener/.venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:\n",
+                        "* 'allow_mutation' has been removed\n",
+                        "  warnings.warn(message, UserWarning)\n",
+                        "/Users/au554730/Desktop/Projects/timeseriesflattener/.venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:\n",
+                        "* 'allow_mutation' has been removed\n",
+                        "  warnings.warn(message, UserWarning)\n",
+                        "/Users/au554730/Desktop/Projects/timeseriesflattener/.venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:\n",
+                        "* 'allow_mutation' has been removed\n",
+                        "  warnings.warn(message, UserWarning)\n",
+                        "100%|██████████| 6/6 [00:02<00:00,  2.17it/s]\n",
+                        "2024-01-18 11:38:05 [INFO] Checking alignment of dataframes - this might take a little while (~2 minutes for 1.000 dataframes with 2.000.000 rows).\n",
+                        "2024-01-18 11:38:05 [INFO] Starting concatenation. Will take some time on performant systems, e.g. 30s for 100 features and 2_000_000 prediction times. This is normal.\n",
+                        "2024-01-18 11:38:05 [INFO] Concatenation took 0.01 seconds\n",
+                        "2024-01-18 11:38:05 [INFO] Merging with original df\n"
                     ]
                 }
             ],
@@ -225,7 +240,7 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 31,
+            "execution_count": 16,
             "metadata": {},
             "outputs": [
                 {
@@ -236,32 +251,34 @@
                             "│ ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ ┏━━━━━━━━━━━━━┳━━━━━━━┓                                                          │\n",
                             "│ ┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> dataframe         </span>┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> Values </span>┃ ┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> Column Type </span>┃<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\"> Count </span>┃                                                          │\n",
                             "│ ┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ ┡━━━━━━━━━━━━━╇━━━━━━━┩                                                          │\n",
-                            "│ │ Number of rows    │ 5962   │ │ float64     │ 4     │                                                          │\n",
-                            "│ │ Number of columns │ 7      │ │ int64       │ 1     │                                                          │\n",
+                            "│ │ Number of rows    │ 3947   │ │ float64     │ 6     │                                                          │\n",
+                            "│ │ Number of columns │ 9      │ │ int64       │ 1     │                                                          │\n",
                             "│ └───────────────────┴────────┘ │ datetime64  │ 1     │                                                          │\n",
                             "│                                │ string      │ 1     │                                                          │\n",
                             "│                                └─────────────┴───────┘                                                          │\n",
                             "│ <span style=\"font-style: italic\">                                                    number                                                    </span>  │\n",
-                            "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓  │\n",
-                            "│ ┃<span style=\"font-weight: bold\"> column_name               </span>┃<span style=\"font-weight: bold\"> NA    </span>┃<span style=\"font-weight: bold\"> NA %   </span>┃<span style=\"font-weight: bold\"> mean   </span>┃<span style=\"font-weight: bold\"> sd    </span>┃<span style=\"font-weight: bold\"> p0        </span>┃<span style=\"font-weight: bold\"> p25   </span>┃<span style=\"font-weight: bold\"> p75   </span>┃<span style=\"font-weight: bold\"> p100   </span>┃<span style=\"font-weight: bold\"> hist    </span>┃  │\n",
-                            "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">entity_id                </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  5000</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 2900</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">        0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 2500</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 7400</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 10000</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█▇███▇ </span> │  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  820</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    14</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2.1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.00039</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  3.5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  6.4</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▂▄██▄▂ </span> │  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  110</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   7.7</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2.1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0.058</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  6.7</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  9.3</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\"> ▁▁▂▄█ </span> │  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  820</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    14</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   6.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.00039</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  4.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  8.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▁▂▃▄▆█ </span> │  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor     </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  110</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  1.7</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0.058</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  3.9</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  6.1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   9.9</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▁▃██▃▁ </span> │  │\n",
-                            "│ └───────────────────────────┴───────┴────────┴────────┴───────┴───────────┴───────┴───────┴────────┴─────────┘  │\n",
+                            "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┓  │\n",
+                            "│ ┃<span style=\"font-weight: bold\"> column_name                </span>┃<span style=\"font-weight: bold\"> NA    </span>┃<span style=\"font-weight: bold\"> NA %   </span>┃<span style=\"font-weight: bold\"> mean   </span>┃<span style=\"font-weight: bold\"> sd     </span>┃<span style=\"font-weight: bold\"> p0       </span>┃<span style=\"font-weight: bold\"> p25   </span>┃<span style=\"font-weight: bold\"> p75   </span>┃<span style=\"font-weight: bold\"> p100   </span>┃<span style=\"font-weight: bold\"> hist   </span>┃  │\n",
+                            "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━┩  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">entity_id                 </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  5000</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  2900</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">       0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 2600</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 7400</span> │ <span style=\"color: #008080; text-decoration-color: #008080\"> 10000</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">█████▇</span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    7</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.18</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.3</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0.29</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  4.1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  5.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   9.9</span> │ <span style=\"color: #008000; text-decoration-color: #008000\"> ▂█▇▁ </span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  510</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    13</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   6.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   2.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.024</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  4.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  8.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▂▂▃▄▆█</span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  530</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    14</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   6.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   2.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.0084</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  4.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  8.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▁▂▃▄▆█</span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    7</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.18</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   8.4</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   1.5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0.29</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  7.8</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  9.5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">   ▁▃█</span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  510</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    13</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   5.1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   2.2</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0.024</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  3.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  6.5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    10</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▂▄██▅▂</span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">pred_synth_predictor      </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  530</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    14</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">     5</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   2.1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  0.0084</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  3.6</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">  6.4</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   9.9</span> │ <span style=\"color: #008000; text-decoration-color: #008000\">▂▄██▄▂</span> │  │\n",
+                            "│ └────────────────────────────┴───────┴────────┴────────┴────────┴──────────┴───────┴───────┴────────┴────────┘  │\n",
                             "│ <span style=\"font-style: italic\">                                                   datetime                                                   </span>  │\n",
                             "│ ┏━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓  │\n",
                             "│ ┃<span style=\"font-weight: bold\"> column_name      </span>┃<span style=\"font-weight: bold\"> NA   </span>┃<span style=\"font-weight: bold\"> NA %    </span>┃<span style=\"font-weight: bold\"> first                      </span>┃<span style=\"font-weight: bold\"> last                       </span>┃<span style=\"font-weight: bold\"> frequency    </span>┃  │\n",
                             "│ ┡━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">timestamp       </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      0</span> │ <span style=\"color: #800000; text-decoration-color: #800000\">   1967-01-02 01:16:00    </span> │ <span style=\"color: #800000; text-decoration-color: #800000\">   1969-12-31 21:42:00    </span> │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">None        </span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">timestamp       </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">   0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">      0</span> │ <span style=\"color: #800000; text-decoration-color: #800000\">   1968-01-02 05:12:00    </span> │ <span style=\"color: #800000; text-decoration-color: #800000\">   1969-12-31 21:42:00    </span> │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">None        </span> │  │\n",
                             "│ └──────────────────┴──────┴─────────┴────────────────────────────┴────────────────────────────┴──────────────┘  │\n",
                             "│ <span style=\"font-style: italic\">                                                    string                                                    </span>  │\n",
                             "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓  │\n",
                             "│ ┃<span style=\"font-weight: bold\"> column_name                           </span>┃<span style=\"font-weight: bold\"> NA    </span>┃<span style=\"font-weight: bold\"> NA %      </span>┃<span style=\"font-weight: bold\"> words per row            </span>┃<span style=\"font-weight: bold\"> total words         </span>┃  │\n",
                             "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩  │\n",
-                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">prediction_time_uuid                 </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">        0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">                       1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">               6000</span> │  │\n",
+                            "│ │ <span style=\"color: #af87ff; text-decoration-color: #af87ff\">prediction_time_uuid                 </span> │ <span style=\"color: #008080; text-decoration-color: #008080\">    0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">        0</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">                       1</span> │ <span style=\"color: #008080; text-decoration-color: #008080\">               3900</span> │  │\n",
                             "│ └───────────────────────────────────────┴───────┴───────────┴──────────────────────────┴─────────────────────┘  │\n",
                             "╰────────────────────────────────────────────────────── End ──────────────────────────────────────────────────────╯\n",
                             "</pre>\n"
@@ -272,32 +289,34 @@
                             "│ ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ ┏━━━━━━━━━━━━━┳━━━━━━━┓                                                          │\n",
                             "│ ┃\u001b[1;36m \u001b[0m\u001b[1;36mdataframe        \u001b[0m\u001b[1;36m \u001b[0m┃\u001b[1;36m \u001b[0m\u001b[1;36mValues\u001b[0m\u001b[1;36m \u001b[0m┃ ┃\u001b[1;36m \u001b[0m\u001b[1;36mColumn Type\u001b[0m\u001b[1;36m \u001b[0m┃\u001b[1;36m \u001b[0m\u001b[1;36mCount\u001b[0m\u001b[1;36m \u001b[0m┃                                                          │\n",
                             "│ ┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ ┡━━━━━━━━━━━━━╇━━━━━━━┩                                                          │\n",
-                            "│ │ Number of rows    │ 5962   │ │ float64     │ 4     │                                                          │\n",
-                            "│ │ Number of columns │ 7      │ │ int64       │ 1     │                                                          │\n",
+                            "│ │ Number of rows    │ 3947   │ │ float64     │ 6     │                                                          │\n",
+                            "│ │ Number of columns │ 9      │ │ int64       │ 1     │                                                          │\n",
                             "│ └───────────────────┴────────┘ │ datetime64  │ 1     │                                                          │\n",
                             "│                                │ string      │ 1     │                                                          │\n",
                             "│                                └─────────────┴───────┘                                                          │\n",
                             "│ \u001b[3m                                                    number                                                    \u001b[0m  │\n",
-                            "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓  │\n",
-                            "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name              \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mmean  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1msd   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp0       \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp25  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp75  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp100  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mhist   \u001b[0m\u001b[1m \u001b[0m┃  │\n",
-                            "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩  │\n",
-                            "│ │ \u001b[38;5;141mentity_id                \u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m  5000\u001b[0m │ \u001b[36m 2900\u001b[0m │ \u001b[36m        0\u001b[0m │ \u001b[36m 2500\u001b[0m │ \u001b[36m 7400\u001b[0m │ \u001b[36m 10000\u001b[0m │ \u001b[32m█▇███▇ \u001b[0m │  │\n",
-                            "│ │ \u001b[38;5;141mpred_synth_predictor     \u001b[0m │ \u001b[36m  820\u001b[0m │ \u001b[36m    14\u001b[0m │ \u001b[36m     5\u001b[0m │ \u001b[36m  2.1\u001b[0m │ \u001b[36m  0.00039\u001b[0m │ \u001b[36m  3.5\u001b[0m │ \u001b[36m  6.4\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m▂▄██▄▂ \u001b[0m │  │\n",
-                            "│ │ \u001b[38;5;141mpred_synth_predictor     \u001b[0m │ \u001b[36m  110\u001b[0m │ \u001b[36m   1.8\u001b[0m │ \u001b[36m   7.7\u001b[0m │ \u001b[36m  2.1\u001b[0m │ \u001b[36m    0.058\u001b[0m │ \u001b[36m  6.7\u001b[0m │ \u001b[36m  9.3\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m ▁▁▂▄█ \u001b[0m │  │\n",
-                            "│ │ \u001b[38;5;141mpred_synth_predictor     \u001b[0m │ \u001b[36m  820\u001b[0m │ \u001b[36m    14\u001b[0m │ \u001b[36m   6.6\u001b[0m │ \u001b[36m  2.6\u001b[0m │ \u001b[36m  0.00039\u001b[0m │ \u001b[36m  4.8\u001b[0m │ \u001b[36m  8.8\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m▁▂▃▄▆█ \u001b[0m │  │\n",
-                            "│ │ \u001b[38;5;141mpred_synth_predictor     \u001b[0m │ \u001b[36m  110\u001b[0m │ \u001b[36m   1.8\u001b[0m │ \u001b[36m     5\u001b[0m │ \u001b[36m  1.7\u001b[0m │ \u001b[36m    0.058\u001b[0m │ \u001b[36m  3.9\u001b[0m │ \u001b[36m  6.1\u001b[0m │ \u001b[36m   9.9\u001b[0m │ \u001b[32m▁▃██▃▁ \u001b[0m │  │\n",
-                            "│ └───────────────────────────┴───────┴────────┴────────┴───────┴───────────┴───────┴───────┴────────┴─────────┘  │\n",
+                            "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┓  │\n",
+                            "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mmean  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1msd    \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp0      \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp25  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp75  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mp100  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mhist  \u001b[0m\u001b[1m \u001b[0m┃  │\n",
+                            "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━┩  │\n",
+                            "│ │ \u001b[38;5;141mentity_id                 \u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m     0\u001b[0m │ \u001b[36m  5000\u001b[0m │ \u001b[36m  2900\u001b[0m │ \u001b[36m       0\u001b[0m │ \u001b[36m 2600\u001b[0m │ \u001b[36m 7400\u001b[0m │ \u001b[36m 10000\u001b[0m │ \u001b[32m█████▇\u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mpred_synth_predictor      \u001b[0m │ \u001b[36m    7\u001b[0m │ \u001b[36m  0.18\u001b[0m │ \u001b[36m     5\u001b[0m │ \u001b[36m   1.3\u001b[0m │ \u001b[36m    0.29\u001b[0m │ \u001b[36m  4.1\u001b[0m │ \u001b[36m  5.8\u001b[0m │ \u001b[36m   9.9\u001b[0m │ \u001b[32m ▂█▇▁ \u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mpred_synth_predictor      \u001b[0m │ \u001b[36m  510\u001b[0m │ \u001b[36m    13\u001b[0m │ \u001b[36m   6.6\u001b[0m │ \u001b[36m   2.6\u001b[0m │ \u001b[36m   0.024\u001b[0m │ \u001b[36m  4.8\u001b[0m │ \u001b[36m  8.8\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m▂▂▃▄▆█\u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mpred_synth_predictor      \u001b[0m │ \u001b[36m  530\u001b[0m │ \u001b[36m    14\u001b[0m │ \u001b[36m   6.6\u001b[0m │ \u001b[36m   2.6\u001b[0m │ \u001b[36m  0.0084\u001b[0m │ \u001b[36m  4.8\u001b[0m │ \u001b[36m  8.8\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m▁▂▃▄▆█\u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mpred_synth_predictor      \u001b[0m │ \u001b[36m    7\u001b[0m │ \u001b[36m  0.18\u001b[0m │ \u001b[36m   8.4\u001b[0m │ \u001b[36m   1.5\u001b[0m │ \u001b[36m    0.29\u001b[0m │ \u001b[36m  7.8\u001b[0m │ \u001b[36m  9.5\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m   ▁▃█\u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mpred_synth_predictor      \u001b[0m │ \u001b[36m  510\u001b[0m │ \u001b[36m    13\u001b[0m │ \u001b[36m   5.1\u001b[0m │ \u001b[36m   2.2\u001b[0m │ \u001b[36m   0.024\u001b[0m │ \u001b[36m  3.6\u001b[0m │ \u001b[36m  6.5\u001b[0m │ \u001b[36m    10\u001b[0m │ \u001b[32m▂▄██▅▂\u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mpred_synth_predictor      \u001b[0m │ \u001b[36m  530\u001b[0m │ \u001b[36m    14\u001b[0m │ \u001b[36m     5\u001b[0m │ \u001b[36m   2.1\u001b[0m │ \u001b[36m  0.0084\u001b[0m │ \u001b[36m  3.6\u001b[0m │ \u001b[36m  6.4\u001b[0m │ \u001b[36m   9.9\u001b[0m │ \u001b[32m▂▄██▄▂\u001b[0m │  │\n",
+                            "│ └────────────────────────────┴───────┴────────┴────────┴────────┴──────────┴───────┴───────┴────────┴────────┘  │\n",
                             "│ \u001b[3m                                                   datetime                                                   \u001b[0m  │\n",
                             "│ ┏━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓  │\n",
                             "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA  \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mfirst                     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mlast                      \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mfrequency   \u001b[0m\u001b[1m \u001b[0m┃  │\n",
                             "│ ┡━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩  │\n",
-                            "│ │ \u001b[38;5;141mtimestamp       \u001b[0m │ \u001b[36m   0\u001b[0m │ \u001b[36m      0\u001b[0m │ \u001b[31m   1967-01-02 01:16:00    \u001b[0m │ \u001b[31m   1969-12-31 21:42:00    \u001b[0m │ \u001b[38;5;141mNone        \u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mtimestamp       \u001b[0m │ \u001b[36m   0\u001b[0m │ \u001b[36m      0\u001b[0m │ \u001b[31m   1968-01-02 05:12:00    \u001b[0m │ \u001b[31m   1969-12-31 21:42:00    \u001b[0m │ \u001b[38;5;141mNone        \u001b[0m │  │\n",
                             "│ └──────────────────┴──────┴─────────┴────────────────────────────┴────────────────────────────┴──────────────┘  │\n",
                             "│ \u001b[3m                                                    string                                                    \u001b[0m  │\n",
                             "│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓  │\n",
                             "│ ┃\u001b[1m \u001b[0m\u001b[1mcolumn_name                          \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA   \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mNA %     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mwords per row           \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mtotal words        \u001b[0m\u001b[1m \u001b[0m┃  │\n",
                             "│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩  │\n",
-                            "│ │ \u001b[38;5;141mprediction_time_uuid                 \u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m        0\u001b[0m │ \u001b[36m                       1\u001b[0m │ \u001b[36m               6000\u001b[0m │  │\n",
+                            "│ │ \u001b[38;5;141mprediction_time_uuid                 \u001b[0m │ \u001b[36m    0\u001b[0m │ \u001b[36m        0\u001b[0m │ \u001b[36m                       1\u001b[0m │ \u001b[36m               3900\u001b[0m │  │\n",
                             "│ └───────────────────────────────────────┴───────┴───────────┴──────────────────────────┴─────────────────────┘  │\n",
                             "╰────────────────────────────────────────────────────── End ──────────────────────────────────────────────────────╯\n"
                         ]
@@ -311,13 +330,15 @@
                             "['entity_id',\n",
                             " 'timestamp',\n",
                             " 'prediction_time_uuid',\n",
-                            " 'pred_synth_predictor_float_within_365_days_mean_fallback_nan',\n",
-                            " 'pred_synth_predictor_float_within_730_days_maximum_fallback_nan',\n",
-                            " 'pred_synth_predictor_float_within_365_days_maximum_fallback_nan',\n",
-                            " 'pred_synth_predictor_float_within_730_days_mean_fallback_nan']"
+                            " 'pred_synth_predictor_float_within_0_to_1095_days_mean_fallback_nan',\n",
+                            " 'pred_synth_predictor_float_within_365_to_730_days_maximum_fallback_nan',\n",
+                            " 'pred_synth_predictor_float_within_0_to_365_days_maximum_fallback_nan',\n",
+                            " 'pred_synth_predictor_float_within_0_to_1095_days_maximum_fallback_nan',\n",
+                            " 'pred_synth_predictor_float_within_365_to_730_days_mean_fallback_nan',\n",
+                            " 'pred_synth_predictor_float_within_0_to_365_days_mean_fallback_nan']"
                         ]
                     },
-                    "execution_count": 31,
+                    "execution_count": 16,
                     "metadata": {},
                     "output_type": "execute_result"
                 }
@@ -330,7 +351,7 @@
         },
         {
             "cell_type": "code",
-            "execution_count": 32,
+            "execution_count": 17,
             "metadata": {},
             "outputs": [
                 {
@@ -338,128 +359,150 @@
                         "text/html": [
                             "<style type=\"text/css\">\n",
                             "</style>\n",
-                            "<table id=\"T_f5435\" style=\"font-size: 14px\">\n",
+                            "<table id=\"T_c1c6b\" style=\"font-size: 14px\">\n",
                             "  <thead>\n",
                             "    <tr>\n",
                             "      <th class=\"blank level0\" >&nbsp;</th>\n",
-                            "      <th id=\"T_f5435_level0_col0\" class=\"col_heading level0 col0\" >entity_id</th>\n",
-                            "      <th id=\"T_f5435_level0_col1\" class=\"col_heading level0 col1\" >timestamp</th>\n",
-                            "      <th id=\"T_f5435_level0_col2\" class=\"col_heading level0 col2\" >prediction_time_uuid</th>\n",
-                            "      <th id=\"T_f5435_level0_col3\" class=\"col_heading level0 col3\" >pred_1</th>\n",
-                            "      <th id=\"T_f5435_level0_col4\" class=\"col_heading level0 col4\" >pred_2</th>\n",
-                            "      <th id=\"T_f5435_level0_col5\" class=\"col_heading level0 col5\" >pred_3</th>\n",
-                            "      <th id=\"T_f5435_level0_col6\" class=\"col_heading level0 col6\" >pred_4</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col0\" class=\"col_heading level0 col0\" >entity_id</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col1\" class=\"col_heading level0 col1\" >timestamp</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col2\" class=\"col_heading level0 col2\" >prediction_time_uuid</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col3\" class=\"col_heading level0 col3\" >pred_1</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col4\" class=\"col_heading level0 col4\" >pred_2</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col5\" class=\"col_heading level0 col5\" >pred_3</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col6\" class=\"col_heading level0 col6\" >pred_4</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col7\" class=\"col_heading level0 col7\" >pred_5</th>\n",
+                            "      <th id=\"T_c1c6b_level0_col8\" class=\"col_heading level0 col8\" >pred_6</th>\n",
                             "    </tr>\n",
                             "  </thead>\n",
                             "  <tbody>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
-                            "      <td id=\"T_f5435_row0_col0\" class=\"data row0 col0\" >9903</td>\n",
-                            "      <td id=\"T_f5435_row0_col1\" class=\"data row0 col1\" >1968-05-09 21:24:00</td>\n",
-                            "      <td id=\"T_f5435_row0_col2\" class=\"data row0 col2\" >9903-1968-05-09-21-24-00</td>\n",
-                            "      <td id=\"T_f5435_row0_col3\" class=\"data row0 col3\" >0.154981</td>\n",
-                            "      <td id=\"T_f5435_row0_col4\" class=\"data row0 col4\" >2.194319</td>\n",
-                            "      <td id=\"T_f5435_row0_col5\" class=\"data row0 col5\" >0.154981</td>\n",
-                            "      <td id=\"T_f5435_row0_col6\" class=\"data row0 col6\" >0.990763</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
+                            "      <td id=\"T_c1c6b_row0_col0\" class=\"data row0 col0\" >9903</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col1\" class=\"data row0 col1\" >1968-05-09 21:24:00</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col2\" class=\"data row0 col2\" >9903-1968-05-09-21-24-00</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col3\" class=\"data row0 col3\" >2.864626</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col4\" class=\"data row0 col4\" >2.194319</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col5\" class=\"data row0 col5\" >0.154981</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col6\" class=\"data row0 col6\" >5.931553</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col7\" class=\"data row0 col7\" >1.408655</td>\n",
+                            "      <td id=\"T_c1c6b_row0_col8\" class=\"data row0 col8\" >0.154981</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
-                            "      <td id=\"T_f5435_row1_col0\" class=\"data row1 col0\" >6447</td>\n",
-                            "      <td id=\"T_f5435_row1_col1\" class=\"data row1 col1\" >1967-09-25 18:08:00</td>\n",
-                            "      <td id=\"T_f5435_row1_col2\" class=\"data row1 col2\" >6447-1967-09-25-18-08-00</td>\n",
-                            "      <td id=\"T_f5435_row1_col3\" class=\"data row1 col3\" >5.396017</td>\n",
-                            "      <td id=\"T_f5435_row1_col4\" class=\"data row1 col4\" >9.774050</td>\n",
-                            "      <td id=\"T_f5435_row1_col5\" class=\"data row1 col5\" >8.930256</td>\n",
-                            "      <td id=\"T_f5435_row1_col6\" class=\"data row1 col6\" >5.582745</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
+                            "      <td id=\"T_c1c6b_row1_col0\" class=\"data row1 col0\" >4927</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col1\" class=\"data row1 col1\" >1968-06-30 12:13:00</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col2\" class=\"data row1 col2\" >4927-1968-06-30-12-13-00</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col3\" class=\"data row1 col3\" >4.466599</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col4\" class=\"data row1 col4\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col5\" class=\"data row1 col5\" >6.730694</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col6\" class=\"data row1 col6\" >8.630901</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col7\" class=\"data row1 col7\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row1_col8\" class=\"data row1 col8\" >4.957251</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
-                            "      <td id=\"T_f5435_row2_col0\" class=\"data row2 col0\" >4927</td>\n",
-                            "      <td id=\"T_f5435_row2_col1\" class=\"data row2 col1\" >1968-06-30 12:13:00</td>\n",
-                            "      <td id=\"T_f5435_row2_col2\" class=\"data row2 col2\" >4927-1968-06-30-12-13-00</td>\n",
-                            "      <td id=\"T_f5435_row2_col3\" class=\"data row2 col3\" >4.957251</td>\n",
-                            "      <td id=\"T_f5435_row2_col4\" class=\"data row2 col4\" >6.730694</td>\n",
-                            "      <td id=\"T_f5435_row2_col5\" class=\"data row2 col5\" >6.730694</td>\n",
-                            "      <td id=\"T_f5435_row2_col6\" class=\"data row2 col6\" >4.957251</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
+                            "      <td id=\"T_c1c6b_row2_col0\" class=\"data row2 col0\" >3157</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col1\" class=\"data row2 col1\" >1969-10-07 05:01:00</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col2\" class=\"data row2 col2\" >3157-1969-10-07-05-01-00</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col3\" class=\"data row2 col3\" >4.168456</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col4\" class=\"data row2 col4\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col5\" class=\"data row2 col5\" >5.243176</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col6\" class=\"data row2 col6\" >5.243176</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col7\" class=\"data row2 col7\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row2_col8\" class=\"data row2 col8\" >5.068323</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
-                            "      <td id=\"T_f5435_row3_col0\" class=\"data row3 col0\" >5475</td>\n",
-                            "      <td id=\"T_f5435_row3_col1\" class=\"data row3 col1\" >1967-01-09 03:09:00</td>\n",
-                            "      <td id=\"T_f5435_row3_col2\" class=\"data row3 col2\" >5475-1967-01-09-03-09-00</td>\n",
-                            "      <td id=\"T_f5435_row3_col3\" class=\"data row3 col3\" >6.081539</td>\n",
-                            "      <td id=\"T_f5435_row3_col4\" class=\"data row3 col4\" >9.497229</td>\n",
-                            "      <td id=\"T_f5435_row3_col5\" class=\"data row3 col5\" >9.497229</td>\n",
-                            "      <td id=\"T_f5435_row3_col6\" class=\"data row3 col6\" >5.999336</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
+                            "      <td id=\"T_c1c6b_row3_col0\" class=\"data row3 col0\" >9793</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col1\" class=\"data row3 col1\" >1968-12-15 12:59:00</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col2\" class=\"data row3 col2\" >9793-1968-12-15-12-59-00</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col3\" class=\"data row3 col3\" >7.144959</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col4\" class=\"data row3 col4\" >8.293266</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col5\" class=\"data row3 col5\" >9.708976</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col6\" class=\"data row3 col6\" >9.727182</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col7\" class=\"data row3 col7\" >6.230417</td>\n",
+                            "      <td id=\"T_c1c6b_row3_col8\" class=\"data row3 col8\" >8.091755</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
-                            "      <td id=\"T_f5435_row4_col0\" class=\"data row4 col0\" >3157</td>\n",
-                            "      <td id=\"T_f5435_row4_col1\" class=\"data row4 col1\" >1969-10-07 05:01:00</td>\n",
-                            "      <td id=\"T_f5435_row4_col2\" class=\"data row4 col2\" >3157-1969-10-07-05-01-00</td>\n",
-                            "      <td id=\"T_f5435_row4_col3\" class=\"data row4 col3\" >5.068323</td>\n",
-                            "      <td id=\"T_f5435_row4_col4\" class=\"data row4 col4\" >5.243176</td>\n",
-                            "      <td id=\"T_f5435_row4_col5\" class=\"data row4 col5\" >5.243176</td>\n",
-                            "      <td id=\"T_f5435_row4_col6\" class=\"data row4 col6\" >5.068323</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
+                            "      <td id=\"T_c1c6b_row4_col0\" class=\"data row4 col0\" >9861</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col1\" class=\"data row4 col1\" >1969-01-22 17:34:00</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col2\" class=\"data row4 col2\" >9861-1969-01-22-17-34-00</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col3\" class=\"data row4 col3\" >3.669635</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col4\" class=\"data row4 col4\" >5.491415</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col5\" class=\"data row4 col5\" >3.130283</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col6\" class=\"data row4 col6\" >6.217161</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col7\" class=\"data row4 col7\" >3.309197</td>\n",
+                            "      <td id=\"T_c1c6b_row4_col8\" class=\"data row4 col8\" >3.130283</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
-                            "      <td id=\"T_f5435_row5_col0\" class=\"data row5 col0\" >9793</td>\n",
-                            "      <td id=\"T_f5435_row5_col1\" class=\"data row5 col1\" >1968-12-15 12:59:00</td>\n",
-                            "      <td id=\"T_f5435_row5_col2\" class=\"data row5 col2\" >9793-1968-12-15-12-59-00</td>\n",
-                            "      <td id=\"T_f5435_row5_col3\" class=\"data row5 col3\" >8.091755</td>\n",
-                            "      <td id=\"T_f5435_row5_col4\" class=\"data row5 col4\" >9.708976</td>\n",
-                            "      <td id=\"T_f5435_row5_col5\" class=\"data row5 col5\" >9.708976</td>\n",
-                            "      <td id=\"T_f5435_row5_col6\" class=\"data row5 col6\" >7.294038</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
+                            "      <td id=\"T_c1c6b_row5_col0\" class=\"data row5 col0\" >657</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col1\" class=\"data row5 col1\" >1969-04-14 15:47:00</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col2\" class=\"data row5 col2\" >657-1969-04-14-15-47-00</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col3\" class=\"data row5 col3\" >7.391514</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col4\" class=\"data row5 col4\" >7.903614</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col5\" class=\"data row5 col5\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col6\" class=\"data row5 col6\" >7.903614</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col7\" class=\"data row5 col7\" >7.903614</td>\n",
+                            "      <td id=\"T_c1c6b_row5_col8\" class=\"data row5 col8\" >nan</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
-                            "      <td id=\"T_f5435_row6_col0\" class=\"data row6 col0\" >9768</td>\n",
-                            "      <td id=\"T_f5435_row6_col1\" class=\"data row6 col1\" >1967-07-04 23:09:00</td>\n",
-                            "      <td id=\"T_f5435_row6_col2\" class=\"data row6 col2\" >9768-1967-07-04-23-09-00</td>\n",
-                            "      <td id=\"T_f5435_row6_col3\" class=\"data row6 col3\" >4.959419</td>\n",
-                            "      <td id=\"T_f5435_row6_col4\" class=\"data row6 col4\" >5.729441</td>\n",
-                            "      <td id=\"T_f5435_row6_col5\" class=\"data row6 col5\" >5.729441</td>\n",
-                            "      <td id=\"T_f5435_row6_col6\" class=\"data row6 col6\" >4.326286</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
+                            "      <td id=\"T_c1c6b_row6_col0\" class=\"data row6 col0\" >7916</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col1\" class=\"data row6 col1\" >1968-12-20 03:38:00</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col2\" class=\"data row6 col2\" >7916-1968-12-20-03-38-00</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col3\" class=\"data row6 col3\" >4.251704</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col4\" class=\"data row6 col4\" >6.084523</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col5\" class=\"data row6 col5\" >4.318586</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col6\" class=\"data row6 col6\" >6.979156</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col7\" class=\"data row6 col7\" >6.084523</td>\n",
+                            "      <td id=\"T_c1c6b_row6_col8\" class=\"data row6 col8\" >3.901992</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
-                            "      <td id=\"T_f5435_row7_col0\" class=\"data row7 col0\" >9861</td>\n",
-                            "      <td id=\"T_f5435_row7_col1\" class=\"data row7 col1\" >1969-01-22 17:34:00</td>\n",
-                            "      <td id=\"T_f5435_row7_col2\" class=\"data row7 col2\" >9861-1969-01-22-17-34-00</td>\n",
-                            "      <td id=\"T_f5435_row7_col3\" class=\"data row7 col3\" >3.130283</td>\n",
-                            "      <td id=\"T_f5435_row7_col4\" class=\"data row7 col4\" >5.491415</td>\n",
-                            "      <td id=\"T_f5435_row7_col5\" class=\"data row7 col5\" >3.130283</td>\n",
-                            "      <td id=\"T_f5435_row7_col6\" class=\"data row7 col6\" >3.279378</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
+                            "      <td id=\"T_c1c6b_row7_col0\" class=\"data row7 col0\" >2883</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col1\" class=\"data row7 col1\" >1968-01-28 21:50:00</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col2\" class=\"data row7 col2\" >2883-1968-01-28-21-50-00</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col3\" class=\"data row7 col3\" >4.712403</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col4\" class=\"data row7 col4\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col5\" class=\"data row7 col5\" >8.257742</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col6\" class=\"data row7 col6\" >8.257742</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col7\" class=\"data row7 col7\" >nan</td>\n",
+                            "      <td id=\"T_c1c6b_row7_col8\" class=\"data row7 col8\" >8.257742</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
-                            "      <td id=\"T_f5435_row8_col0\" class=\"data row8 col0\" >657</td>\n",
-                            "      <td id=\"T_f5435_row8_col1\" class=\"data row8 col1\" >1969-04-14 15:47:00</td>\n",
-                            "      <td id=\"T_f5435_row8_col2\" class=\"data row8 col2\" >657-1969-04-14-15-47-00</td>\n",
-                            "      <td id=\"T_f5435_row8_col3\" class=\"data row8 col3\" >nan</td>\n",
-                            "      <td id=\"T_f5435_row8_col4\" class=\"data row8 col4\" >7.903614</td>\n",
-                            "      <td id=\"T_f5435_row8_col5\" class=\"data row8 col5\" >nan</td>\n",
-                            "      <td id=\"T_f5435_row8_col6\" class=\"data row8 col6\" >7.903614</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
+                            "      <td id=\"T_c1c6b_row8_col0\" class=\"data row8 col0\" >1515</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col1\" class=\"data row8 col1\" >1968-07-18 08:28:00</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col2\" class=\"data row8 col2\" >1515-1968-07-18-08-28-00</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col3\" class=\"data row8 col3\" >3.112700</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col4\" class=\"data row8 col4\" >3.684614</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col5\" class=\"data row8 col5\" >8.654839</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col6\" class=\"data row8 col6\" >8.654839</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col7\" class=\"data row8 col7\" >3.104674</td>\n",
+                            "      <td id=\"T_c1c6b_row8_col8\" class=\"data row8 col8\" >2.907289</td>\n",
                             "    </tr>\n",
                             "    <tr>\n",
-                            "      <th id=\"T_f5435_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
-                            "      <td id=\"T_f5435_row9_col0\" class=\"data row9 col0\" >7916</td>\n",
-                            "      <td id=\"T_f5435_row9_col1\" class=\"data row9 col1\" >1968-12-20 03:38:00</td>\n",
-                            "      <td id=\"T_f5435_row9_col2\" class=\"data row9 col2\" >7916-1968-12-20-03-38-00</td>\n",
-                            "      <td id=\"T_f5435_row9_col3\" class=\"data row9 col3\" >3.901992</td>\n",
-                            "      <td id=\"T_f5435_row9_col4\" class=\"data row9 col4\" >6.084523</td>\n",
-                            "      <td id=\"T_f5435_row9_col5\" class=\"data row9 col5\" >4.318586</td>\n",
-                            "      <td id=\"T_f5435_row9_col6\" class=\"data row9 col6\" >4.629502</td>\n",
+                            "      <th id=\"T_c1c6b_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
+                            "      <td id=\"T_c1c6b_row9_col0\" class=\"data row9 col0\" >6754</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col1\" class=\"data row9 col1\" >1968-09-21 01:27:00</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col2\" class=\"data row9 col2\" >6754-1968-09-21-01-27-00</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col3\" class=\"data row9 col3\" >5.082918</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col4\" class=\"data row9 col4\" >3.102132</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col5\" class=\"data row9 col5\" >2.346644</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col6\" class=\"data row9 col6\" >9.657755</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col7\" class=\"data row9 col7\" >2.324913</td>\n",
+                            "      <td id=\"T_c1c6b_row9_col8\" class=\"data row9 col8\" >2.346644</td>\n",
                             "    </tr>\n",
                             "  </tbody>\n",
                             "</table>\n"
                         ],
                         "text/plain": [
-                            "<pandas.io.formats.style.Styler at 0x1454ac370>"
+                            "<pandas.io.formats.style.Styler at 0x1433ebd00>"
                         ]
                     },
-                    "execution_count": 32,
+                    "execution_count": 17,
                     "metadata": {},
                     "output_type": "execute_result"
                 }
@@ -496,7 +539,7 @@
             "name": "python",
             "nbconvert_exporter": "python",
             "pygments_lexer": "ipython3",
-            "version": "3.9.17"
+            "version": "3.10.13"
         },
         "orig_nbformat": 4,
         "vscode": {
diff --git a/src/timeseriesflattener/feature_specs/group_specs.py b/src/timeseriesflattener/feature_specs/group_specs.py
index 88f1180..0735176 100644
--- a/src/timeseriesflattener/feature_specs/group_specs.py
+++ b/src/timeseriesflattener/feature_specs/group_specs.py
@@ -1,6 +1,6 @@
 import itertools
 from dataclasses import dataclass
-from typing import Dict, List, Sequence, Union
+from typing import Dict, List, Sequence, Tuple, Union
 
 import pandas as pd
 from timeseriesflattener.aggregation_fns import AggregationFunType
@@ -33,7 +33,7 @@ class PredictorGroupSpec(BaseModel):
 
     # Shared attributes from GroupSpec
     prefix: str = "pred"
-    lookbehind_days: List[float]
+    lookbehind_days: List[Union[float, Tuple[float, float]]]
     named_dataframes: Sequence[NamedDataframe]
     aggregation_fns: Sequence[AggregationFunType]
     fallback: Sequence[Union[int, float, str]]
@@ -79,7 +79,7 @@ class OutcomeGroupSpec(BaseModel):
     fallback: Sequence[Union[int, float, str]]
 
     # Individual attributes
-    lookahead_days: List[float]
+    lookahead_days: List[Union[float, Tuple[float, float]]]
     incident: Sequence[bool]
 
     def create_combinations(self) -> List[OutcomeSpec]:
diff --git a/src/timeseriesflattener/feature_specs/single_specs.py b/src/timeseriesflattener/feature_specs/single_specs.py
index 467c4ed..5831f24 100644
--- a/src/timeseriesflattener/feature_specs/single_specs.py
+++ b/src/timeseriesflattener/feature_specs/single_specs.py
@@ -1,14 +1,26 @@
 from dataclasses import dataclass
-from typing import Union
+from typing import Tuple, Union
 
 import pandas as pd
 from timeseriesflattener.aggregation_fns import AggregationFunType
 from timeseriesflattener.utils.pydantic_basemodel import BaseModel
 
 
+@dataclass(frozen=True)
+class LookPeriod:
+    min_days: float
+    max_days: float
+
+    def __post_init__(self):
+        if self.min_days > self.max_days:
+            raise ValueError(
+                f"Invalid LookPeriod. The min_days ({self.min_days}) must be smaller than the max_days {self.max_days}.",
+            )
+
+
 @dataclass(frozen=True)
 class CoercedFloats:
-    lookwindow: Union[float, int]
+    lookperiod: LookPeriod
     fallback: Union[float, int]
 
 
@@ -20,17 +32,25 @@ def can_be_coerced_losslessly_to_int(value: float) -> bool:
         return False
 
 
-def coerce_floats(lookwindow: float, fallback: float) -> CoercedFloats:
-    lookwindow = (
-        lookwindow
-        if not can_be_coerced_losslessly_to_int(lookwindow)
-        else int(lookwindow)
+def coerce_floats(lookperiod: LookPeriod, fallback: float) -> CoercedFloats:
+    min_days = (
+        lookperiod.min_days
+        if not can_be_coerced_losslessly_to_int(lookperiod.min_days)
+        else int(lookperiod.min_days)
     )
+    max_days = (
+        lookperiod.max_days
+        if not can_be_coerced_losslessly_to_int(lookperiod.max_days)
+        else int(lookperiod.max_days)
+    )
+
+    coerced_lookperiod = LookPeriod(min_days=min_days, max_days=max_days)
+
     fallback = (
         fallback if not can_be_coerced_losslessly_to_int(fallback) else int(fallback)
     )
 
-    return CoercedFloats(lookwindow=lookwindow, fallback=fallback)
+    return CoercedFloats(lookperiod=coerced_lookperiod, fallback=fallback)
 
 
 class StaticSpec(BaseModel):
@@ -59,13 +79,18 @@ class StaticSpec(BaseModel):
 def get_temporal_col_name(
     prefix: str,
     feature_base_name: str,
-    lookwindow: Union[float, int],
+    lookperiod: LookPeriod,
     aggregation_fn: AggregationFunType,
     fallback: Union[float, int],
 ) -> str:
     """Get the column name for the temporal feature."""
-    coerced = coerce_floats(lookwindow=lookwindow, fallback=fallback)
-    col_str = f"{prefix}_{feature_base_name}_within_{coerced.lookwindow!s}_days_{aggregation_fn.__name__}_fallback_{coerced.fallback}"
+    coerced = coerce_floats(lookperiod=lookperiod, fallback=fallback)
+    lookperiod_str = (
+        f"{coerced.lookperiod.max_days!s}"
+        if coerced.lookperiod.min_days == 0
+        else f"{coerced.lookperiod.min_days!s}_to_{coerced.lookperiod.max_days!s}"
+    )
+    col_str = f"{prefix}_{feature_base_name}_within_{lookperiod_str}_days_{aggregation_fn.__name__}_fallback_{coerced.fallback}"
     return col_str
 
 
@@ -80,7 +105,8 @@ class OutcomeSpec(BaseModel):
             NOTE: Column names can be overridden when initialising TimeSeriesFlattener.
         feature_base_name: The name of the feature. Used for column name generation, e.g.
             <prefix>_<feature_baase_name>_<metadata>.
-        lookahead_days: How far ahead from the prediction time to look for outcome values.
+        lookahead_days: In which interval from the prediction time to look for outcome values.
+            Can be tuple of two floats specifying (min_days, max_days) or float | int which will resolve to (0, value).
         aggregation_fn: How to aggregate multiple values within lookahead days. Should take a grouped dataframe as input and return a single value.
         fallback: Value to return if no values is found within window.
         incident: Whether the outcome is incident or not. E.g. type 2 diabetes is incident because you can only experience it once.
@@ -92,18 +118,27 @@ class OutcomeSpec(BaseModel):
 
     timeseries_df: pd.DataFrame
     feature_base_name: str
-    lookahead_days: float
+    lookahead_days: Union[float, Tuple[float, float]]
     aggregation_fn: AggregationFunType
     fallback: Union[float, int]
     incident: bool
     prefix: str = "outc"
 
+    @property
+    def lookahead_period(self) -> LookPeriod:
+        if isinstance(self.lookahead_days, (float, int)):
+            return LookPeriod(min_days=0, max_days=self.lookahead_days)
+        return LookPeriod(
+            min_days=self.lookahead_days[0],
+            max_days=self.lookahead_days[1],
+        )
+
     def get_output_col_name(self) -> str:
         """Get the column name for the output column."""
         col_str = get_temporal_col_name(
             prefix=self.prefix,
             feature_base_name=self.feature_base_name,
-            lookwindow=self.lookahead_days,
+            lookperiod=self.lookahead_period,
             aggregation_fn=self.aggregation_fn,
             fallback=self.fallback,
         )
@@ -129,12 +164,10 @@ class PredictorSpec(BaseModel):
             NOTE: Column names can be overridden when initialising TimeSeriesFlattener.
         feature_base_name: The name of the feature. Used for column name generation, e.g.
             <prefix>_<feature_baase_name>_<metadata>.
-        lookbehind_days: How far behind from the prediction time to look for predictor values.
-        aggregation_fn: How to aggregate multiple values within lookahead days. Should take a grouped dataframe as input and return a single value.
+        lookbehind_days: In which interval from the prediction time to look for predictor values.
+            Can be tuple of two floats specifying (min_days, max_days) or float | int which will resolve to (0, value).
+        aggregation_fn: How to aggregate multiple values within lookbehind days. Should take a grouped dataframe as input and return a single value.
         fallback: Value to return if no values is found within window.
-        incident: Whether the outcome is incident or not. E.g. type 2 diabetes is incident because you can only experience it once.
-            Incident outcomes can be handled in a vectorised way during resolution, which is faster than non-incident outcomes.
-            Requires that each entity only occurs once in the timeseries_df.
         prefix: The prefix used for column name generation, e.g.
             <prefix>_<feature_name>_<metadata>. Defaults to "pred".
     """
@@ -143,15 +176,24 @@ class PredictorSpec(BaseModel):
     feature_base_name: str
     aggregation_fn: AggregationFunType
     fallback: Union[float, int]
-    lookbehind_days: float
+    lookbehind_days: Union[float, Tuple[float, float]]
     prefix: str = "pred"
 
+    @property
+    def lookbehind_period(self) -> LookPeriod:
+        if isinstance(self.lookbehind_days, (float, int)):
+            return LookPeriod(min_days=0, max_days=self.lookbehind_days)
+        return LookPeriod(
+            min_days=self.lookbehind_days[0],
+            max_days=self.lookbehind_days[1],
+        )
+
     def get_output_col_name(self) -> str:
         """Generate the column name for the output column."""
         return get_temporal_col_name(
             prefix=self.prefix,
             feature_base_name=self.feature_base_name,
-            lookwindow=self.lookbehind_days,
+            lookperiod=self.lookbehind_period,
             aggregation_fn=self.aggregation_fn,
             fallback=self.fallback,
         )
diff --git a/src/timeseriesflattener/flattened_dataset.py b/src/timeseriesflattener/flattened_dataset.py
index 7971e63..34e489e 100644
--- a/src/timeseriesflattener/flattened_dataset.py
+++ b/src/timeseriesflattener/flattened_dataset.py
@@ -20,6 +20,7 @@ from pydantic import BaseModel as PydanticBaseModel
 from timeseriesflattener.feature_cache.abstract_feature_cache import FeatureCache
 from timeseriesflattener.feature_specs.single_specs import (
     AnySpec,
+    LookPeriod,
     OutcomeSpec,
     PredictorSpec,
     StaticSpec,
@@ -257,7 +258,7 @@ class TimeseriesFlattener:
     def _drop_records_outside_interval_days(
         df: DataFrame,
         direction: str,
-        interval_days: float,
+        lookperiod: LookPeriod,
         timestamp_pred_colname: str,
         timestamp_value_colname: str,
     ) -> DataFrame:
@@ -267,7 +268,7 @@ class TimeseriesFlattener:
 
         Args:
             direction (str): Whether to look ahead or behind.
-            interval_days (float): How far to look
+            lookperiod (LookPeriod): Interval to look within.
             df (DataFrame): Source dataframe
             timestamp_pred_colname (str): Name of timestamp column for predictions in df.
             timestamp_value_colname (str): Name of timestamp column for values in df.
@@ -287,12 +288,12 @@ class TimeseriesFlattener:
 
         if direction == "ahead":
             df["is_in_interval"] = (
-                df["time_from_pred_to_val_in_days"] <= interval_days
-            ) & (df["time_from_pred_to_val_in_days"] > 0)
+                df["time_from_pred_to_val_in_days"] <= lookperiod.max_days
+            ) & (df["time_from_pred_to_val_in_days"] > lookperiod.min_days)
         elif direction == "behind":
             df["is_in_interval"] = (
-                df["time_from_pred_to_val_in_days"] >= -interval_days
-            ) & (df["time_from_pred_to_val_in_days"] < 0)
+                df["time_from_pred_to_val_in_days"] >= -lookperiod.max_days
+            ) & (df["time_from_pred_to_val_in_days"] < -lookperiod.min_days)
         else:
             raise ValueError("direction can only be 'ahead' or 'behind'")
 
@@ -349,17 +350,17 @@ class TimeseriesFlattener:
         # Drop prediction times without event times within interval days
         if isinstance(output_spec, OutcomeSpec):
             direction = "ahead"
-            interval_days = output_spec.lookahead_days
+            lookperiod = output_spec.lookahead_period
         elif isinstance(output_spec, PredictorSpec):
             direction = "behind"
-            interval_days = output_spec.lookbehind_days
+            lookperiod = output_spec.lookbehind_period
         else:
             raise ValueError(f"Unknown output_spec type {type(output_spec)}")
 
         df = TimeseriesFlattener._drop_records_outside_interval_days(
             df,
             direction=direction,
-            interval_days=interval_days,
+            lookperiod=lookperiod,
             timestamp_pred_colname=timestamp_pred_col_name,
             timestamp_value_colname=timestamp_val_col_name,
         )
@@ -658,8 +659,12 @@ class TimeseriesFlattener:
         if outcome_spec.is_dichotomous():
             outcome_is_within_lookahead = (
                 df[prediction_timestamp_col_name]  # type: ignore
-                + timedelta(days=outcome_spec.lookahead_days)
+                + timedelta(days=outcome_spec.lookahead_period.max_days)
                 > df[outcome_timestamp_col_name]
+            ) & (
+                df[prediction_timestamp_col_name]  # type: ignore
+                + timedelta(days=outcome_spec.lookahead_period.min_days)
+                <= df[outcome_timestamp_col_name]
             )
 
             df[outcome_spec.get_output_col_name()] = outcome_is_within_lookahead.astype(
@@ -690,11 +695,11 @@ class TimeseriesFlattener:
 
         if isinstance(spec, PredictorSpec):
             min_val_date = spec.timeseries_df[self.timestamp_col_name].min()  # type: ignore
-            return min_val_date + pd.Timedelta(days=spec.lookbehind_days)
+            return min_val_date + pd.Timedelta(days=spec.lookbehind_period.max_days)
 
         if isinstance(spec, OutcomeSpec):
             max_val_date = spec.timeseries_df[self.timestamp_col_name].max()  # type: ignore
-            return max_val_date - pd.Timedelta(days=spec.lookahead_days)
+            return max_val_date - pd.Timedelta(days=spec.lookahead_period.max_days)
 
         raise ValueError(f"Spec type {type(spec)} not recognised.")
 


Test patch:
diff --git a/src/timeseriesflattener/tests/test_timeseriesflattener/test_feature_spec_objects.py b/src/timeseriesflattener/tests/test_timeseriesflattener/test_feature_spec_objects.py
index 5decc27..4d0f4b3 100644
--- a/src/timeseriesflattener/tests/test_timeseriesflattener/test_feature_spec_objects.py
+++ b/src/timeseriesflattener/tests/test_timeseriesflattener/test_feature_spec_objects.py
@@ -4,6 +4,7 @@
 from typing import List
 
 import numpy as np
+import pytest
 
 from timeseriesflattener.aggregation_fns import maximum
 from timeseriesflattener.feature_specs.group_specs import (
@@ -11,6 +12,8 @@ from timeseriesflattener.feature_specs.group_specs import (
     OutcomeGroupSpec,
     PredictorGroupSpec,
 )
+from timeseriesflattener.feature_specs.single_specs import PredictorSpec
+from timeseriesflattener.testing.utils_for_testing import str_to_df
 
 
 def test_skip_all_if_no_need_to_process(empty_named_df: NamedDataframe):
@@ -79,9 +82,24 @@ def test_create_combinations_outcome_specs(empty_named_df: NamedDataframe):
     """Test that create_combinations() creates the correct outcome_specs."""
     outc_spec_batch = OutcomeGroupSpec(
         named_dataframes=[empty_named_df],
-        lookahead_days=[1, 2],
+        lookahead_days=[1, 2, (1, 2)],
         aggregation_fns=[maximum],
         fallback=[0],
         incident=[True],
     ).create_combinations()
-    assert len(outc_spec_batch) == 2
+    assert len(outc_spec_batch) == 3
+
+
+def test_invalid_lookbehind():
+    prediction_times_df_str = """entity_id,timestamp,
+                                1,2021-12-30 00:00:00
+                                """
+    spec = PredictorSpec(
+        timeseries_df=str_to_df(prediction_times_df_str),
+        lookbehind_days=(1, 0),
+        aggregation_fn=maximum,
+        fallback=2,
+        feature_base_name="value",
+    )
+    with pytest.raises(ValueError, match=r".*Invalid.*"):
+        assert spec.lookbehind_period
diff --git a/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_add_values.py b/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_add_values.py
index a12b34b..6b3b2bb 100644
--- a/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_add_values.py
+++ b/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_add_values.py
@@ -94,6 +94,27 @@ def test_multiple_citizens_predictor():
     )
 
 
+def test_predictor_with_interval_lookperiod():
+    prediction_times_df_str = """entity_id,timestamp,
+                            1,2022-01-01 00:00:00
+                            """
+    predictor_df_str = """entity_id,timestamp,value,
+                        1,2021-12-30 00:00:01, 2
+                        1,2021-12-15 00:00:00, 1
+                        """
+    assert_flattened_data_as_expected(
+        prediction_times_df=prediction_times_df_str,
+        output_spec=PredictorSpec(
+            timeseries_df=str_to_df(predictor_df_str),
+            lookbehind_days=(5, 30),
+            fallback=np.NaN,
+            feature_base_name="value",
+            aggregation_fn=maximum,
+        ),
+        expected_values=[1],
+    )
+
+
 # Outcomes
 def test_event_after_prediction_time():
     prediction_times_df_str = """entity_id,timestamp,
@@ -167,6 +188,48 @@ def test_multiple_citizens_outcome():
     )
 
 
+def test_outcome_with_interval_lookperiod_outside():
+    prediction_times_df_str = """entity_id,timestamp,
+                            1,2022-01-01 00:00:00
+                            """
+    outcome_df_str = """entity_id,timestamp,value,
+                        1,2022-01-02 00:00:00, 1
+                        """
+    assert_flattened_data_as_expected(
+        prediction_times_df=prediction_times_df_str,
+        output_spec=OutcomeSpec(
+            timeseries_df=str_to_df(outcome_df_str),
+            lookahead_days=(2, 10),
+            fallback=0,
+            incident=True,
+            feature_base_name="value",
+            aggregation_fn=maximum,
+        ),
+        expected_values=[0],
+    )
+
+
+def test_outcome_interval_lookperiod_inside():
+    prediction_times_df_str = """entity_id,timestamp,
+                            1,2022-01-01 00:00:00
+                            """
+    outcome_df_str = """entity_id,timestamp,value,
+                        1,2022-01-03 00:00:00, 1
+                        """
+    assert_flattened_data_as_expected(
+        prediction_times_df=prediction_times_df_str,
+        output_spec=OutcomeSpec(
+            timeseries_df=str_to_df(outcome_df_str),
+            lookahead_days=(1, 10),
+            fallback=0,
+            incident=True,
+            feature_base_name="value",
+            aggregation_fn=maximum,
+        ),
+        expected_values=[1],
+    )
+
+
 def test_citizen_without_outcome():
     prediction_times_df_str = """entity_id,timestamp,
                             1,2021-12-31 00:00:00
diff --git a/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_errors.py b/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_errors.py
index 6f36c5d..7d81cc2 100644
--- a/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_errors.py
+++ b/src/timeseriesflattener/tests/test_timeseriesflattener/test_flattened_dataset/test_errors.py
@@ -5,9 +5,7 @@ import pytest
 from timeseriesflattener.aggregation_fns import maximum
 from timeseriesflattener.feature_specs.single_specs import PredictorSpec
 from timeseriesflattener.flattened_dataset import TimeseriesFlattener
-from timeseriesflattener.testing.utils_for_testing import (
-    str_to_df,
-)
+from timeseriesflattener.testing.utils_for_testing import str_to_df
 
 
 def test_col_does_not_exist_in_prediction_times():