コード例 #1
0
    def test_correct_fit_date(self, X_y):
        base_model = LinearRegression()
        feature_splitter = FeatureSplitter()
        x, y = X_y[0], X_y[1]
        x_train, y_train, x_test, y_test = feature_splitter.transform(x, y)

        gar_no_feedforward = GAR(estimator=base_model)

        gar_no_feedforward.fit(x_train, y_train)

        predictions = gar_no_feedforward.predict(x_test)

        assert len(predictions) == len(x_test)
        np.testing.assert_array_equal(predictions.index, x_test.index)

        gar_with_feedforward = GARFF(estimator=base_model)

        gar_with_feedforward.fit(x_train, y_train)

        predictions = gar_with_feedforward.predict(x_test)

        assert len(predictions) == len(x_test)
        np.testing.assert_array_equal(predictions.index, x_test.index)
コード例 #2
0
ファイル: base.py プロジェクト: yikuide/giotto-time
 def _split_train_test(self, X: pd.DataFrame, y: pd.DataFrame):
     feature_splitter = FeatureSplitter()
     return feature_splitter.transform(X, y)
コード例 #3
0
 def _split_train_test(self, X, y):
     feature_splitter = FeatureSplitter()
     return feature_splitter.transform(X, y)