Closed geoHeil closed 3 years ago
Hi @geoHeil,
A couple of comments:
build_ts_model(arch, dls=dls)
as that will automatically set the right parameters to build the model. In your case for example, c_out needs to be the same as the horizon.As an example, here's some code you may use to run a multi-output regression task:
dsid = 'NATOPS'
X, y, splits = get_UCR_data(dsid, split_data=False)
tfms = [None, TSRegression()]
dls = get_ts_dls(X, np.random.rand(y.shape[0], 8), tfms=tfms, splits=splits, bs=[64, 128])
learn = ts_learner(dls, InceptionTimePlus, metrics=[mae, mse])
learn.fit_one_cycle(1)
BTW, this approach is also valid for some models (those finished in Plus, as they have a custom_head kwarg) even if you use a 3d target y:
dsid = 'NATOPS'
X, y, splits = get_UCR_data(dsid, split_data=False)
tfms = [None, TSRegression()]
dls = get_ts_dls(X, np.random.rand(y.shape[0], 3, 8), tfms=tfms, splits=splits, bs=[64, 128])
learn = ts_learner(dls, InceptionTimePlus, metrics=[mae, mse])
learn.fit_one_cycle(5)
This may be useful in multivariate, multi-step forecasting or 2d output regression.
many thanks!
When trying to perform a regression using:
the code fails with:
However, a classification task with:
and an iteger class label works just fine.