Esempio n. 1
0
def test_benchmark_model_predict(tiny_files_structure):
    bm_model = BenchmarkModel()
    x_train = np.ones((10, 5))
    y_train = (pd.read_csv(tiny_files_structure.raw.y_train,
                           index_col=0).fillna(0).values)
    bm_model.fit(x_train, y_train)
    y_pred = bm_model.predict(x_train)

    assert y_pred.shape == y_train.shape
    assert np.isclose(y_pred.mean(axis=0),
                      bm_model.params["mean_values"]).all()
Esempio n. 2
0
def test_benchmark_model_fit(tiny_files_structure):
    bm_model = BenchmarkModel()
    y_train = pd.read_csv(tiny_files_structure.raw.y_train, index_col=0)
    bm_model.fit(pd.DataFrame([0]).values, y_train)
    assert bm_model.params["mean_values"].all()
    assert bm_model.params["mean_values"].shape == (5, )