Add test and fix for issue #891

This commit is contained in:
Florian Roessler 2019-08-29 14:58:31 +02:00 committed by Ben Letham
parent 190d3239fd
commit 5bc6565c11
2 changed files with 9 additions and 1 deletions

View file

@ -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)

View file

@ -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')