Exemple #1
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
Exemple #2
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
Exemple #3
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
Exemple #4
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
Exemple #5
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
Exemple #6
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
Exemple #7
0
 def __init__(self,
              name: str = "LastValueNaive",
              frequency: str = 'infer',
              prediction_interval: float = 0.9,
              holiday_country: str = 'US',
              random_seed: int = 2020):
     ModelObject.__init__(self,
                          name,
                          frequency,
                          prediction_interval,
                          holiday_country=holiday_country,
                          random_seed=random_seed)
Exemple #8
0
 def __init__(self,
              name: str = "ZeroesNaive",
              frequency: str = 'infer',
              prediction_interval: float = 0.9,
              holiday_country: str = 'US',
              random_seed: int = 2020,
              verbose: int = 0):
     ModelObject.__init__(self,
                          name,
                          frequency,
                          prediction_interval,
                          holiday_country=holiday_country,
                          random_seed=random_seed,
                          verbose=verbose)
Exemple #9
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'):
     ModelObject.__init__(self,
                          name,
                          frequency,
                          prediction_interval,
                          holiday_country=holiday_country,
                          random_seed=random_seed,
                          verbose=verbose)
     self.method = method
Exemple #10
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',
              random_seed: int = 2020,
              verbose: int = 0):
     ModelObject.__init__(self,
                          name,
                          frequency,
                          prediction_interval,
                          regression_type=regression_type,
                          holiday_country=holiday_country,
                          random_seed=random_seed,
                          verbose=verbose)
     self.holiday = holiday