mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-07-29 20:14:08 +00:00
Add test and fix for issue #891
This commit is contained in:
parent
190d3239fd
commit
5bc6565c11
2 changed files with 9 additions and 1 deletions
|
|
@ -262,8 +262,8 @@ class Prophet(object):
|
|||
raise ValueError('Found non-boolean in column ' + condition_name)
|
||||
df[condition_name] = df[condition_name].astype('bool')
|
||||
|
||||
df = df.reset_index(drop=True)
|
||||
df = df.sort_values('ds')
|
||||
df.reset_index(inplace=True, drop=True)
|
||||
|
||||
self.initialize_scales(initialize_scales, df)
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,14 @@ class TestProphet(TestCase):
|
|||
|
||||
self.assertTrue('y_scaled' in history)
|
||||
self.assertEqual(history['y_scaled'].max(), 1.0)
|
||||
|
||||
def test_setup_dataframe_ds_column(self):
|
||||
"Test case where 'ds' exists as an index name and column"
|
||||
df = DATA.copy()
|
||||
df.index = df.loc[:, 'ds']
|
||||
m = Prophet()
|
||||
m.fit(df)
|
||||
|
||||
|
||||
def test_logistic_floor(self):
|
||||
m = Prophet(growth='logistic')
|
||||
|
|
|
|||
Loading…
Reference in a new issue