DataCanvasIO / HyperTS

A Full-Pipeline Automated Time Series (AutoTS) Analysis Toolkit.
https://hyperts.readthedocs.io
Apache License 2.0
257 stars 27 forks source link

关于 HybirdRNN 解决多变量时序分类的问题 #67

Closed Shanshan122 closed 1 year ago

Shanshan122 commented 1 year ago

在自定义搜索空间时,代码报错。自定义如下:

`df = load_basic_motions() train_df, test_df = train_test_split(df, test_size=0.2) from hyperts.framework.search_space.macro_search_space import DLClassRegressSearchSpace custom_search_space = DLClassRegressSearchSpace(enable_hybirdrnn=True, enable_lstnet=False, enable_inceptiontime=False,
hybirdrnn_init_kwargs={ 'task': 'classification' } )

experiment = make_experiment(train_data=train_df.copy(), task='classification', mode='dl', search_space=custom_search_space, target='target')`

报错如下: 11-01 16:03:29 E hypernets.m.hyper_model.py 83 - run_trail failed! trail_no=2 11-01 16:03:29 E hypernets.m.hyper_model.py 85 - Traceback (most recent call last): File "E:\Anaconda\install\lib\site-packages\hypernets\model\hyper_model.py", line 78, in _run_trial estimator.fit(X, y, fit_kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\hyper_ts.py", line 262, in fit self.model.fit(X_transformed, y, kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\wrappers\dl_wrappers.py", line 71, in fit self.model.fit(X, y, **fit_kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\dl_base.py", line 384, in fit X, y = self._preprocessor(X, y) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\dl_base.py", line 827, in _preprocessor self.meta = MetaTSCprocessor(task=self.task) TypeError: init() got an unexpected keyword argument 'task'

zhangxjohn commented 1 year ago

hybirdrnn_init_kwargs={'task': 'classification' } 不用传task参数。

Shanshan122 commented 1 year ago

hybirdrnn_init_kwargs={'task': 'classification' } 不用传task参数。

试了一下,还是报错: custom_search_space = DLClassRegressSearchSpace(enable_hybirdrnn=True, enable_lstnet=False, enable_inceptiontime=False,
hybirdrnn_init_kwargs={ 'learning_rate':0.01, 'reducelr_patience': 5, 'earlystop_patience': 15, } )

experiment = make_experiment(train_data=train_df.copy(), task='classification', mode='dl', search_space=custom_search_space, target='target')

zhangxjohn commented 1 year ago

现在是什么错误?

Shanshan122 commented 1 year ago

现在是什么错误?

11-02 09:38:09 E hypernets.m.hyper_model.py 83 - run_trail failed! trail_no=1 11-02 09:38:09 E hypernets.m.hyper_model.py 85 - Traceback (most recent call last): File "E:\Anaconda\install\lib\site-packages\hypernets\model\hyper_model.py", line 78, in _run_trial estimator.fit(X, y, fit_kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\hyper_ts.py", line 262, in fit self.model.fit(X_transformed, y, kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\wrappers\dl_wrappers.py", line 71, in fit self.model.fit(X, y, **fit_kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\dl_base.py", line 384, in fit X, y = self._preprocessor(X, y) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\dl_base.py", line 827, in _preprocessor self.meta = MetaTSCprocessor(task=self.task) TypeError: init() got an unexpected keyword argument 'task'

11-02 09:38:10 E hypernets.m.hyper_model.py 83 - run_trail failed! trail_no=2 11-02 09:38:10 E hypernets.m.hyper_model.py 85 - Traceback (most recent call last): File "E:\Anaconda\install\lib\site-packages\hypernets\model\hyper_model.py", line 78, in _run_trial estimator.fit(X, y, fit_kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\hyper_ts.py", line 262, in fit self.model.fit(X_transformed, y, kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\wrappers\dl_wrappers.py", line 71, in fit self.model.fit(X, y, **fit_kwargs) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\dl_base.py", line 384, in fit X, y = self._preprocessor(X, y) File "E:\Anaconda\install\lib\site-packages\hyperts\framework\dl_base.py", line 827, in _preprocessor self.meta = MetaTSCprocessor(task=self.task) TypeError: init() got an unexpected keyword argument 'task'

代码如下:

from hyperts.datasets import load_basic_motions from sklearn.model_selection import train_test_split from hyperts.experiment import make_experiment from hyperts.framework.search_space.macro_search_space import DLClassRegressSearchSpace

df = load_basic_motions() train_df, test_df = train_test_split(df, test_size=0.2) custom_search_space = DLClassRegressSearchSpace(enable_hybirdrnn=True, enable_lstnet=False, enable_inceptiontime=False,
hybirdrnn_init_kwargs={ 'learning_rate':0.01, 'reducelr_patience': 5, 'earlystop_patience': 15, } )

experiment = make_experiment(train_data=train_df.copy(), task='classification', mode='dl', max_trials=10, search_space=custom_search_space, target='target')

model = experiment.run()

Shanshan122 commented 1 year ago

已解决。(更新了包)