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

feat!: add transformations and high-level forecasting API #65

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

sd2k
Copy link
Collaborator

@sd2k sd2k commented Feb 29, 2024

This rather large commit adds a new Forecaster struct under the new
augurs-forecaster crate, which provides a higher level API
combining transforming input data, fitting and predicting. This means
that models (e.g. the MSTL model) don't need to concern themselves with
the potentially unlimited number of transformations that could need to
happen on the input data, and instead just fit their models as normal.

In doing so I needed to rework the APIs of the other models somewhat, to
make them fit into a new Fit / Predict API, which makes them much
easier to use (vs the old Fit / Unfit marker trait). The new APIs
are similar to those used by linfa.

The new Predict API also allows users to pass in a pre-allocated
Forecast which allows for an optimization if multiple predictions are
being made.

@sd2k sd2k changed the title feat: add transformations and high-level forecasting API feat!: add transformations and high-level forecasting API Feb 29, 2024
@sd2k sd2k force-pushed the forecast-and-transformations-api branch from 64ea891 to 488e233 Compare February 29, 2024 15:39
crates/augurs-js/src/mstl.rs Outdated Show resolved Hide resolved
crates/augurs-js/src/mstl.rs Outdated Show resolved Hide resolved
crates/augurs-mstl/src/lib.rs Outdated Show resolved Hide resolved
@sd2k sd2k force-pushed the forecast-and-transformations-api branch from 488e233 to 7b8f60d Compare February 29, 2024 22:27
sd2k added 3 commits April 24, 2024 10:38
This rather large commit adds a new `Forecaster` struct under the new
`augurs-forecaster` crate, which provides a higher level API
combining transforming input data, fitting and predicting. This means
that models (e.g. the MSTL model) don't need to concern themselves with
the potentially unlimited number of transformations that could need to
happen on the input data, and instead just fit their models as normal.

In doing so I needed to rework the APIs of the other models somewhat, to
make them fit into a new `Fit` / `Predict` API, which makes them much
easier to use (vs the old `Fit` / `Unfit` marker trait). The new APIs
are similar to those used by `linfa`.

The new `Predict` API also allows users to pass in a pre-allocated
`Forecast` which allows for an optimization if multiple predictions are
being made.
Don't use the standard Fit/Predict traits here because
they make it nigh impossible to use trait objects
(due to the associated types). Instead use new traits
which require boxing.
@sd2k sd2k force-pushed the forecast-and-transformations-api branch from 7b8f60d to 399eb37 Compare April 24, 2024 09:39
@sd2k sd2k merged commit a762063 into main Apr 24, 2024
16 checks passed
@sd2k sd2k deleted the forecast-and-transformations-api branch April 24, 2024 10:19
@sd2k sd2k mentioned this pull request Apr 24, 2024
@sd2k sd2k mentioned this pull request May 21, 2024
This was referenced Jun 5, 2024
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.

1 participant