pub struct ProphetDecomposition {Show 18 fields
pub trend_type: TrendType,
pub seasonality_mode: SeasonalityMode,
pub cap: Option<Array1<f64>>,
pub floor: Option<Array1<f64>>,
pub capacities: Option<Array1<f64>>,
pub n_changepoints: usize,
pub changepoint_range: f64,
pub changepoint_prior_scale: f64,
pub holiday_prior_scale: f64,
pub seasonalities: Vec<SeasonalitySpec>,
pub holidays: Vec<Holiday>,
pub t0_days: Option<f64>,
pub total_days: Option<f64>,
pub changepoints: Option<Vec<f64>>,
pub delta: Option<Array1<f64>>,
pub k: Option<f64>,
pub m: Option<f64>,
pub beta: Option<Array1<f64>>,
}Fields§
§trend_type: TrendType§seasonality_mode: SeasonalityMode§cap: Option<Array1<f64>>Upper capacity bound per observation date C(t)
floor: Option<Array1<f64>>Optional lower capacity floor per observation date F(t) (default: 0.0)
capacities: Option<Array1<f64>>§n_changepoints: usize§changepoint_range: f64§changepoint_prior_scale: f64§holiday_prior_scale: f64§seasonalities: Vec<SeasonalitySpec>§holidays: Vec<Holiday>§t0_days: Option<f64>§total_days: Option<f64>§changepoints: Option<Vec<f64>>§delta: Option<Array1<f64>>§k: Option<f64>§m: Option<f64>§beta: Option<Array1<f64>>Implementations§
Source§impl ProphetDecomposition
impl ProphetDecomposition
pub fn new(n_changepoints: usize, changepoint_prior_scale: f64) -> Self
Sourcepub fn to_json(&self) -> Result<String>
pub fn to_json(&self) -> Result<String>
Serializes the model state (including fitted coefficients) to a JSON string.
Sourcepub fn from_json(json_str: &str) -> Result<Self>
pub fn from_json(json_str: &str) -> Result<Self>
Deserializes a ProphetDecomposition model from a JSON string.
Sourcepub fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Saves the model state to a JSON file on disk.
Sourcepub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Loads a model state from a JSON file on disk.
Sourcepub fn add_seasonality(
&mut self,
name: &str,
period_days: f64,
fourier_order: usize,
)
pub fn add_seasonality( &mut self, name: &str, period_days: f64, fourier_order: usize, )
Adds a seasonal component with a default prior scale of 10.0
Sourcepub fn add_seasonality_with_prior(
&mut self,
name: &str,
period_days: f64,
fourier_order: usize,
prior_scale: f64,
)
pub fn add_seasonality_with_prior( &mut self, name: &str, period_days: f64, fourier_order: usize, prior_scale: f64, )
Adds a seasonal component with a custom prior scale for independent regularization
pub fn add_holiday(&mut self, holiday: Holiday)
Sourcepub fn predict_with_intervals(
&self,
dates: &[NaiveDate],
interval_width: f64,
n_samples: usize,
) -> Result<ProphetPrediction>
pub fn predict_with_intervals( &self, dates: &[NaiveDate], interval_width: f64, n_samples: usize, ) -> Result<ProphetPrediction>
Predicts yhat and computes percentile-based uncertainty intervals via parallel Monte Carlo simulation
pub fn fit( &mut self, dates: &[NaiveDate], y: &Array1<f64>, cap: Option<&Array1<f64>>, floor: Option<&Array1<f64>>, ) -> Result<()>
pub fn predict(&self, dates: &[NaiveDate]) -> Result<ProphetPrediction>
Trait Implementations§
Source§impl Clone for ProphetDecomposition
impl Clone for ProphetDecomposition
Source§fn clone(&self) -> ProphetDecomposition
fn clone(&self) -> ProphetDecomposition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProphetDecomposition
impl Debug for ProphetDecomposition
Source§impl Default for ProphetDecomposition
impl Default for ProphetDecomposition
Source§fn default() -> ProphetDecomposition
fn default() -> ProphetDecomposition
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProphetDecomposition
impl<'de> Deserialize<'de> for ProphetDecomposition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProphetDecomposition
impl RefUnwindSafe for ProphetDecomposition
impl Send for ProphetDecomposition
impl Sync for ProphetDecomposition
impl Unpin for ProphetDecomposition
impl UnsafeUnpin for ProphetDecomposition
impl UnwindSafe for ProphetDecomposition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more