def test_not_fitted():
    dst = ForgetDimension()
    dsc = Scaler()

    with pytest.raises(NotFittedError):
        dst.transform(X_1)

    with pytest.raises(NotFittedError):
        dsc.transform(X_1)

    with pytest.raises(NotFittedError):
        dsc.inverse_transform(X_1)
Пример #2
0
def test_sc_transform_shape(X, metric, metric_params):
    sc = Scaler(metric=metric, metric_params=metric_params, n_jobs=1)
    X_res = sc.fit_transform(X)
    assert X_res.shape == X.shape

    X_inv_res = sc.inverse_transform(X_res)
    assert_almost_equal(X_inv_res, X)