ykang / gratis

GRATIS: GeneRAting TIme Series with diverse and controllable characteristics
https://github.com/ykang/gratis
GNU General Public License v3.0
76 stars 29 forks source link

Error in {: task 2 failed - "object 'x_acf1' of mode 'function' was not found" #3

Closed alexhallam closed 6 years ago

alexhallam commented 6 years ago

Sorry, if I am misunderstanding this package. My end goal is to make many simulations of many time series. To test this I used tsfeatures on just one series. In the code below I am passing the results from tsfeatures to tsgeneration::generate_ts_with_target. The problem is I am getting the following error

> Error in {: task 2 failed - "object 'x_acf1' of mode 'function' was not found"

tsgeneration::generate_ts_with_target(n = 1, ts.length = 60, freq = 7, seasonal = 1,
                        features = c('x_acf1', 'x_acf10','diff1_acf1','diff1_acf10',
                                     'diff2_acf1','diff2_acf10','seas_acf1','entropy',
                                     'lumpiness','flat_spots','crossing_points',
                                     'nperiods','seasonal_period','trend','spike','linearity',
                                     'curvature','e_acf1','e_acf10','seasonal_strength',
                                     'peak','trough','max_kl_shift','time_kl_shift',
                                     'mean','var','max_level_shift','time_level_shift',
                                     'max_var_shift','time_var_shift'),
                        selected.features = c('x_acf1', 'x_acf10','diff1_acf1','diff1_acf10',
                                              'diff2_acf1','diff2_acf10','seas_acf1','entropy',
                                              'lumpiness','flat_spots','crossing_points',
                                              'nperiods','seasonal_period','trend','spike','linearity',
                                              'curvature','e_acf1','e_acf10','seasonal_strength',
                                              'peak','trough','max_kl_shift','time_kl_shift',
                                              'mean','var','max_level_shift','time_level_shift',
                                              'max_var_shift','time_var_shift'),
                        target = c(0.336, 0.985,-0.1257,0.428,-0.486,0.458,0.403,
                                   0.913,1.0324,3,20,1,7,0.237,5.14e-04,0.772,
                                   1.47,-0.0761,0.068,0.631,1,3,0.208,42,3802,400176,0.464,
                                   38,0.519,37))
#> Error in {: task 2 failed - "object 'x_acf1' of mode 'function' was not found"

Created on 2018-10-05 by the reprex package (v0.2.0).

ykang commented 6 years ago

The argument features should be a vector of function names. These functions are operations of time series features. x_acf1 comes from the outputs of the acf_features function in the package tsfeatures. Also, the stl_features function in the package tsfeatures outputs a vector of time series feature including trend, linearity, seasonal_strength, etc. In your case, the argument features can be set as c('stl_features', 'acf_features', 'entropy', 'lumpiness', 'flat_spots', 'crossing_points', 'max_kl_shift', 'max_level_shift', 'max_var_shift', 'mean', 'var').

alexhallam commented 6 years ago

That makes sense. Thanks!

waterwheel31 commented 5 years ago

I am trying to find the list of features and selected features. Where I can find this? I could not find that on the repo, if I am not missing.