Ejemplo n.º 1
0
 def __init__(
     self,
     name: str = "TensorflowSTS",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     regression_type: str = None,
     holiday_country: str = 'US',
     random_seed: int = 2020,
     verbose: int = 0,
     trend: str = 'local',
     seasonal_periods: int = None,
     ar_order: int = None,
     fit_method: str = 'hmc',
     num_steps: int = 200,
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
     )
     self.seasonal_periods = seasonal_periods
     self.ar_order = ar_order
     self.trend = trend
     self.fit_method = fit_method
     self.num_steps = num_steps
Ejemplo n.º 2
0
 def __init__(
     self,
     name: str = "TFPRegression",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     holiday_country: str = 'US',
     random_seed: int = 2020,
     verbose: int = 1,
     kernel_initializer: str = 'lecun_uniform',
     optimizer: str = 'adam',
     loss: str = 'negloglike',
     epochs: int = 50,
     batch_size: int = 32,
     dist: str = 'normal',
     regression_type: str = None,
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
     )
     self.verbose = verbose
     self.random_seed = random_seed
     self.kernel_initializer = kernel_initializer
     self.epochs = int(epochs)
     self.batch_size = int(batch_size)
     self.optimizer = optimizer
     self.loss = loss  # negloglike, Huber, mae
     self.dist = dist  # normal, poisson, negbinom
Ejemplo n.º 3
0
 def __init__(
     self,
     name: str = "GluonTS",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     regression_type: str = None,
     holiday_country: str = 'US',
     random_seed: int = 2020,
     verbose: int = 0,
     gluon_model: str = 'DeepAR',
     epochs: int = 20,
     learning_rate: float = 0.001,
     context_length=10,
     forecast_length: int = 14,
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
     )
     self.gluon_model = gluon_model
     if self.gluon_model == 'NPTS':
         self.epochs = 20
         self.learning_rate = 0.001
     else:
         self.epochs = epochs
         self.learning_rate = learning_rate
     self.context_length = context_length
     self.forecast_length = forecast_length
Ejemplo n.º 4
0
 def __init__(
     self,
     name: str = "Greykite",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     holiday: bool = False,
     growth: str = None,
     regression_type: str = None,
     holiday_country: str = 'US',
     random_seed: int = 2020,
     verbose: int = 0,
     n_jobs: int = None,
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
         n_jobs=n_jobs,
     )
     self.holiday = holiday
     self.growth = growth
Ejemplo n.º 5
0
 def __init__(self,
              name: str = "MotifSimulation",
              frequency: str = 'infer',
              prediction_interval: float = 0.9,
              holiday_country: str = 'US',
              random_seed: int = 2020,
              phrase_len: str = '5',
              comparison: str = 'magnitude_pct_change_sign',
              shared: bool = False,
              distance_metric: str = 'l2',
              max_motifs: float = 50,
              recency_weighting: float = 0.1,
              cutoff_threshold: float = 0.9,
              cutoff_minimum: int = 20,
              point_method: str = 'median',
              verbose: int = 1,
              **kwargs):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         holiday_country=holiday_country,
         random_seed=random_seed,
     )
     self.phrase_len = phrase_len
     self.comparison = comparison
     self.shared = shared
     self.distance_metric = distance_metric
     self.max_motifs = max_motifs
     self.recency_weighting = recency_weighting
     self.cutoff_threshold = cutoff_threshold
     self.cutoff_minimum = cutoff_minimum
     self.point_method = point_method
Ejemplo n.º 6
0
 def __init__(self,
              name: str = "SeasonalNaive",
              frequency: str = 'infer',
              prediction_interval: float = 0.9,
              holiday_country: str = 'US',
              random_seed: int = 2020,
              verbose: int = 0,
              lag_1: int = 7,
              lag_2: int = None,
              method: str = 'LastValue',
              **kwargs):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
     )
     self.lag_1 = abs(int(lag_1))
     self.lag_2 = lag_2
     if str(self.lag_2).isdigit():
         self.lag_2 = abs(int(self.lag_2))
         if str(self.lag_2) == str(self.lag_1):
             self.lag_2 = 1
     self.method = method
