def test_estimate_rename_ds(self): p = SkProphet('date', True, [], {}) X = self._get_dataset() X = X.rename({'ds': 'date'}, axis=1) y_pred = p.fit(X).predict(X) self.assertIsInstance(y_pred, np.ndarray)
def test_estimate(self): p = SkProphet('ds', True, [], {}) X = self._get_dataset() y_pred = p.fit(X).predict(X) self.assertIsInstance(y_pred, np.ndarray)
def test_estimate_full_output(self): p = SkProphet('ds', False, [], {}) X = self._get_dataset() y_pred = p.fit(X).predict(X) self.assertIsInstance(y_pred, pd.DataFrame)
def test_fit_X_not_dataframe_error(self): p = SkProphet('ds', True, [], {}) X = [[1, 2], [3, 4]] with self.assertRaises(TypeError): p.fit(X)
def test_fit_y_list(self): p = SkProphet('date', True, [], {}) X = self._get_dataset() p2 = p.fit(X[['ds', 'x']], X.y.values.tolist()) self.assertEqual(p, p2)
def test_fit_y_str(self): p = SkProphet('date', True, [], {}) X = self._get_dataset() X = X.rename({'y': 'mica'}, axis=1) p2 = p.fit(X, 'mica') self.assertEqual(p, p2)
def test_fit_X_only_rename_ds(self): p = SkProphet('date', True, [], {}) X = self._get_dataset() X = X.rename({'ds': 'date'}, axis=1) p2 = p.fit(X) self.assertEqual(p, p2)
def test_fit_X_only(self): p = SkProphet('ds', True, [], {}) X = self._get_dataset() p2 = p.fit(X) self.assertEqual(p, p2)