mbinkowski / nntimeseries

208 stars 66 forks source link

Questions about `LSTM2.py` #6

Open smallGum opened 5 years ago

smallGum commented 5 years ago

Hello,

Thanks for making your code public on Github. I was wondering if there was something wrong with param_dict you defined in LSTM2.py:

# dictionary of hyperparameter lists across which the grid search will run
param_dict = dict(
    #input parameters
    ......
    target_cols=[1],    # 'default' or list of names of columns to predict  
    ......
)

When I run your code, I got following mistakes:

using <class '__main__.LSTMmodel'> to build the model
using <class 'nnts.artificial.ArtificialGenerator'> to draw samples
Traceback (most recent call last):
  File "LSTM2.py", line 106, in <module>
    runner.run(LSTMmodel, log=log, limit=1)
  File "/Users/jack-cheng/Desktop/毕业设计/时间序列/SOCNN/nntimeseries/nnts/utils.py", line 128, in run
    model = model_class(data, params, os.path.join(WDIR, 'tensorboard'))
  File "/Users/jack-cheng/Desktop/毕业设计/时间序列/SOCNN/nntimeseries/nnts/utils.py", line 228, in __init__
    self.idim, self.odim = self.G.get_dims(cols=self.target_cols)   
  File "/Users/jack-cheng/Desktop/毕业设计/时间序列/SOCNN/nntimeseries/nnts/utils.py", line 365, in get_dims
    return self.get_dim(), len(self.get_target_col_ids(cols=cols))
  File "/Users/jack-cheng/Desktop/毕业设计/时间序列/SOCNN/nntimeseries/nnts/artificial.py", line 223, in get_target_col_ids
    assert hasattr(cols, '__iter__')
AssertionError

When I set target_cols=['default'], it worked and produced result similar to that you proposed in the paper. Could you please tell me what do you mean by setting target_cols=[1]?