-
Notifications
You must be signed in to change notification settings - Fork 44
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
Feature calculation is stucked (issue on Multiprocessing lib & Windows) #35
Comments
I'm having a similar issue. If I understand correctly, the def number_zeros(x, freq):
number = (x == 0).sum()
return {'number_zeros': number}
features = tsf.tsfeatures(data, features=[tsf.stl_features, number_zeros], dict_freqs={'MS': 12,}) Result is wrong because
Currently I'm having to do this instead: features = pd.merge(
data[["unique_id", "y"]].query("y>0").groupby("unique_id").count().reset_index(),
features,
how="left",
on="unique_id",
)
features.rename(columns={"y": "series_length"}, inplace=True) |
I think that the issue is that the |
actually issue (infinite loop ) is coming from multiprocessing => I think tsfeatures cannot be used with Windows and Jupyter notebook / IPython |
I have used t features in Jupiter notebooks. Did not have any issues. |
ok @ngupta23 but what is your OS ? |
I used it in WSL |
Windows subsystem for linux is not pure windows. ;) |
What happened + What you expected to happen
As your doc mentions it should be possible to add custom feature (I copy paste your function from README)
=> but nothing happens after a few longs minutes
Could you please check ?
Versions / Dependencies
0.4.2 (the last one)
Reproduction script
import pandas as pd
import numpy as np
from tsfeatures import tsfeatures
periods = 24
ind = pd.date_range(start='2021-01-01', periods=periods, freq='MS')
vals = np.random.rand(periods)
df = pd.DataFrame({'ds':ind, 'y':vals, 'unique_id':1})
def number_zeros(x, freq):
number = (x == 0).sum()
return {'number_zeros': number}
features_df = tsfeatures(df,freq=12, features=[number_zeros])
features_df
Issue Severity
None
The text was updated successfully, but these errors were encountered: