diff --git a/src/bayesnf/__init__.py b/src/bayesnf/__init__.py index 141f00a..5b66cb9 100644 --- a/src/bayesnf/__init__.py +++ b/src/bayesnf/__init__.py @@ -16,7 +16,7 @@ # A new PyPI release will be pushed every time `__version__` is increased. # When changing this, also update the CHANGELOG.md -__version__ = '0.1.2' +__version__ = '0.1.3' from .spatiotemporal import BayesianNeuralFieldMAP from .spatiotemporal import BayesianNeuralFieldMLE diff --git a/src/bayesnf/spatiotemporal.py b/src/bayesnf/spatiotemporal.py index 1a56a09..3bdd10a 100644 --- a/src/bayesnf/spatiotemporal.py +++ b/src/bayesnf/spatiotemporal.py @@ -60,8 +60,9 @@ def seasonality_to_float(seasonality: str, freq: str) -> float: def seasonalities_to_array( - seasonalities: Sequence[float | str], freq: str -) -> np.ndarray: + seasonalities: Sequence[float | str], + freq: str + ) -> np.ndarray: """Convert a list of floats or strings to durations relative to a frequency. Args: @@ -99,6 +100,10 @@ def _convert_datetime_col(table, time_column, timetype, freq, time_min=None): first_date = pd.to_datetime('2020-01-01').to_period(freq) table[time_column] = table[time_column].dt.to_period(freq) table[time_column] = (table[time_column] - first_date).apply(lambda x: x.n) + elif timetype == 'float': + table[time_column] = table[time_column].apply(float) + else: + raise ValueError(f'Unknown timetype: {timetype}') if time_min is None: time_min = table[time_column].min() table[time_column] = table[time_column] - time_min @@ -217,7 +222,7 @@ def __init__( num_seasonal_harmonics: Sequence[int] | None = None, fourier_degrees: Sequence[float] | None = None, interactions: Sequence[tuple[int, int]] | None = None, - freq: str, + freq: str | None = None, timetype: str = 'index', depth: int = 2, width: int = 512, @@ -237,16 +242,18 @@ def __init__( seasonality_periods: A list of numbers representing the seasonal frequencies of the data - in the time domain. It is also possible to specify a string such as - 'W', 'D', etc. corresponding to a valid Pandas frequency: see the - Pandas [Offset Aliases]( - https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases) - for valid values. + in the time domain. If timetype == 'index', then it is possible + to specify numeric frequencies by using string short hands such as + 'W', 'D', etc., which correspond to a valid Pandas frequency. + See Pandas [Offset Aliases](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases) + for valid string values. num_seasonal_harmonics: A list of seasonal harmonics, one for each entry in `seasonality_periods`. The number of seasonal harmonics (h) for a - given seasonal period `p` must satisfy `h < p//2`. + given seasonal period `p` must satisfy `h < p//2`. It is an error + fir `len(num_seasonal_harmonics) != len(seasonality_periods)`. + Should be used only if `timetype == 'index'`. fourier_degrees: A list of integer degrees for the Fourier features of the inputs. @@ -263,13 +270,13 @@ def __init__( freq: A frequency string for the sampling rate at which the data is collected. See the Pandas - [Offset Aliases]( - https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases) - for valid values. + [Offset Aliases](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases) + for valid values. Should be used if and only if `timetype == 'index'`. timetype: - Must be specified as `index`. The general versions will be - integrated pending https://github.com/google/bayesnf/issues/16. + Either `index` or `float`. If `index`, then the time column must + be a `datetime` type and `freq` must be given. + Otherwise, if `float`, then the time column must be `float`. depth: The number of hidden layers in the BayesNF architecture. @@ -337,18 +344,47 @@ def _get_interactions(self) -> np.ndarray: f' passed shape was {interactions.shape})') return interactions + def _get_seasonality_periods(self): + """Return array of seasonal periods.""" + if ( + (self.timetype == 'index' and self.freq is None) or + (self.timetype == 'float' and self.freq is not None)): + raise ValueError(f'Invalid {self.freq=} with {self.timetype=}.') + if self.seasonality_periods is None: + return np.zeros(0) + if self.timetype == 'index': + return seasonalities_to_array(self.seasonality_periods, self.freq) + if self.timetype == 'float': + return np.asarray(self.seasonality_periods, dtype=float) + assert False, f'Impossible {self.timetype=}.' + + def _get_num_seasonal_harmonics(self): + """Return array of seasonal harmonics per seasonal period.""" + # Discrete time. + if self.timetype == 'index': + return ( + np.array(self.num_seasonal_harmonics) + if self.num_seasonal_harmonics is not None else + np.zeros(0)) + # Continuous time. + if self.timetype == 'float': + if self.num_seasonal_harmonics is not None: + raise ValueError( + f'Cannot use num_seasonal_harmonics with {self.timetype=}.') + # HACK: models.make_seasonal_frequencies assumes the data is discrete + # time where each harmonic h is between 1, ..., p/2 and the harmonic + # factors are np.arange(1, h + 1). Since our goal with continuous + # time data is exactly 1 harmonic per seasonal factor, any h between + # 0 and min(0.5, p/2) will work, as np.arange(1, 1+h) = [1] + return np.fmin(.5, self._get_seasonality_periods() / 2) + assert False, f'Impossible {timetype=}.' + def _model_args(self, batch_shape): return { 'depth': self.depth, 'input_scales': self.data_handler.get_input_scales(), - 'num_seasonal_harmonics': - np.array(self.num_seasonal_harmonics) - if self.num_seasonal_harmonics is not None - else np.zeros(0), - 'seasonality_periods': - seasonalities_to_array(self.seasonality_periods, self.freq) - if self.seasonality_periods is not None - else np.zeros(0), + 'num_seasonal_harmonics': self._get_num_seasonal_harmonics(), + 'seasonality_periods': self._get_seasonality_periods(), 'width': self.width, 'init_x': batch_shape, 'fourier_degrees': self._get_fourier_degrees(batch_shape), diff --git a/tests/spatiotemporal_test.py b/tests/spatiotemporal_test.py deleted file mode 100644 index d77d01d..0000000 --- a/tests/spatiotemporal_test.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2024 The bayesnf Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Tests for spatiotemporal.py.""" -from bayesnf import spatiotemporal -import numpy as np -import pytest - - -@pytest.mark.parametrize( - "seasonality, freq, expected", - [ - ("Y", "Y", 1), - ("Q", "Q", 1), - ("Y", "Q", 4), - ("M", "H", 730.5), - ("Q", "M", 3), - ("Y", "M", 12), - ("M", "D", 30.4375), - ("min", "S", 60), - ("H", "S", 3600), - ("D", "S", 86400), - ("M", "S", 2629800), - ("Q", "S", 7889400), - ("Y", "S", 31557600), - ], -) -def test_seasonality_to_float(seasonality, freq, expected): - assert spatiotemporal.seasonality_to_float(seasonality, freq) == expected - - -def test_seasonalities_to_array(): - periods = spatiotemporal.seasonalities_to_array(["D", "W", "M"], "H") - np.testing.assert_allclose(periods, np.array([24, 168, 730.5])) diff --git a/tests/test_data/bnf-map.chickenpox.8.mini.pred.csv b/tests/test_data/bnf-map.chickenpox.8.mini.pred.csv new file mode 100644 index 0000000..f97b842 --- /dev/null +++ b/tests/test_data/bnf-map.chickenpox.8.mini.pred.csv @@ -0,0 +1,309 @@ +,yhat,yhat_p50,yhat_lower,yhat_upper +1044,0.21495397,0.21496189,-37.737514,38.16725 +1045,0.23203605,0.23204367,-37.720543,38.18443 +1046,0.2587072,0.2587174,-37.694103,38.211296 +1047,0.22862649,0.22863461,-37.723885,38.180943 +1048,0.23671561,0.23672517,-37.715775,38.189007 +1049,0.24852464,0.24853335,-37.70404,38.2009 +1050,0.26518914,0.26519972,-37.68762,38.217796 +1051,0.22480732,0.22481665,-37.727703,38.177135 +1052,0.22816844,0.22817686,-37.72433,38.180473 +1053,0.24338348,0.24339211,-37.709072,38.195637 +1054,0.26731098,0.26731881,-37.68534,38.21975 +1055,0.23185971,0.23186755,-37.720592,38.184128 +1056,0.23330253,0.23331137,-37.71915,38.185566 +1057,0.23978871,0.23979737,-37.712677,38.192055 +1058,0.2560291,0.25603792,-37.696598,38.208447 +1059,0.2201559,0.22016458,-37.732197,38.172333 +1060,0.22611725,0.22612625,-37.726196,38.178253 +1061,0.2398242,0.23983292,-37.712524,38.192005 +1062,0.25790024,0.2579097,-37.694572,38.210175 +1063,0.21892506,0.21893358,-37.733356,38.17102 +1064,0.22161923,0.22162773,-37.73068,38.173744 +1065,0.23603469,0.23604457,-37.716263,38.188145 +1066,0.2617259,0.26173556,-37.69069,38.21394 +1067,0.22989257,0.22990167,-37.7224,38.182 +1068,0.23466523,0.23467395,-37.717663,38.18681 +1069,0.24425319,0.24426247,-37.708126,38.196434 +1070,0.2624333,0.262443,-37.69014,38.214806 +1071,0.22537336,0.22538176,-37.727,38.177574 +1072,0.22935696,0.22936572,-37.723053,38.181595 +1073,0.24034287,0.2403528,-37.712025,38.192513 +1074,0.26067725,0.26068622,-37.691837,38.212994 +1075,0.22718129,0.22718875,-37.725197,38.179375 +1076,0.23792782,0.23793642,-37.714615,38.190273 +1077,0.25437856,0.2543874,-37.69807,38.20662 +1078,0.27369943,0.27370897,-37.67891,38.226097 +1079,0.22981206,0.22981928,-37.722603,38.18204 +1080,0.22497039,0.22497827,-37.727486,38.177242 +1081,0.2304088,0.23041688,-37.72192,38.182545 +1082,0.25075984,0.25077084,-37.70171,38.203037 +1083,0.21578684,0.21579717,-37.73652,38.167927 +1084,0.2155875,0.21559612,-37.73675,38.167744 +1085,0.21911944,0.21912757,-37.73319,38.171253 +1086,0.23518565,0.23519446,-37.7173,38.187485 +1087,0.20110601,0.20111527,-37.751232,38.15329 +1088,0.21191514,0.21192378,-37.7405,38.164143 +1089,0.22999375,0.23000325,-37.722416,38.18223 +1090,0.250623,0.2506321,-37.701946,38.202995 +1091,0.20794229,0.20795101,-37.74441,38.16013 +1092,0.2028878,0.20289773,-37.74951,38.15513 +1093,0.21065134,0.21065988,-37.74179,38.16293 +1094,0.23300968,0.23301709,-37.719627,38.185463 +1095,0.20357443,0.20358197,-37.748844,38.155815 +1096,0.21186806,0.21187632,-37.740585,38.16414 +1097,0.2266841,0.22669241,-37.725727,38.17891 +1098,0.24990107,0.24991015,-37.70267,38.202282 +1099,0.21719776,0.21720555,-37.735184,38.16941 +1100,0.2232308,0.22324033,-37.729267,38.17553 +1101,0.23412535,0.2341334,-37.718338,38.186394 +1102,0.2518628,0.25186992,-37.700775,38.204315 +1103,0.21002226,0.21003167,-37.742374,38.162235 +1104,0.20867753,0.20868614,-37.743748,38.16092 +1105,0.21847776,0.21848623,-37.733875,38.170643 +1106,0.24017763,0.24018721,-37.712337,38.19251 +1107,0.20505878,0.20506632,-37.747326,38.157253 +1108,0.20687777,0.20688617,-37.745544,38.15912 +1109,0.21136057,0.21136808,-37.740963,38.163506 +1110,0.22610432,0.22611363,-37.72631,38.17834 +1111,0.18994191,0.1899507,-37.762302,38.14201 +1112,0.19848478,0.19849439,-37.75381,38.15061 +1113,0.21380658,0.21381515,-37.738445,38.16588 +1114,0.23588355,0.23589194,-37.71645,38.188015 +1115,0.19777447,0.19778231,-37.754467,38.149864 +1116,0.19907117,0.19907925,-37.75321,38.151188 +1117,0.20851284,0.20852031,-37.743706,38.160553 +1118,0.23324305,0.23325282,-37.719067,38.185375 +1119,0.20261589,0.20262657,-37.749664,38.154724 +1120,0.20995773,0.20996708,-37.742405,38.162144 +1121,0.21691763,0.21692583,-37.73538,38.169014 +1122,0.23302844,0.2330385,-37.719433,38.18531 +1123,0.19465254,0.19466016,-37.75768,38.14681 +1124,0.20204914,0.20205912,-37.75036,38.15428 +1125,0.21651343,0.21652289,-37.735798,38.168633 +1126,0.23983306,0.2398415,-37.712643,38.192112 +1127,0.20521334,0.20522438,-37.747177,38.157425 +1128,0.21344563,0.2134541,-37.73902,38.16575 +1129,0.2269518,0.22696051,-37.72539,38.179104 +1130,0.24761717,0.24762733,-37.704906,38.199936 +1131,0.20781535,0.20782402,-37.74458,38.160046 +1132,0.20855793,0.20856701,-37.74387,38.160816 +1133,0.21536663,0.21537451,-37.736946,38.167503 +1134,0.23592512,0.23593558,-37.716587,38.18827 +1135,0.20216583,0.20217441,-37.750164,38.15431 +1136,0.20896605,0.20897563,-37.74332,38.161068 +1137,0.22139156,0.2214005,-37.730896,38.1735 +1138,0.24479638,0.24480635,-37.707756,38.19717 +1139,0.21285047,0.2128598,-37.73963,38.165154 +1140,0.22217263,0.22218268,-37.730312,38.17449 +1141,0.23867187,0.23868114,-37.713806,38.190952 +1142,0.26049897,0.26050785,-37.692184,38.21298 +1143,0.22177881,0.22178783,-37.730663,38.174046 +5168,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5169,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5170,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5171,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5172,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5173,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5174,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5175,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5176,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5177,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5178,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5179,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5180,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5181,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5182,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5183,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5184,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5185,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5186,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5187,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5188,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5189,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5190,174931280000.0,300580670000.0,-343514870000.0,580587550000.0 +5191,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5192,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5193,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5194,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5195,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5196,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5197,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5198,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5199,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5200,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5201,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5202,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5203,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5204,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5205,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5206,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5207,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5208,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5209,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5210,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5211,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5212,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5213,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5214,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5215,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5216,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5217,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5218,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +5219,174931280000.0,300580670000.0,-343514800000.0,580587600000.0 +8300,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8301,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8302,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8303,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8304,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8305,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8306,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8307,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8308,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8309,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8310,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8311,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8312,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8313,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8314,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8315,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8316,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8317,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8318,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8319,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8320,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8321,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8322,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8323,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8324,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8325,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8326,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8327,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8328,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8329,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8330,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8331,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8332,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8333,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8334,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8335,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8336,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8337,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8338,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8339,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8340,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8341,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8342,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8343,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8344,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8345,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8346,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8347,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8348,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8349,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8350,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +8351,533711680000.0,300580670000.0,1557679600000.0,1557679700000.0 +9866,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9867,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9868,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9869,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9870,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9871,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9872,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9873,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9874,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9875,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9876,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9877,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9878,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9879,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9880,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9881,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9882,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9883,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9884,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9885,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9886,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9887,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9888,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9889,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9890,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9891,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9892,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9893,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9894,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9895,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9896,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9897,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9898,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9899,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9900,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9901,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9902,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9903,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9904,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9905,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9906,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9907,326543340000.0,300580670000.0,-66224796000.0,824364900000.0 +9908,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9909,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9910,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9911,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9912,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9913,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9914,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9915,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9916,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +9917,326543280000.0,300580670000.0,-66225046000.0,824364760000.0 +10388,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10389,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10390,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10391,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10392,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10393,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10394,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10395,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10396,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10397,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10398,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10399,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10400,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10401,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10402,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10403,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10404,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10405,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10406,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10407,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10408,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10409,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10410,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10411,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10412,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10413,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10414,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10415,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10416,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10417,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10418,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10419,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10420,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10421,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10422,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10423,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10424,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10425,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10426,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10427,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10428,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10429,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10430,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10431,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10432,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10433,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10434,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10435,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10436,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10437,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10438,430654060000.0,300580670000.0,-90862820000.0,1068704660000.0 +10439,430654100000.0,300580670000.0,-90862940000.0,1068705050000.0 diff --git a/tests/test_data/bnf-mle.chickenpox.8.mini.pred.csv b/tests/test_data/bnf-mle.chickenpox.8.mini.pred.csv new file mode 100644 index 0000000..0e69c3d --- /dev/null +++ b/tests/test_data/bnf-mle.chickenpox.8.mini.pred.csv @@ -0,0 +1,309 @@ +,yhat,yhat_p50,yhat_lower,yhat_upper +1044,0.46942583,0.46942556,-37.484745,38.421833 +1045,0.5009158,0.50091666,-37.453365,38.45337 +1046,0.50636876,0.5063685,-37.448116,38.45903 +1047,0.48673883,0.48674026,-37.46741,38.43911 +1048,0.50203794,0.5020388,-37.452194,38.454453 +1049,0.534404,0.5344037,-37.419857,38.486786 +1050,0.5365315,0.5365309,-37.418,38.48919 +1051,0.510649,0.51065123,-37.44362,38.463093 +1052,0.52235085,0.5223527,-37.432014,38.47485 +1053,0.55844605,0.5584458,-37.395832,38.51079 +1054,0.56848633,0.56848675,-37.38607,38.521095 +1055,0.5463135,0.5463154,-37.408047,38.49877 +1056,0.55239177,0.5523937,-37.40207,38.50492 +1057,0.5732188,0.57321846,-37.381214,38.525684 +1058,0.57222843,0.572229,-37.382404,38.5249 +1059,0.55060863,0.55060947,-37.403675,38.502964 +1060,0.56385374,0.5638548,-37.390446,38.516224 +1061,0.591635,0.5916345,-37.362663,38.543926 +1062,0.5858439,0.5858453,-37.368587,38.538307 +1063,0.55230284,0.5523044,-37.40183,38.504524 +1064,0.55806863,0.55806917,-37.396088,38.51031 +1065,0.5888783,0.5888792,-37.36529,38.541058 +1066,0.59610754,0.59610754,-37.358223,38.54843 +1067,0.56894886,0.5689488,-37.38521,38.521156 +1068,0.5674628,0.56746274,-37.386803,38.519764 +1069,0.577482,0.5774828,-37.376823,38.529804 +1070,0.5611611,0.56116015,-37.39334,38.513725 +1071,0.51867276,0.51867294,-37.435505,38.471004 +1072,0.5119496,0.511949,-37.442245,38.464302 +1073,0.5248404,0.52484053,-37.429306,38.47714 +1074,0.51860636,0.5186073,-37.43567,38.47103 +1075,0.49190313,0.49190402,-37.462173,38.44418 +1076,0.5050242,0.50502616,-37.449238,38.45747 +1077,0.53239405,0.5323963,-37.421764,38.484657 +1078,0.52618897,0.5261902,-37.428154,38.478672 +1079,0.4857034,0.48570368,-37.468372,38.437973 +1080,0.479703,0.47970375,-37.474403,38.43206 +1081,0.49629045,0.496291,-37.457672,38.448467 +1082,0.49454656,0.4945461,-37.459602,38.4469 +1083,0.4668777,0.4668787,-37.487057,38.41907 +1084,0.4668879,0.466889,-37.487103,38.419132 +1085,0.48222357,0.48222464,-37.471718,38.434383 +1086,0.4777754,0.47777617,-37.476387,38.43018 +1087,0.4541825,0.45418432,-37.499817,38.406464 +1088,0.46881595,0.46881685,-37.485332,38.421215 +1089,0.50157535,0.50157547,-37.45252,38.45385 +1090,0.5001677,0.5001696,-37.454132,38.45266 +1091,0.46431628,0.46431738,-37.48972,38.416603 +1092,0.4585685,0.45856896,-37.495564,38.410984 +1093,0.47723657,0.4772356,-37.476933,38.429646 +1094,0.47652107,0.47652203,-37.47792,38.42921 +1095,0.45567065,0.45567122,-37.49853,38.40817 +1096,0.4657966,0.4657978,-37.48846,38.41832 +1097,0.49305394,0.4930542,-37.46108,38.445385 +1098,0.49451515,0.49451503,-37.4598,38.447037 +1099,0.4736561,0.47365686,-37.48044,38.426003 +1100,0.48778692,0.48778734,-37.46652,38.44029 +1101,0.51773393,0.5177352,-37.43646,38.47009 +1102,0.5177661,0.5177673,-37.436707,38.470387 +1103,0.48774946,0.4877503,-37.46647,38.44019 +1104,0.4935032,0.49350435,-37.460785,38.446007 +1105,0.52369773,0.523698,-37.430435,38.475975 +1106,0.53183836,0.5318395,-37.422596,38.48439 +1107,0.50990283,0.5099041,-37.444412,38.462368 +1108,0.51430345,0.514304,-37.440083,38.466866 +1109,0.5310106,0.5310104,-37.423145,38.4833 +1110,0.5280579,0.5280584,-37.426228,38.48049 +1111,0.5076078,0.50760835,-37.446426,38.459812 +1112,0.5246106,0.5246109,-37.429535,38.476894 +1113,0.5531711,0.55317307,-37.400883,38.505276 +1114,0.54923654,0.5492371,-37.404938,38.501484 +1115,0.5131998,0.5132,-37.440777,38.46532 +1116,0.51452434,0.5145247,-37.439476,38.466705 +1117,0.538367,0.53836906,-37.415558,38.490395 +1118,0.54537606,0.5453756,-37.40869,38.497547 +1119,0.5194371,0.5194358,-37.434586,38.471596 +1120,0.5192385,0.5192381,-37.43492,38.471558 +1121,0.5254589,0.52545774,-37.42855,38.47761 +1122,0.50837094,0.50837225,-37.445786,38.460697 +1123,0.4666472,0.46664837,-37.487278,38.41884 +1124,0.46549276,0.4654937,-37.488487,38.41773 +1125,0.48245677,0.48245695,-37.471413,38.43454 +1126,0.4793957,0.47939688,-37.474632,38.43164 +1127,0.4512633,0.4512649,-37.502655,38.403454 +1128,0.46330157,0.46330383,-37.49071,38.415558 +1129,0.4900673,0.4900684,-37.46382,38.44216 +1130,0.48911226,0.48911244,-37.464962,38.44138 +1131,0.4546457,0.45464483,-37.499275,38.406845 +1132,0.4553129,0.45531484,-37.498653,38.407562 +1133,0.4744053,0.47440508,-37.479446,38.426495 +1134,0.4765309,0.47653335,-37.477512,38.42879 +1135,0.45396072,0.45396218,-37.49989,38.4061 +1136,0.46410114,0.46410003,-37.489754,38.4162 +1137,0.48963594,0.4896355,-37.464226,38.441723 +1138,0.49379206,0.49379432,-37.460323,38.446114 +1139,0.47256356,0.47256407,-37.481487,38.424862 +1140,0.4867866,0.48678634,-37.46735,38.43914 +1141,0.5192004,0.5192006,-37.434895,38.471424 +1142,0.5224058,0.52240586,-37.431885,38.474834 +1143,0.4917182,0.49171877,-37.462326,38.44397 +5168,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5169,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5170,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5171,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5172,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5173,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5174,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5175,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5176,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5177,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5178,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5179,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5180,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5181,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5182,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5183,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5184,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5185,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5186,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5187,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5188,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5189,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5190,-435784400000.0,-144824470000.0,-1022341200000.0,-71595600000.0 +5191,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5192,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5193,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5194,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5195,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5196,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5197,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5198,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5199,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5200,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5201,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5202,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5203,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5204,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5205,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5206,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5207,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5208,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5209,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5210,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5211,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5212,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5213,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5214,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5215,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5216,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5217,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5218,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +5219,-435784400000.0,-144824470000.0,-1022341200000.0,-71595640000.0 +8300,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8301,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8302,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8303,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8304,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8305,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8306,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8307,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8308,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8309,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8310,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8311,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8312,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8313,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8314,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8315,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8316,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8317,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8318,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8319,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8320,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8321,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8322,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8323,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8324,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8325,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8326,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8327,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8328,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8329,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8330,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8331,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8332,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8333,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8334,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8335,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8336,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8337,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8338,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8339,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8340,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8341,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8342,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8343,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8344,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8345,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8346,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8347,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8348,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8349,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8350,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +8351,-1091380450000.0,-144824470000.0,2538323300000.0,-32186692000.0 +9866,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9867,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9868,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9869,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9870,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9871,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9872,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9873,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9874,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9875,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9876,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9877,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9878,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9879,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9880,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9881,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9882,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9883,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9884,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9885,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9886,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9887,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9888,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9889,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9890,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9891,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9892,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9893,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9894,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9895,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9896,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9897,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9898,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9899,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9900,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9901,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9902,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9903,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9904,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9905,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9906,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9907,1067295300000.0,1196749500000.0,472583570000.0,1819371500000.0 +9908,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9909,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9910,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9911,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9912,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9913,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9914,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9915,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9916,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +9917,1067295300000.0,1196749500000.0,472583630000.0,1819371400000.0 +10388,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10389,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10390,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10391,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10392,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10393,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10394,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10395,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10396,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10397,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10398,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10399,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10400,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10401,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10402,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10403,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10404,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10405,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10406,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10407,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10408,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10409,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10410,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10411,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10412,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10413,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10414,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10415,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10416,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10417,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10418,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10419,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10420,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10421,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10422,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10423,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10424,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10425,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10426,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10427,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10428,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10429,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10430,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10431,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10432,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10433,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10434,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10435,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10436,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10437,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10438,1567157100000.0,1196749500000.0,767539300000.0,2538323300000.0 +10439,1567157100000.0,1196749500000.0,767539600000.0,2538323300000.0 diff --git a/tests/test_data/bnf-vi.chickenpox.8.mini.pred.csv b/tests/test_data/bnf-vi.chickenpox.8.mini.pred.csv new file mode 100644 index 0000000..94da9f9 --- /dev/null +++ b/tests/test_data/bnf-vi.chickenpox.8.mini.pred.csv @@ -0,0 +1,309 @@ +,yhat,yhat_p50,yhat_lower,yhat_upper +1044,0.16520005,0.14758186,-2.3656611,2.7622066 +1045,0.22412685,0.2037495,-2.301203,2.8252304 +1046,0.221435,0.2016968,-2.301788,2.821083 +1047,0.20034364,0.18140122,-2.330333,2.797842 +1048,0.17863657,0.16233388,-2.355448,2.7716656 +1049,0.256158,0.23604953,-2.2718422,2.854476 +1050,0.26783,0.24789944,-2.256839,2.866672 +1051,0.2443686,0.22485021,-2.2852874,2.842769 +1052,0.20143391,0.1853892,-2.33175,2.7941546 +1053,0.25575513,0.23722197,-2.272896,2.8526876 +1054,0.26001835,0.24249217,-2.2650385,2.8556154 +1055,0.24092253,0.22263438,-2.2868414,2.8373036 +1056,0.2045258,0.18794821,-2.3245118,2.7965434 +1057,0.2626166,0.24175821,-2.2599967,2.8599408 +1058,0.26688445,0.24626166,-2.2531366,2.863809 +1059,0.25604278,0.23448388,-2.2684414,2.855125 +1060,0.22734158,0.20856588,-2.301387,2.822825 +1061,0.28294495,0.2617779,-2.2426798,2.8823347 +1062,0.2709058,0.25124052,-2.2557027,2.868502 +1063,0.23743032,0.21750823,-2.2961285,2.835925 +1064,0.20449305,0.18638341,-2.3308094,2.80133 +1065,0.27926108,0.2572187,-2.247316,2.884488 +1066,0.29662898,0.27490425,-2.2257116,2.904361 +1067,0.2794005,0.25755307,-2.2471848,2.8877127 +1068,0.23897219,0.22030605,-2.2913113,2.842273 +1069,0.2887759,0.2672356,-2.236071,2.8961017 +1070,0.278413,0.2569239,-2.2429512,2.8864088 +1071,0.24052121,0.21754895,-2.2843575,2.8509269 +1072,0.18712807,0.16674086,-2.3414354,2.7927318 +1073,0.23223005,0.20997281,-2.2929285,2.8400886 +1074,0.23139927,0.21033207,-2.2922645,2.837887 +1075,0.21627057,0.19427167,-2.3114853,2.824488 +1076,0.18844326,0.1679265,-2.340373,2.794423 +1077,0.24549915,0.22121887,-2.2757194,2.856071 +1078,0.23925467,0.21457729,-2.277261,2.8494165 +1079,0.21003094,0.18451987,-2.3094592,2.8203883 +1080,0.17699206,0.15372375,-2.3436406,2.7837467 +1081,0.24126378,0.21527238,-2.2733672,2.8524244 +1082,0.24591738,0.2205631,-2.2675502,2.8564134 +1083,0.22063357,0.19552206,-2.3008637,2.8311634 +1084,0.18356349,0.16113193,-2.3424501,2.7901847 +1085,0.24676766,0.22058469,-2.273455,2.8591704 +1086,0.2559334,0.2288213,-2.2597015,2.869231 +1087,0.23681389,0.20892054,-2.2826784,2.8515315 +1088,0.19937193,0.1741353,-2.323045,2.8095737 +1089,0.25406304,0.22643775,-2.264207,2.8687756 +1090,0.25391924,0.22644742,-2.2616794,2.8692074 +1091,0.23335247,0.20502624,-2.2861128,2.8511224 +1092,0.1980527,0.17151713,-2.3231552,2.8118985 +1093,0.25550795,0.22572058,-2.2606277,2.8740547 +1094,0.25294793,0.2240148,-2.262045,2.870259 +1095,0.23017554,0.20262317,-2.2910151,2.847124 +1096,0.19404805,0.17040882,-2.330344,2.80549 +1097,0.2512778,0.22547697,-2.2680848,2.8665526 +1098,0.24596576,0.22126764,-2.2714858,2.859808 +1099,0.22145183,0.19741592,-2.3029907,2.8346438 +1100,0.19441044,0.17300978,-2.333964,2.8035126 +1101,0.27092388,0.24624173,-2.2515721,2.8855495 +1102,0.28364158,0.25982472,-2.2361033,2.8977656 +1103,0.26053974,0.23736271,-2.265131,2.8741632 +1104,0.21406953,0.19466418,-2.317031,2.8214467 +1105,0.26348048,0.242273,-2.2643821,2.8732224 +1106,0.26289573,0.24301904,-2.2635348,2.8701775 +1107,0.24047568,0.22055012,-2.2916203,2.8478868 +1108,0.20105432,0.18396066,-2.3341315,2.8025963 +1109,0.25607207,0.23643385,-2.2742991,2.8610663 +1110,0.25790808,0.2393512,-2.2707958,2.8614848 +1111,0.24551845,0.22675344,-2.2890725,2.8504064 +1112,0.21875526,0.2031272,-2.3198218,2.818455 +1113,0.27692476,0.2589681,-2.2574282,2.8794098 +1114,0.2650866,0.24843091,-2.2696612,2.8647854 +1115,0.23004074,0.21334632,-2.312392,2.8294487 +1116,0.19540685,0.18121763,-2.3503513,2.7917268 +1117,0.26871768,0.25093144,-2.2681212,2.8719172 +1118,0.28585082,0.2676212,-2.2452404,2.8920329 +1119,0.27185097,0.252674,-2.262685,2.8803563 +1120,0.23368548,0.21764489,-2.3049269,2.8370907 +1121,0.28460056,0.26563781,-2.249185,2.8909304 +1122,0.2748477,0.25565076,-2.2558553,2.8802829 +1123,0.23920575,0.2192959,-2.2963552,2.8446414 +1124,0.18728442,0.17126879,-2.352978,2.784634 +1125,0.23088132,0.21415225,-2.3072357,2.8266416 +1126,0.22461042,0.21006347,-2.313746,2.8164935 +1127,0.20561491,0.19102333,-2.3386555,2.7983809 +1128,0.17639486,0.16401708,-2.3707578,2.7662096 +1129,0.2347756,0.21866772,-2.3063061,2.8294024 +1130,0.22835457,0.21202147,-2.3091898,2.8227365 +1131,0.20018116,0.1833907,-2.3420064,2.7957666 +1132,0.16739212,0.15300085,-2.376183,2.7596517 +1133,0.23247315,0.21496065,-2.3038423,2.8293796 +1134,0.23758778,0.22011696,-2.295417,2.8343487 +1135,0.21724734,0.19910488,-2.3216531,2.8151357 +1136,0.1833422,0.16719215,-2.358851,2.7777748 +1137,0.24952777,0.22913688,-2.2854369,2.8505507 +1138,0.26121494,0.23970184,-2.2683756,2.864829 +1139,0.24625719,0.22363703,-2.286247,2.8533826 +1140,0.21034609,0.18990861,-2.3222106,2.8142252 +1141,0.2671057,0.24345668,-2.2584505,2.876465 +1142,0.26538226,0.24180867,-2.2560241,2.8751435 +1143,0.24266104,0.21794443,-2.2819867,2.8542771 +5168,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5169,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5170,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5171,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5172,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5173,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5174,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5175,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5176,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5177,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5178,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5179,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5180,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5181,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5182,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5183,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5184,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5185,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5186,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5187,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5188,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5189,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5190,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5191,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5192,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5193,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5194,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5195,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5196,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5197,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5198,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5199,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5200,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5201,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5202,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5203,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5204,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5205,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5206,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5207,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5208,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5209,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5210,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5211,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5212,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5213,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5214,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5215,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5216,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5217,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5218,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +5219,-223931240000.0,-169550760000.0,-1025424700000.0,253546770000.0 +8300,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8301,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8302,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8303,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8304,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8305,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8306,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8307,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8308,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8309,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8310,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8311,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8312,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8313,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8314,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8315,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8316,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8317,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8318,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8319,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8320,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8321,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8322,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8323,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8324,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8325,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8326,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8327,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8328,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8329,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8330,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8331,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8332,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8333,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8334,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8335,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8336,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8337,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8338,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8339,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8340,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8341,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8342,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8343,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8344,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8345,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8346,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8347,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8348,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8349,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8350,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +8351,-472910630000.0,-226006650000.0,-1955301000000.0,919361000000.0 +9866,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9867,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9868,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9869,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9870,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9871,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9872,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9873,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9874,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9875,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9876,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9877,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9878,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9879,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9880,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9881,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9882,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9883,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9884,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9885,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9886,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9887,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9888,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9889,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9890,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9891,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9892,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9893,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9894,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9895,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9896,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9897,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9898,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9899,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9900,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9901,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9902,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9903,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9904,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9905,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9906,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9907,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9908,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9909,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9910,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9911,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9912,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9913,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9914,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9915,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9916,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +9917,1031829100000.0,1063647800000.0,111942280000.0,2162361600000.0 +10388,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10389,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10390,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10391,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10392,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10393,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10394,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10395,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10396,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10397,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10398,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10399,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10400,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10401,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10402,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10403,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10404,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10405,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10406,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10407,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10408,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10409,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10410,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10411,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10412,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10413,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10414,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10415,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10416,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10417,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10418,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10419,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10420,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10421,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10422,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10423,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10424,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10425,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10426,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10427,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10428,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10429,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10430,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10431,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10432,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10433,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10434,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10435,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10436,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10437,1440895900000.0,1460785100000.0,147130780000.0,3026853000000.0 +10438,1440895600000.0,1452850800000.0,147130780000.0,3026854000000.0 +10439,1440895600000.0,1452850800000.0,147130780000.0,3026854000000.0 diff --git a/tests/test_data/chickenpox.8.test.csv b/tests/test_data/chickenpox.8.test.csv new file mode 100644 index 0000000..412d082 --- /dev/null +++ b/tests/test_data/chickenpox.8.test.csv @@ -0,0 +1,209 @@ +,location,datetime,latitude,longitude,chickenpox +5168,HEVES,2014-01-06,47.78619787505695,20.19378767724689,22 +5169,HEVES,2014-01-13,47.78619787505695,20.19378767724689,84 +5170,HEVES,2014-01-20,47.78619787505695,20.19378767724689,40 +5171,HEVES,2014-01-27,47.78619787505695,20.19378767724689,27 +5172,HEVES,2014-02-03,47.78619787505695,20.19378767724689,23 +5173,HEVES,2014-02-10,47.78619787505695,20.19378767724689,30 +5174,HEVES,2014-02-17,47.78619787505695,20.19378767724689,50 +5175,HEVES,2014-02-24,47.78619787505695,20.19378767724689,14 +5176,HEVES,2014-03-03,47.78619787505695,20.19378767724689,6 +5177,HEVES,2014-03-10,47.78619787505695,20.19378767724689,53 +5178,HEVES,2014-03-17,47.78619787505695,20.19378767724689,32 +5179,HEVES,2014-03-24,47.78619787505695,20.19378767724689,31 +5180,HEVES,2014-03-31,47.78619787505695,20.19378767724689,66 +5181,HEVES,2014-04-07,47.78619787505695,20.19378767724689,43 +5182,HEVES,2014-04-14,47.78619787505695,20.19378767724689,32 +5183,HEVES,2014-04-21,47.78619787505695,20.19378767724689,18 +5184,HEVES,2014-04-28,47.78619787505695,20.19378767724689,4 +5185,HEVES,2014-05-05,47.78619787505695,20.19378767724689,31 +5186,HEVES,2014-05-12,47.78619787505695,20.19378767724689,77 +5187,HEVES,2014-05-19,47.78619787505695,20.19378767724689,96 +5188,HEVES,2014-05-26,47.78619787505695,20.19378767724689,100 +5189,HEVES,2014-06-02,47.78619787505695,20.19378767724689,38 +5190,HEVES,2014-06-09,47.78619787505695,20.19378767724689,70 +5191,HEVES,2014-06-16,47.78619787505695,20.19378767724689,76 +5192,HEVES,2014-06-23,47.78619787505695,20.19378767724689,48 +5193,HEVES,2014-06-30,47.78619787505695,20.19378767724689,11 +5194,HEVES,2014-07-07,47.78619787505695,20.19378767724689,40 +5195,HEVES,2014-07-14,47.78619787505695,20.19378767724689,33 +5196,HEVES,2014-07-21,47.78619787505695,20.19378767724689,12 +5197,HEVES,2014-07-28,47.78619787505695,20.19378767724689,8 +5198,HEVES,2014-08-04,47.78619787505695,20.19378767724689,1 +5199,HEVES,2014-08-11,47.78619787505695,20.19378767724689,12 +5200,HEVES,2014-08-18,47.78619787505695,20.19378767724689,1 +5201,HEVES,2014-08-25,47.78619787505695,20.19378767724689,0 +5202,HEVES,2014-09-01,47.78619787505695,20.19378767724689,2 +5203,HEVES,2014-09-08,47.78619787505695,20.19378767724689,0 +5204,HEVES,2014-09-15,47.78619787505695,20.19378767724689,3 +5205,HEVES,2014-09-22,47.78619787505695,20.19378767724689,0 +5206,HEVES,2014-09-29,47.78619787505695,20.19378767724689,1 +5207,HEVES,2014-10-06,47.78619787505695,20.19378767724689,0 +5208,HEVES,2014-10-13,47.78619787505695,20.19378767724689,0 +5209,HEVES,2014-10-20,47.78619787505695,20.19378767724689,3 +5210,HEVES,2014-10-27,47.78619787505695,20.19378767724689,1 +5211,HEVES,2014-11-03,47.78619787505695,20.19378767724689,1 +5212,HEVES,2014-11-10,47.78619787505695,20.19378767724689,1 +5213,HEVES,2014-11-17,47.78619787505695,20.19378767724689,3 +5214,HEVES,2014-11-24,47.78619787505695,20.19378767724689,0 +5215,HEVES,2014-12-01,47.78619787505695,20.19378767724689,10 +5216,HEVES,2014-12-08,47.78619787505695,20.19378767724689,19 +5217,HEVES,2014-12-15,47.78619787505695,20.19378767724689,2 +5218,HEVES,2014-12-22,47.78619787505695,20.19378767724689,17 +5219,HEVES,2014-12-29,47.78619787505695,20.19378767724689,38 +8300,SZABOLCS,2014-01-06,47.99266479968421,22.080999353003403,3 +8301,SZABOLCS,2014-01-13,47.99266479968421,22.080999353003403,9 +8302,SZABOLCS,2014-01-20,47.99266479968421,22.080999353003403,3 +8303,SZABOLCS,2014-01-27,47.99266479968421,22.080999353003403,83 +8304,SZABOLCS,2014-02-03,47.99266479968421,22.080999353003403,2 +8305,SZABOLCS,2014-02-10,47.99266479968421,22.080999353003403,34 +8306,SZABOLCS,2014-02-17,47.99266479968421,22.080999353003403,16 +8307,SZABOLCS,2014-02-24,47.99266479968421,22.080999353003403,25 +8308,SZABOLCS,2014-03-03,47.99266479968421,22.080999353003403,1 +8309,SZABOLCS,2014-03-10,47.99266479968421,22.080999353003403,29 +8310,SZABOLCS,2014-03-17,47.99266479968421,22.080999353003403,44 +8311,SZABOLCS,2014-03-24,47.99266479968421,22.080999353003403,42 +8312,SZABOLCS,2014-03-31,47.99266479968421,22.080999353003403,34 +8313,SZABOLCS,2014-04-07,47.99266479968421,22.080999353003403,54 +8314,SZABOLCS,2014-04-14,47.99266479968421,22.080999353003403,25 +8315,SZABOLCS,2014-04-21,47.99266479968421,22.080999353003403,13 +8316,SZABOLCS,2014-04-28,47.99266479968421,22.080999353003403,8 +8317,SZABOLCS,2014-05-05,47.99266479968421,22.080999353003403,9 +8318,SZABOLCS,2014-05-12,47.99266479968421,22.080999353003403,56 +8319,SZABOLCS,2014-05-19,47.99266479968421,22.080999353003403,46 +8320,SZABOLCS,2014-05-26,47.99266479968421,22.080999353003403,63 +8321,SZABOLCS,2014-06-02,47.99266479968421,22.080999353003403,11 +8322,SZABOLCS,2014-06-09,47.99266479968421,22.080999353003403,27 +8323,SZABOLCS,2014-06-16,47.99266479968421,22.080999353003403,9 +8324,SZABOLCS,2014-06-23,47.99266479968421,22.080999353003403,33 +8325,SZABOLCS,2014-06-30,47.99266479968421,22.080999353003403,11 +8326,SZABOLCS,2014-07-07,47.99266479968421,22.080999353003403,13 +8327,SZABOLCS,2014-07-14,47.99266479968421,22.080999353003403,15 +8328,SZABOLCS,2014-07-21,47.99266479968421,22.080999353003403,4 +8329,SZABOLCS,2014-07-28,47.99266479968421,22.080999353003403,13 +8330,SZABOLCS,2014-08-04,47.99266479968421,22.080999353003403,12 +8331,SZABOLCS,2014-08-11,47.99266479968421,22.080999353003403,1 +8332,SZABOLCS,2014-08-18,47.99266479968421,22.080999353003403,1 +8333,SZABOLCS,2014-08-25,47.99266479968421,22.080999353003403,2 +8334,SZABOLCS,2014-09-01,47.99266479968421,22.080999353003403,0 +8335,SZABOLCS,2014-09-08,47.99266479968421,22.080999353003403,5 +8336,SZABOLCS,2014-09-15,47.99266479968421,22.080999353003403,0 +8337,SZABOLCS,2014-09-22,47.99266479968421,22.080999353003403,1 +8338,SZABOLCS,2014-09-29,47.99266479968421,22.080999353003403,6 +8339,SZABOLCS,2014-10-06,47.99266479968421,22.080999353003403,2 +8340,SZABOLCS,2014-10-13,47.99266479968421,22.080999353003403,3 +8341,SZABOLCS,2014-10-20,47.99266479968421,22.080999353003403,14 +8342,SZABOLCS,2014-10-27,47.99266479968421,22.080999353003403,7 +8343,SZABOLCS,2014-11-03,47.99266479968421,22.080999353003403,28 +8344,SZABOLCS,2014-11-10,47.99266479968421,22.080999353003403,15 +8345,SZABOLCS,2014-11-17,47.99266479968421,22.080999353003403,7 +8346,SZABOLCS,2014-11-24,47.99266479968421,22.080999353003403,0 +8347,SZABOLCS,2014-12-01,47.99266479968421,22.080999353003403,23 +8348,SZABOLCS,2014-12-08,47.99266479968421,22.080999353003403,5 +8349,SZABOLCS,2014-12-15,47.99266479968421,22.080999353003403,21 +8350,SZABOLCS,2014-12-22,47.99266479968421,22.080999353003403,17 +8351,SZABOLCS,2014-12-29,47.99266479968421,22.080999353003403,39 +9866,VESZPREM,2014-01-06,47.12794772944926,17.64488653121277,63 +9867,VESZPREM,2014-01-13,47.12794772944926,17.64488653121277,32 +9868,VESZPREM,2014-01-20,47.12794772944926,17.64488653121277,36 +9869,VESZPREM,2014-01-27,47.12794772944926,17.64488653121277,43 +9870,VESZPREM,2014-02-03,47.12794772944926,17.64488653121277,28 +9871,VESZPREM,2014-02-10,47.12794772944926,17.64488653121277,38 +9872,VESZPREM,2014-02-17,47.12794772944926,17.64488653121277,47 +9873,VESZPREM,2014-02-24,47.12794772944926,17.64488653121277,38 +9874,VESZPREM,2014-03-03,47.12794772944926,17.64488653121277,31 +9875,VESZPREM,2014-03-10,47.12794772944926,17.64488653121277,50 +9876,VESZPREM,2014-03-17,47.12794772944926,17.64488653121277,70 +9877,VESZPREM,2014-03-24,47.12794772944926,17.64488653121277,47 +9878,VESZPREM,2014-03-31,47.12794772944926,17.64488653121277,40 +9879,VESZPREM,2014-04-07,47.12794772944926,17.64488653121277,54 +9880,VESZPREM,2014-04-14,47.12794772944926,17.64488653121277,40 +9881,VESZPREM,2014-04-21,47.12794772944926,17.64488653121277,10 +9882,VESZPREM,2014-04-28,47.12794772944926,17.64488653121277,2 +9883,VESZPREM,2014-05-05,47.12794772944926,17.64488653121277,89 +9884,VESZPREM,2014-05-12,47.12794772944926,17.64488653121277,34 +9885,VESZPREM,2014-05-19,47.12794772944926,17.64488653121277,19 +9886,VESZPREM,2014-05-26,47.12794772944926,17.64488653121277,38 +9887,VESZPREM,2014-06-02,47.12794772944926,17.64488653121277,13 +9888,VESZPREM,2014-06-09,47.12794772944926,17.64488653121277,2 +9889,VESZPREM,2014-06-16,47.12794772944926,17.64488653121277,2 +9890,VESZPREM,2014-06-23,47.12794772944926,17.64488653121277,9 +9891,VESZPREM,2014-06-30,47.12794772944926,17.64488653121277,6 +9892,VESZPREM,2014-07-07,47.12794772944926,17.64488653121277,8 +9893,VESZPREM,2014-07-14,47.12794772944926,17.64488653121277,4 +9894,VESZPREM,2014-07-21,47.12794772944926,17.64488653121277,1 +9895,VESZPREM,2014-07-28,47.12794772944926,17.64488653121277,4 +9896,VESZPREM,2014-08-04,47.12794772944926,17.64488653121277,1 +9897,VESZPREM,2014-08-11,47.12794772944926,17.64488653121277,3 +9898,VESZPREM,2014-08-18,47.12794772944926,17.64488653121277,8 +9899,VESZPREM,2014-08-25,47.12794772944926,17.64488653121277,4 +9900,VESZPREM,2014-09-01,47.12794772944926,17.64488653121277,2 +9901,VESZPREM,2014-09-08,47.12794772944926,17.64488653121277,5 +9902,VESZPREM,2014-09-15,47.12794772944926,17.64488653121277,8 +9903,VESZPREM,2014-09-22,47.12794772944926,17.64488653121277,7 +9904,VESZPREM,2014-09-29,47.12794772944926,17.64488653121277,18 +9905,VESZPREM,2014-10-06,47.12794772944926,17.64488653121277,27 +9906,VESZPREM,2014-10-13,47.12794772944926,17.64488653121277,3 +9907,VESZPREM,2014-10-20,47.12794772944926,17.64488653121277,40 +9908,VESZPREM,2014-10-27,47.12794772944926,17.64488653121277,34 +9909,VESZPREM,2014-11-03,47.12794772944926,17.64488653121277,30 +9910,VESZPREM,2014-11-10,47.12794772944926,17.64488653121277,21 +9911,VESZPREM,2014-11-17,47.12794772944926,17.64488653121277,24 +9912,VESZPREM,2014-11-24,47.12794772944926,17.64488653121277,25 +9913,VESZPREM,2014-12-01,47.12794772944926,17.64488653121277,110 +9914,VESZPREM,2014-12-08,47.12794772944926,17.64488653121277,63 +9915,VESZPREM,2014-12-15,47.12794772944926,17.64488653121277,17 +9916,VESZPREM,2014-12-22,47.12794772944926,17.64488653121277,83 +9917,VESZPREM,2014-12-29,47.12794772944926,17.64488653121277,103 +10388,ZALA,2014-01-06,46.68723718859863,16.895032483431265,15 +10389,ZALA,2014-01-13,46.68723718859863,16.895032483431265,13 +10390,ZALA,2014-01-20,46.68723718859863,16.895032483431265,20 +10391,ZALA,2014-01-27,46.68723718859863,16.895032483431265,17 +10392,ZALA,2014-02-03,46.68723718859863,16.895032483431265,6 +10393,ZALA,2014-02-10,46.68723718859863,16.895032483431265,14 +10394,ZALA,2014-02-17,46.68723718859863,16.895032483431265,89 +10395,ZALA,2014-02-24,46.68723718859863,16.895032483431265,33 +10396,ZALA,2014-03-03,46.68723718859863,16.895032483431265,2 +10397,ZALA,2014-03-10,46.68723718859863,16.895032483431265,13 +10398,ZALA,2014-03-17,46.68723718859863,16.895032483431265,22 +10399,ZALA,2014-03-24,46.68723718859863,16.895032483431265,32 +10400,ZALA,2014-03-31,46.68723718859863,16.895032483431265,51 +10401,ZALA,2014-04-07,46.68723718859863,16.895032483431265,20 +10402,ZALA,2014-04-14,46.68723718859863,16.895032483431265,98 +10403,ZALA,2014-04-21,46.68723718859863,16.895032483431265,3 +10404,ZALA,2014-04-28,46.68723718859863,16.895032483431265,0 +10405,ZALA,2014-05-05,46.68723718859863,16.895032483431265,91 +10406,ZALA,2014-05-12,46.68723718859863,16.895032483431265,13 +10407,ZALA,2014-05-19,46.68723718859863,16.895032483431265,8 +10408,ZALA,2014-05-26,46.68723718859863,16.895032483431265,50 +10409,ZALA,2014-06-02,46.68723718859863,16.895032483431265,38 +10410,ZALA,2014-06-09,46.68723718859863,16.895032483431265,31 +10411,ZALA,2014-06-16,46.68723718859863,16.895032483431265,24 +10412,ZALA,2014-06-23,46.68723718859863,16.895032483431265,24 +10413,ZALA,2014-06-30,46.68723718859863,16.895032483431265,0 +10414,ZALA,2014-07-07,46.68723718859863,16.895032483431265,34 +10415,ZALA,2014-07-14,46.68723718859863,16.895032483431265,16 +10416,ZALA,2014-07-21,46.68723718859863,16.895032483431265,6 +10417,ZALA,2014-07-28,46.68723718859863,16.895032483431265,1 +10418,ZALA,2014-08-04,46.68723718859863,16.895032483431265,0 +10419,ZALA,2014-08-11,46.68723718859863,16.895032483431265,9 +10420,ZALA,2014-08-18,46.68723718859863,16.895032483431265,3 +10421,ZALA,2014-08-25,46.68723718859863,16.895032483431265,2 +10422,ZALA,2014-09-01,46.68723718859863,16.895032483431265,1 +10423,ZALA,2014-09-08,46.68723718859863,16.895032483431265,0 +10424,ZALA,2014-09-15,46.68723718859863,16.895032483431265,0 +10425,ZALA,2014-09-22,46.68723718859863,16.895032483431265,1 +10426,ZALA,2014-09-29,46.68723718859863,16.895032483431265,0 +10427,ZALA,2014-10-06,46.68723718859863,16.895032483431265,4 +10428,ZALA,2014-10-13,46.68723718859863,16.895032483431265,0 +10429,ZALA,2014-10-20,46.68723718859863,16.895032483431265,7 +10430,ZALA,2014-10-27,46.68723718859863,16.895032483431265,10 +10431,ZALA,2014-11-03,46.68723718859863,16.895032483431265,7 +10432,ZALA,2014-11-10,46.68723718859863,16.895032483431265,1 +10433,ZALA,2014-11-17,46.68723718859863,16.895032483431265,4 +10434,ZALA,2014-11-24,46.68723718859863,16.895032483431265,0 +10435,ZALA,2014-12-01,46.68723718859863,16.895032483431265,10 +10436,ZALA,2014-12-08,46.68723718859863,16.895032483431265,9 +10437,ZALA,2014-12-15,46.68723718859863,16.895032483431265,10 +10438,ZALA,2014-12-22,46.68723718859863,16.895032483431265,2 +10439,ZALA,2014-12-29,46.68723718859863,16.895032483431265,25 diff --git a/tests/test_data/chickenpox.8.train.csv b/tests/test_data/chickenpox.8.train.csv new file mode 100644 index 0000000..9712e05 --- /dev/null +++ b/tests/test_data/chickenpox.8.train.csv @@ -0,0 +1,101 @@ +,location,datetime,latitude,longitude,chickenpox +1044,BACS,2005-01-03,46.5684162771573,19.379845746575164,30 +1045,BACS,2005-01-10,46.5684162771573,19.379845746575164,30 +1046,BACS,2005-01-17,46.5684162771573,19.379845746575164,31 +1047,BACS,2005-01-24,46.5684162771573,19.379845746575164,43 +1048,BACS,2005-01-31,46.5684162771573,19.379845746575164,53 +1049,BACS,2005-02-07,46.5684162771573,19.379845746575164,77 +1050,BACS,2005-02-14,46.5684162771573,19.379845746575164,54 +1051,BACS,2005-02-21,46.5684162771573,19.379845746575164,64 +1052,BACS,2005-02-28,46.5684162771573,19.379845746575164,57 +1053,BACS,2005-03-07,46.5684162771573,19.379845746575164,129 +1054,BACS,2005-03-14,46.5684162771573,19.379845746575164,81 +1055,BACS,2005-03-21,46.5684162771573,19.379845746575164,51 +1056,BACS,2005-03-28,46.5684162771573,19.379845746575164,98 +1057,BACS,2005-04-04,46.5684162771573,19.379845746575164,59 +1058,BACS,2005-04-11,46.5684162771573,19.379845746575164,84 +1059,BACS,2005-04-18,46.5684162771573,19.379845746575164,62 +1060,BACS,2005-04-25,46.5684162771573,19.379845746575164,120 +1061,BACS,2005-05-02,46.5684162771573,19.379845746575164,81 +1062,BACS,2005-05-09,46.5684162771573,19.379845746575164,103 +1063,BACS,2005-05-16,46.5684162771573,19.379845746575164,86 +1064,BACS,2005-05-23,46.5684162771573,19.379845746575164,125 +1065,BACS,2005-05-30,46.5684162771573,19.379845746575164,145 +1066,BACS,2005-06-06,46.5684162771573,19.379845746575164,129 +1067,BACS,2005-06-13,46.5684162771573,19.379845746575164,94 +1068,BACS,2005-06-20,46.5684162771573,19.379845746575164,94 +1069,BACS,2005-06-27,46.5684162771573,19.379845746575164,153 +1070,BACS,2005-07-04,46.5684162771573,19.379845746575164,38 +1071,BACS,2005-07-11,46.5684162771573,19.379845746575164,67 +1072,BACS,2005-07-18,46.5684162771573,19.379845746575164,11 +1073,BACS,2005-07-25,46.5684162771573,19.379845746575164,7 +1074,BACS,2005-08-01,46.5684162771573,19.379845746575164,21 +1075,BACS,2005-08-08,46.5684162771573,19.379845746575164,6 +1076,BACS,2005-08-15,46.5684162771573,19.379845746575164,1 +1077,BACS,2005-08-22,46.5684162771573,19.379845746575164,0 +1078,BACS,2005-08-29,46.5684162771573,19.379845746575164,2 +1079,BACS,2005-09-05,46.5684162771573,19.379845746575164,9 +1080,BACS,2005-09-12,46.5684162771573,19.379845746575164,1 +1081,BACS,2005-09-19,46.5684162771573,19.379845746575164,6 +1082,BACS,2005-09-26,46.5684162771573,19.379845746575164,3 +1083,BACS,2005-10-03,46.5684162771573,19.379845746575164,6 +1084,BACS,2005-10-10,46.5684162771573,19.379845746575164,5 +1085,BACS,2005-10-17,46.5684162771573,19.379845746575164,15 +1086,BACS,2005-10-24,46.5684162771573,19.379845746575164,26 +1087,BACS,2005-10-31,46.5684162771573,19.379845746575164,33 +1088,BACS,2005-11-07,46.5684162771573,19.379845746575164,35 +1089,BACS,2005-11-14,46.5684162771573,19.379845746575164,58 +1090,BACS,2005-11-21,46.5684162771573,19.379845746575164,36 +1091,BACS,2005-11-28,46.5684162771573,19.379845746575164,65 +1092,BACS,2005-12-05,46.5684162771573,19.379845746575164,40 +1093,BACS,2005-12-12,46.5684162771573,19.379845746575164,77 +1094,BACS,2005-12-19,46.5684162771573,19.379845746575164,44 +1095,BACS,2005-12-26,46.5684162771573,19.379845746575164,21 +1096,BACS,2006-01-02,46.5684162771573,19.379845746575164,60 +1097,BACS,2006-01-09,46.5684162771573,19.379845746575164,46 +1098,BACS,2006-01-16,46.5684162771573,19.379845746575164,29 +1099,BACS,2006-01-23,46.5684162771573,19.379845746575164,41 +1100,BACS,2006-01-30,46.5684162771573,19.379845746575164,31 +1101,BACS,2006-02-06,46.5684162771573,19.379845746575164,42 +1102,BACS,2006-02-13,46.5684162771573,19.379845746575164,70 +1103,BACS,2006-02-20,46.5684162771573,19.379845746575164,48 +1104,BACS,2006-02-27,46.5684162771573,19.379845746575164,52 +1105,BACS,2006-03-06,46.5684162771573,19.379845746575164,53 +1106,BACS,2006-03-13,46.5684162771573,19.379845746575164,59 +1107,BACS,2006-03-20,46.5684162771573,19.379845746575164,109 +1108,BACS,2006-03-27,46.5684162771573,19.379845746575164,69 +1109,BACS,2006-04-03,46.5684162771573,19.379845746575164,97 +1110,BACS,2006-04-10,46.5684162771573,19.379845746575164,55 +1111,BACS,2006-04-17,46.5684162771573,19.379845746575164,75 +1112,BACS,2006-04-24,46.5684162771573,19.379845746575164,97 +1113,BACS,2006-05-01,46.5684162771573,19.379845746575164,86 +1114,BACS,2006-05-08,46.5684162771573,19.379845746575164,59 +1115,BACS,2006-05-15,46.5684162771573,19.379845746575164,49 +1116,BACS,2006-05-22,46.5684162771573,19.379845746575164,34 +1117,BACS,2006-05-29,46.5684162771573,19.379845746575164,118 +1118,BACS,2006-06-05,46.5684162771573,19.379845746575164,55 +1119,BACS,2006-06-12,46.5684162771573,19.379845746575164,80 +1120,BACS,2006-06-19,46.5684162771573,19.379845746575164,65 +1121,BACS,2006-06-26,46.5684162771573,19.379845746575164,56 +1122,BACS,2006-07-03,46.5684162771573,19.379845746575164,25 +1123,BACS,2006-07-10,46.5684162771573,19.379845746575164,25 +1124,BACS,2006-07-17,46.5684162771573,19.379845746575164,16 +1125,BACS,2006-07-24,46.5684162771573,19.379845746575164,7 +1126,BACS,2006-07-31,46.5684162771573,19.379845746575164,3 +1127,BACS,2006-08-07,46.5684162771573,19.379845746575164,1 +1128,BACS,2006-08-14,46.5684162771573,19.379845746575164,4 +1129,BACS,2006-08-21,46.5684162771573,19.379845746575164,0 +1130,BACS,2006-08-28,46.5684162771573,19.379845746575164,0 +1131,BACS,2006-09-04,46.5684162771573,19.379845746575164,2 +1132,BACS,2006-09-11,46.5684162771573,19.379845746575164,1 +1133,BACS,2006-09-18,46.5684162771573,19.379845746575164,0 +1134,BACS,2006-09-25,46.5684162771573,19.379845746575164,4 +1135,BACS,2006-10-02,46.5684162771573,19.379845746575164,3 +1136,BACS,2006-10-09,46.5684162771573,19.379845746575164,2 +1137,BACS,2006-10-16,46.5684162771573,19.379845746575164,9 +1138,BACS,2006-10-23,46.5684162771573,19.379845746575164,10 +1139,BACS,2006-10-30,46.5684162771573,19.379845746575164,18 +1140,BACS,2006-11-06,46.5684162771573,19.379845746575164,19 +1141,BACS,2006-11-13,46.5684162771573,19.379845746575164,39 +1142,BACS,2006-11-20,46.5684162771573,19.379845746575164,14 +1143,BACS,2006-11-27,46.5684162771573,19.379845746575164,26 diff --git a/tests/evaluate_test.py b/tests/test_evaluate_mini.py similarity index 60% rename from tests/evaluate_test.py rename to tests/test_evaluate_mini.py index a895648..6bac6a7 100644 --- a/tests/evaluate_test.py +++ b/tests/test_evaluate_mini.py @@ -26,21 +26,15 @@ import pandas as pd import pytest -_DIR = os.path.dirname(os.path.abspath(__file__)) + +DIR = os.path.dirname(os.path.abspath(__file__)) @pytest.fixture(name='golden_data_getter') def fixture_golden_data_getter(): def data_getter(fname): - try: - data = pd.read_csv( - io.BytesIO(pkgutil.get_data('bayesnf.tests', f'test_data/{fname}'))) - # Training data is missing and must be added. - except FileNotFoundError as exc: - raise FileNotFoundError( - f'Expected to see {fname} in {bayesnf.__file__}/tests/test_data' - ) from exc - return data + data_path = os.path.join(DIR, 'test_data', fname) + return pd.read_csv(data_path, index_col=0) return data_getter @@ -49,9 +43,9 @@ def run_objective(objective, inference_config): series_id = '8' output_dir = tempfile.mkdtemp() fname = f'bnf-{objective}.chickenpox.8.pred.csv' - _ = evaluate.run_experiment( + evaluate.run_experiment( dataset=dataset, - data_root=os.path.join(_DIR, 'test_data'), + data_root=os.path.join(DIR, 'test_data'), series_id=series_id, output_dir=output_dir, objective=objective, @@ -60,37 +54,40 @@ def run_objective(objective, inference_config): inference_config=inference_config, seed=jax.random.PRNGKey(0), ) - return pd.read_csv(os.path.join(output_dir, fname)) + return pd.read_csv(os.path.join(output_dir, fname), index_col=0) -@pytest.mark.skip('Too slow.') -def test_map(golden_data_getter): +@pytest.mark.skip(reason='Github server version issue.') +def test_map_mini(golden_data_getter): inference_config = { - 'num_particles': 64, - 'num_epochs': 100, + 'num_particles': 4, + 'num_epochs': 5, 'learning_rate': 0.005} new_data = run_objective('map', inference_config) - assert new_data.equals(golden_data_getter('bnf-map.chickenpox.8.pred.csv')) + old_data = golden_data_getter('bnf-map.chickenpox.8.mini.pred.csv') + assert new_data.equals(old_data) -@pytest.mark.skip('Too slow.') -def test_mle(golden_data_getter): +@pytest.mark.skip(reason='Github server version issue.') +def test_mle_mini(golden_data_getter): inference_config = { - 'num_particles': 64, - 'num_epochs': 100, + 'num_particles': 4, + 'num_epochs': 5, 'learning_rate': 0.005} new_data = run_objective('mle', inference_config) - assert new_data.equals(golden_data_getter('bnf-mle.chickenpox.8.pred.csv')) + old_data = golden_data_getter('bnf-mle.chickenpox.8.mini.pred.csv') + assert new_data.equals(old_data) -@pytest.mark.skip('Too slow.') -def test_vi(golden_data_getter): +@pytest.mark.skip(reason='Github server version issue.') +def test_vi_mini(golden_data_getter): inference_config = { - 'batch_size': 511, + 'batch_size': None, 'kl_weight': 0.1, 'learning_rate': 0.01, - 'num_epochs': 100, - 'num_particles': 64, - 'sample_size': 5} + 'num_epochs': 2, + 'num_particles': 1, + 'sample_size_divergence': 5} new_data = run_objective('vi', inference_config) - assert new_data.equals(golden_data_getter('bnf-vi.chickenpox.8.pred.csv')) + old_data = golden_data_getter('bnf-vi.chickenpox.8.mini.pred.csv') + assert new_data.equals(old_data) diff --git a/tests/test_spatiotemporal.py b/tests/test_spatiotemporal.py new file mode 100644 index 0000000..5382c30 --- /dev/null +++ b/tests/test_spatiotemporal.py @@ -0,0 +1,114 @@ +# Copyright 2024 The bayesnf Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tests for spatiotemporal.py.""" +import numpy as np +import pytest + +from bayesnf import spatiotemporal + + +@pytest.mark.parametrize( + "seasonality, freq, expected", + [ + ("Y", "Y", 1), + ("Q", "Q", 1), + ("Y", "Q", 4), + ("M", "H", 730.5), + ("Q", "M", 3), + ("Y", "M", 12), + ("M", "D", 30.4375), + ("min", "S", 60), + ("H", "S", 3600), + ("D", "S", 86400), + ("M", "S", 2629800), + ("Q", "S", 7889400), + ("Y", "S", 31557600), + ], +) +def test_seasonality_to_float(seasonality, freq, expected): + assert spatiotemporal.seasonality_to_float(seasonality, freq) == expected + + +def test_seasonalities_to_array(): + periods = spatiotemporal.seasonalities_to_array(["D", "W", "M"], "H") + np.testing.assert_allclose(periods, np.array([24, 168, 730.5])) + + +@pytest.mark.parametrize('p, h', [([], []), ([10, 15], [8,6])]) +def test_get_seasonality_periods_index(p, h): + # Harmonics in discrete time are identical to inputs. + model = spatiotemporal.BayesianNeuralFieldMAP( + freq='D', + seasonality_periods=p, + num_seasonal_harmonics=h, + feature_cols=['t'], + target_col='x', + timetype='index',) + assert np.all(model._get_seasonality_periods() == p) + assert np.all(model._get_num_seasonal_harmonics() == h) + + +@pytest.mark.parametrize('p, h', [([], []), ([10, 12, .25], [.5, .5, .125])]) +def test_get_seasonality_periods_float(p, h): + # Harmonics in continuous time are min(.5, p/2). + model = spatiotemporal.BayesianNeuralFieldMAP( + seasonality_periods=p, + feature_cols=['t'], + target_col='x', + timetype='float',) + assert np.all(model._get_seasonality_periods() == p) + assert np.all(model._get_num_seasonal_harmonics() == h) + + +def test_invalid_frequency(): + # timetype == 'index' requires a frequency. + model = spatiotemporal.BayesianNeuralFieldMAP( + feature_cols=['t'], + target_col='x', + timetype='index',) + with pytest.raises(ValueError): + model._get_seasonality_periods() + + # timetype == 'index' does not allow a frequency. + model = spatiotemporal.BayesianNeuralFieldMAP( + freq='M', + feature_cols=['t'], + target_col='x', + timetype='float',) + with pytest.raises(ValueError): + model._get_seasonality_periods() + + +def test_invalid_seasonality_period(): + # timetype == 'float' does not allow string periods. + model = spatiotemporal.BayesianNeuralFieldMAP( + seasonality_periods=['W'], + feature_cols=['t'], + target_col='x', + timetype='float',) + with pytest.raises(ValueError): + print(model._get_seasonality_periods()) + + +def test_invalid_num_seasonal_harmonics(): + # timetype == 'float' does not allow num_seasonal_harmonics. + model = spatiotemporal.BayesianNeuralFieldMAP( + seasonality_periods=[1, 5], + num_seasonal_harmonics=[.5, 1], + feature_cols=['t'], + target_col='x', + timetype='float',) + with pytest.raises(ValueError): + model._get_num_seasonal_harmonics()