Exemplo n.º 1
0
def test_featurize_files_function(tmpdir):
    """Test featurize function for on-disk time series"""
    with sample_ts_files(size=4, labels=['A', 'B']) as ts_paths:
        fset, labels = featurize.featurize_ts_files(
            ts_paths, features_to_use=["std_err"], scheduler=dask.get)
    assert "std_err" in fset
    assert fset.shape == (4, 1)
    npt.assert_array_equal(labels, ['A', 'B', 'A', 'B'])
Exemplo n.º 2
0
def test_featurize_files_function(tmpdir):
    """Test featurize function for on-disk time series"""
    with sample_ts_files(size=4) as ts_paths:
        fset = featurize.featurize_ts_files(ts_paths,
                                            features_to_use=["std_err"],
                                            scheduler=get_sync)
    assert "std_err" in fset
    assert fset.shape == (4, 1)
Exemplo n.º 3
0
def test_featurize_files_function(tmpdir):
    """Test featurize function for on-disk time series"""
    with sample_ts_files(size=4, labels=['A', 'B']) as ts_paths:
        fset, labels = featurize.featurize_ts_files(ts_paths,
                                                    features_to_use=["std_err"],
                                                    scheduler=dask.get)
    assert "std_err" in fset
    assert fset.shape == (4, 1)
    npt.assert_array_equal(labels, ['A', 'B', 'A', 'B'])
Exemplo n.º 4
0
def test_featurize_files_function_regression_data():
    """Test featurize function for on-disk time series - regression data"""
    fset_path = pjoin(TEMP_DIR, 'output_featureset.nc')
    with sample_ts_files(size=4, targets=[1.0, 2.0]) as ts_paths:
        fset = featurize.featurize_ts_files(ts_paths,
                                            features_to_use=["std_err"],
                                            output_path=fset_path,
                                            scheduler=get_sync)
    assert("std_err" in fset.data_vars)
    assert(all(target in [1.0, 2.0] for target in fset['target'].values))
Exemplo n.º 5
0
def test_featurize_files_function():
    """Test featurize function for on-disk time series"""
    fset_path = pjoin(TEMP_DIR, 'output_featureset.nc')
    with sample_ts_files(size=4, targets=['class1', 'class2']) as ts_paths:
        fset = featurize.featurize_ts_files(ts_paths,
                                            features_to_use=["std_err"],
                                            output_path=fset_path,
                                            scheduler=get_sync)
    assert("std_err" in fset.data_vars)
    assert(all(class_name in ['class1', 'class2']
               for class_name in fset['target'].values))