Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assemble_featureset does not take channels into consideration #280

Open
stefanv opened this issue Dec 10, 2018 · 0 comments
Open

assemble_featureset does not take channels into consideration #280

stefanv opened this issue Dec 10, 2018 · 0 comments

Comments

@stefanv
Copy link
Contributor

stefanv commented Dec 10, 2018

(Thanks to @sarajamal57 for finding this issue.)

Here, we featurize two time series, but with different channels. When using assemble_featureset to join them, the channel information is ignored, and unrelated features are joined.

from cesium import time_series, featurize, features
import numpy as np
import copy

channels = ['g', 'r', 'i']
t = np.linspace(0, 2*np.pi, 200)
m = np.repeat(np.sin(t**2)[None, :], len(channels), axis=0) * np.array([1, 2, 3])[:, None]
e = np.ones(t.shape[0])

ts = time_series.TimeSeries(t, m, e, channel_names=channels)
feats = featurize.featurize_single_ts(ts, [features.GENERAL_FEATS[0]])

m2 = np.vstack((m[0], m[2]))
ts2 = time_series.TimeSeries(t, m2, e, channel_names=[channels[0], channels[2]])
feats2 = featurize.featurize_single_ts(ts2, [features.GENERAL_FEATS[0]])

df = featurize.assemble_featureset([feats, feats2], [ts, ts2])

df is:

feature amplitude
channel         0         1         2
NaN      0.999894  1.999789  2.999683
NaN      0.999894  2.999683       NaN

Instead of

feature amplitude
channel         0         1         2
NaN      0.999894  1.999789  2.999683
NaN      0.999894  NaN       2.999683
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant