felipeangelimvieira / prophetverse

A multiverse of Prophet models for timeseries
https://prophetverse.com
Apache License 2.0
33 stars 3 forks source link

[ENH] Reduce coupling in BaseBayesianForecaster, BaseProphetForecaster and Prophet classes' hyperparameters #123

Open felipeangelimvieira opened 1 week ago

felipeangelimvieira commented 1 week ago

Currently, there exists some amout of coupling in the hyperparameters of sktime classes. For example, the MCMC related parameters are only used if inference_method="mcmc". A new design should be proposed to avoid this, maybe by having an InferenceEngine object as hyperparameter instead.

Example:


model = Prophetverse(
        trend=PiecewiseLinearTrend(
                changepoint_prior_scale=0.1,
                changepoint_range=-365
        ),
        inference_engine=MAPInferenceEngine(
                optimizer=AdamOptimizer(step_size=0.001),
                steps=100_000,
        ),
        likelihood="normal",
)

And possibly, with some syntatic sugar

model = (
       Prophetverse(likelihood="normal") 
       >> PiecewiseLinearTrend(
                changepoint_prior_scale=0.1,
                changepoint_range=-365
             ) 
       >> ("effect_id", Effect(), ["col1", "col2"])  
       >> MAPInferenceEngine(
                optimizer=AdamOptimizer(),

        )
)