Example #1
0
def test_embedder_resample():
    embedder = TakensEmbedding(parameters_type='fixed',
                               time_delay=3,
                               dimension=2,
                               stride=3)
    embedder.fit(signal)
    y_resampled = embedder.resample(y)
    assert_almost_equal(y_resampled, y[np.arange(4, 20, 3)])
Example #2
0
def test_takens_embedding_validation(params):
    if "flatten" not in params and "ensure_last_value" not in params:
        exception_type = ValueError
    else:
        exception_type = TypeError
    with pytest.raises(exception_type):
        TE = TakensEmbedding(**params)
        TE.fit(signal[None, :])
Example #3
0
def test_embedder_params():
    parameters_type = 'not_defined'
    embedder = TakensEmbedding(parameters_type=parameters_type)
    with pytest.raises(ValueError):
        embedder.fit(signal)