def test_get_feature_names_len(data_lorenz): x, t = data_lorenz model = SINDy() with pytest.raises(NotFittedError): model.get_feature_names() model.fit(x, t) # Assumes default library is polynomial features of degree 2 assert len(model.get_feature_names()) == 10
def test_not_fitted(data_1d): x, t = data_1d model = SINDy() with pytest.raises(NotFittedError): model.predict(x) with pytest.raises(NotFittedError): model.get_feature_names() with pytest.raises(NotFittedError): model.coefficients() with pytest.raises(NotFittedError): model.equations() with pytest.raises(NotFittedError): model.simulate(x[0], t)
def test_get_feature_names_len(data_lorenz_c_1d): x, t, u, _ = data_lorenz_c_1d model = SINDy() model.fit(x, u=u, t=t) # Assumes default library is polynomial features of degree 2 assert len(model.get_feature_names()) == 15