def test_if_fitted(data_random): x = data_random model = Koopman() with pytest.raises(NotFittedError): model.predict(x) with pytest.raises(NotFittedError): model.simulate(x) with pytest.raises(NotFittedError): model.koopman_matrix with pytest.raises(NotFittedError): model._step(x)
def test_observables_integration(data_random, observables): x = data_random model = Koopman(observables=observables).fit(x) check_is_fitted(model) y = model.predict(x) assert y.shape[1] == x.shape[1]
def test_predict_shape(data_random): x = data_random model = Koopman().fit(x) assert x.shape == model.predict(x).shape