pub struct Prophet<O> { /* private fields */ }Expand description
The Prophet time series forecasting model.
Implementations§
Source§impl<O> Prophet<O>
impl<O> Prophet<O>
Sourcepub fn new(opts: ProphetOptions, optimizer: O) -> Self
pub fn new(opts: ProphetOptions, optimizer: O) -> Self
Create a new Prophet model with the given options and optimizer.
Sourcepub fn add_seasonality(
&mut self,
name: String,
seasonality: Seasonality,
) -> Result<&mut Self, Error>
pub fn add_seasonality( &mut self, name: String, seasonality: Seasonality, ) -> Result<&mut Self, Error>
Add a custom seasonality to the model.
Sourcepub fn add_regressor(&mut self, name: String, regressor: Regressor) -> &mut Self
pub fn add_regressor(&mut self, name: String, regressor: Regressor) -> &mut Self
Add a regressor to the model.
Sourcepub fn predict(
&self,
data: impl Into<Option<PredictionData>>,
) -> Result<Predictions, Error>
pub fn predict( &self, data: impl Into<Option<PredictionData>>, ) -> Result<Predictions, Error>
Sourcepub fn make_future_dataframe(
&self,
horizon: NonZeroU32,
include_history: IncludeHistory,
) -> Result<PredictionData, Error>
pub fn make_future_dataframe( &self, horizon: NonZeroU32, include_history: IncludeHistory, ) -> Result<PredictionData, Error>
Sourcepub fn opts(&self) -> &ProphetOptions
pub fn opts(&self) -> &ProphetOptions
Get a reference to the Prophet options.
Sourcepub fn opts_mut(&mut self) -> &mut ProphetOptions
pub fn opts_mut(&mut self) -> &mut ProphetOptions
Get a mutable reference to the Prophet options.
Sourcepub fn set_interval_width(&mut self, interval_width: IntervalWidth)
pub fn set_interval_width(&mut self, interval_width: IntervalWidth)
Set the width of the uncertainty intervals.
The interval width does not affect training, only predictions, so this can be called after fitting the model to obtain predictions with different levels of uncertainty.
Source§impl<O: Optimizer + 'static> Prophet<O>
impl<O: Optimizer + 'static> Prophet<O>
Sourcepub fn into_forecaster(
self,
data: TrainingData,
optimize_opts: OptimizeOpts,
) -> ProphetForecaster
pub fn into_forecaster( self, data: TrainingData, optimize_opts: OptimizeOpts, ) -> ProphetForecaster
Create a new ProphetForecaster from this Prophet model.
This requires the data and optimize options to be provided and sets up
a ProphetForecaster ready to be used with the augurs_forecaster crate.
Trait Implementations§
Auto Trait Implementations§
impl<O> Freeze for Prophet<O>where
O: Freeze,
impl<O> RefUnwindSafe for Prophet<O>where
O: RefUnwindSafe,
impl<O> Send for Prophet<O>where
O: Send,
impl<O> Sync for Prophet<O>where
O: Sync,
impl<O> Unpin for Prophet<O>where
O: Unpin,
impl<O> UnsafeUnpin for Prophet<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for Prophet<O>where
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.