Ejemplo n.º 7
0
 def __init__(
     self,
     name: str = "TSFreshRegressor",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     regression_type: str = None,
     holiday_country: str = 'US',
     verbose: int = 0,
     random_seed: int = 2020,
     regression_model: str = 'Adaboost',
     max_timeshift: int = 10,
     feature_selection: str = None,
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
     )
     self.regression_model = regression_model
     self.max_timeshift = max_timeshift
     self.feature_selection = feature_selection
Ejemplo n.º 8
0
 def __init__(self,
              name: str = "LastValueNaive",
              frequency: str = 'infer',
              prediction_interval: float = 0.9,
              holiday_country: str = 'US',
              random_seed: int = 2020,
              **kwargs):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         holiday_country=holiday_country,
         random_seed=random_seed,
     )
Ejemplo n.º 9
0
 def __init__(
     self,
     name: str = "FBProphet",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     holiday: bool = False,
     regression_type: str = None,
     holiday_country: str = 'US',
     yearly_seasonality="auto",
     weekly_seasonality="auto",
     daily_seasonality="auto",
     growth: str = "linear",
     n_changepoints: int = 25,
     changepoint_prior_scale: float = 0.05,
     seasonality_mode: str = "additive",
     changepoint_range: float = 0.8,
     seasonality_prior_scale: float = 10.0,
     holidays_prior_scale: float = 10.0,
     random_seed: int = 2020,
     verbose: int = 0,
     n_jobs: int = None,
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
         n_jobs=n_jobs,
     )
     self.holiday = holiday
     self.regressor_name = []
     self.yearly_seasonality = yearly_seasonality
     self.weekly_seasonality = weekly_seasonality
     self.daily_seasonality = daily_seasonality
     self.growth = growth
     self.n_changepoints = n_changepoints
     self.changepoint_prior_scale = changepoint_prior_scale
     self.seasonality_mode = seasonality_mode
     self.changepoint_range = changepoint_range
     self.seasonality_prior_scale = seasonality_prior_scale
     self.holidays_prior_scale = holidays_prior_scale
Ejemplo n.º 10
0
 def __init__(self,
              name: str = "AverageValueNaive",
              frequency: str = 'infer',
              prediction_interval: float = 0.9,
              holiday_country: str = 'US',
              random_seed: int = 2020,
              verbose: int = 0,
              method: str = 'Median',
              **kwargs):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
     )
     self.method = method
Ejemplo n.º 11
0
 def __init__(
     self,
     name: str = "NeuralProphet",
     frequency: str = 'infer',
     prediction_interval: float = 0.9,
     holiday: bool = False,
     regression_type: str = None,
     holiday_country: str = 'US',
     random_seed: int = 2020,
     verbose: int = 0,
     n_jobs: int = None,
     growth: str = "off",
     n_changepoints: int = 10,
     changepoints_range: float = 0.9,
     trend_reg: float = 0,
     trend_reg_threshold: bool = False,
     ar_sparsity: float = None,
     yearly_seasonality: str = "auto",
     weekly_seasonality: str = "auto",
     daily_seasonality: str = "auto",
     seasonality_mode: str = "additive",
     seasonality_reg: float = 0,
     n_lags: int = 0,
     num_hidden_layers: int = 0,
     d_hidden: int = None,
     learning_rate: float = None,
     loss_func: str = "Huber",
     train_speed: int = None,
     normalize: str = "auto",
 ):
     ModelObject.__init__(
         self,
         name,
         frequency,
         prediction_interval,
         regression_type=regression_type,
         holiday_country=holiday_country,
         random_seed=random_seed,
         verbose=verbose,
         n_jobs=n_jobs,
     )
     self.holiday = holiday
     self.regressor_name = []
     self.growth = growth
     self.n_changepoints = n_changepoints
     self.changepoints_range = changepoints_range
     self.trend_reg = trend_reg
     self.trend_reg_threshold = trend_reg_threshold
     self.ar_sparsity = ar_sparsity
     self.yearly_seasonality = yearly_seasonality
     self.weekly_seasonality = weekly_seasonality
     self.daily_seasonality = daily_seasonality
     self.seasonality_mode = seasonality_mode
     self.seasonality_reg = seasonality_reg
     self.n_lags = n_lags
     self.num_hidden_layers = num_hidden_layers
     self.d_hidden = d_hidden
     self.learning_rate = learning_rate
     self.loss_func = loss_func
     self.train_speed = train_speed
     self.normalize = normalize