Skip to content
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/multivariate - step 4 #111

Merged
merged 185 commits into from Jul 7, 2020
Merged

feature/multivariate - step 4 #111

merged 185 commits into from Jul 7, 2020

Conversation

pennfranc
Copy link
Contributor

Summary

  • Adds multivariate functionality to backtesting functions.
  • Further improves backtest_regression by introducing new parameters.

pennfranc added 30 commits May 11, 2020 13:16
Base automatically changed from multivariate-3 to develop June 24, 2020 13:20
@guillaumeraille guillaumeraille mentioned this pull request Jun 24, 2020
@@ -28,10 +29,28 @@

# TODO parameterize the moving window

def _create_parameter_dicts(model, target_indices, component_index, use_full_output_length):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is what @guillaumeraille was asking on the daily in the morning.

@pennfranc this looks good, think we can also somehow make it automatic?

def backtest_forecasting(series: TimeSeries,
model: ForecastingModel,
start: pd.Timestamp,
fcast_horizon_n: int,
target_indices: Optional[List[int]] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite a lot of args passed to this function. As an optional improvement can consider moving them to a class level and wrap the whole backtesting module in a class.

examples/FFT-examples.ipynb Outdated Show resolved Hide resolved
use_full_output_length
In case `model` is a subclass of `TorchForecastingModel`, this argument will be passed along
as argument to the predict method of `model`.
stride
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice. It would also be nice to have the option of configuring the training set length. When set, this would do moving window, and when not set it would do expending window (can wait a future PR though :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for sure, @guillaumeraille also suggested this!

stride
The number of time steps (the unit being the frequency of `series`) between two consecutive predictions.
retrain
Whether to retrain the model for every prediction or not. Currently only TorchForecastingModel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add backticks around TorchForecastingModel: `

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

last_pred_time = (
series.time_index()[-fcast_horizon_n - stride] if trim_to_series else series.time_index()[-stride - 1]
)
raise_if_not(retrain or isinstance(model, TorchForecastingModel), "Only 'TorchForecastingModel' instances"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can move this check up (before computing last_pred_time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@pennfranc pennfranc merged commit c6885ca into develop Jul 7, 2020
@pennfranc pennfranc deleted the multivariate-4 branch July 7, 2020 09:08
@endrjuskr endrjuskr mentioned this pull request Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants