orbit.constants package

Submodules

orbit.constants.constants module

class orbit.constants.constants.BacktestAnalyzeKeys(value)

Bases: enum.Enum

hash table keys for the dictionary of back-test aggregation analysis result

METRIC_GEO = 'metric_geo'
METRIC_NAME = 'metric_name'
METRIC_PER_BTMOD = 'metric_per_btmod'
METRIC_PER_HORIZON = 'metric_per_horizon'
class orbit.constants.constants.BacktestFitColumnNames(value)

Bases: enum.Enum

column names for the data frame of back-test fitting result

ACTUAL = 'actual'
FORECAST_DATES = 'forecast_dates'
PRED = 'pred'
PRED_HORIZON = 'pred_horizon'
TRAIN_END_DATE = 'train_end_date'
TRAIN_START_DATE = 'train_start_date'
class orbit.constants.constants.CoefPriorDictKeys(value)

Bases: enum.Enum

hash table keys for the dictionary of back-test aggregation analysis result

NAME = 'name'
PRIOR_END_TP_IDX = 'prior_end_tp_idx'
PRIOR_MEAN = 'prior_mean'
PRIOR_REGRESSOR_COL = 'prior_regressor_col'
PRIOR_SD = 'prior_sd'
PRIOR_START_TP_IDX = 'prior_start_tp_idx'
class orbit.constants.constants.DateInfo(value)

Bases: enum.Enum

date_column: the data column name of the training/prediction data frame; starting_date: the date of first day of training data; format: yyyy-mm-dd date_interval: ‘day’, ‘week’, ‘month’

DATE_COLUMN = 'date_column'
DATE_COLUMN_NAME = 'date_column_name'
DATE_INTERVAL = 'date_interval'
END_DATE = 'end_date'
START_DATE = 'start_date'
class orbit.constants.constants.EstimatorOptionsMapper(value)

Bases: enum.Enum

Mapper for available options of a downstream input given an input upstream (within some other set of options)

ENGINE_TO_SAMPLE = {'pyro': ['map', 'vi'], 'stan': ['map', 'vi', 'mcmc']}
SAMPLE_TO_PREDICT = {'map': ['map'], 'mcmc': ['mean', 'median', 'full'], 'vi': ['mean', 'median', 'full']}
class orbit.constants.constants.InferMethod(value)

Bases: enum.Enum

The predict method for all of the stan models. Often used are mean and median.

MAP = 'map'
MARKOV_CHAIN_MONTE_CARLO = 'mcmc'
VARIATIONAL_INFERENCE = 'vi'
class orbit.constants.constants.PlotLabels(value)

Bases: enum.Enum

An enumeration.

ACTUAL_RESPONSE = 'actual_response'
PREDICTED_RESPONSE = 'predicted_response'
TRAINING_ACTUAL_RESPONSE = 'training_actual_response'
class orbit.constants.constants.PredictMethod(value)

Bases: enum.Enum

The predict method for all of the stan models. Often used are mean and median.

FULL_SAMPLING = 'full'
MAP = 'map'
MEAN = 'mean'
MEDIAN = 'median'
class orbit.constants.constants.PredictionKeys(value)

Bases: enum.Enum

column names for the data frame of predicted result with decomposed components

PREDICTION = 'prediction'
REGRESSION = 'regression'
REGRESSOR = 'regressor'
SEASONALITY = 'seasonality'
TREND = 'trend'
class orbit.constants.constants.StanModelKeys(value)

Bases: enum.Enum

All of the keys in the trained stan model from uTS. For example, for LGT/SLGT, the model is the output of SLGT.fit() and input of SLGTModel.

DATE_INFO = 'date_info'
MODELS = 'models'
REGRESSOR_COLUMNS = 'regressor_columns'
RESPONSE_COLUMN = 'response_column'
STAN_INPUTS = 'stan_inputs'
class orbit.constants.constants.TimeSeriesSplitSchemeNames(value)

Bases: enum.Enum

hash table keys for the dictionary of back-test meta data

MODEL = 'model'
TEST_IDX = 'test_idx'
TRAIN_END_DATE = 'train_end_date'
TRAIN_IDX = 'train_idx'
TRAIN_START_DATE = 'train_start_date'

orbit.constants.dlt module

class orbit.constants.dlt.BaseSamplingParameters(value)

Bases: enum.Enum

base parameters in posteriors sampling

LEVEL_SMOOTHING_FACTOR = 'lev_sm'
LOCAL_TREND = 'lt_sum'
LOCAL_TREND_LEVELS = 'l'
LOCAL_TREND_SLOPES = 'b'
RESIDUAL_DEGREE_OF_FREEDOM = 'nu'
RESIDUAL_SIGMA = 'obs_sigma'
SLOPE_SMOOTHING_FACTOR = 'slp_sm'
class orbit.constants.dlt.DataInputMapper(value)

Bases: enum.Enum

mapping from object input to stan file

AUTO_RIDGE_SCALE = 'AUTO_RIDGE_SCALE'
CAUCHY_SD = 'CAUCHY_SD'
DAMPED_FACTOR = 'DAMPED_FACTOR'
LASSO_SCALE = 'LASSO_SCALE'
MAX_NU = 'MAX_NU'
MIN_NU = 'MIN_NU'
NEGATIVE_REGRESSOR_BETA_PRIOR = 'NR_BETA_PRIOR'
NEGATIVE_REGRESSOR_MATRIX = 'NR_MAT'
NEGATIVE_REGRESSOR_SIGMA_PRIOR = 'NR_SIGMA_PRIOR'
NUM_OF_NEGATIVE_REGRESSORS = 'NUM_OF_NR'
NUM_OF_OBSERVATIONS = 'NUM_OF_OBS'
NUM_OF_POSITIVE_REGRESSORS = 'NUM_OF_PR'
NUM_OF_REGULAR_REGRESSORS = 'NUM_OF_RR'
POSITIVE_REGRESSOR_BETA_PRIOR = 'PR_BETA_PRIOR'
POSITIVE_REGRESSOR_MATRIX = 'PR_MAT'
POSITIVE_REGRESSOR_SIGMA_PRIOR = 'PR_SIGMA_PRIOR'
REGULAR_REGRESSOR_BETA_PRIOR = 'RR_BETA_PRIOR'
REGULAR_REGRESSOR_MATRIX = 'RR_MAT'
REGULAR_REGRESSOR_SIGMA_PRIOR = 'RR_SIGMA_PRIOR'
RESPONSE = 'RESPONSE'
WITH_MCMC = 'WITH_MCMC'
class orbit.constants.dlt.GlobalTrendOption(value)

Bases: enum.Enum

An enumeration.

flat = 3
linear = 0
logistic = 2
loglinear = 1
class orbit.constants.dlt.GlobalTrendSamplingParameters(value)

Bases: enum.Enum

An enumeration.

GLOBAL_TREND = 'gt_sum'
GLOBAL_TREND_LEVEL = 'gl'
GLOBAL_TREND_SLOPE = 'gb'
class orbit.constants.dlt.LatentSamplingParameters(value)

Bases: enum.Enum

latent variables to be sampled

INITIAL_SEASONALITY = 'init_sea'
REGRESSION_NEGATIVE_COEFFICIENTS = 'nr_beta'
REGRESSION_POSITIVE_COEFFICIENTS = 'pr_beta'
REGRESSION_REGULAR_COEFFICIENTS = 'rr_beta'
class orbit.constants.dlt.RegressionPenalty(value)

Bases: enum.Enum

An enumeration.

auto_ridge = 2
fixed_ridge = 0
lasso = 1
class orbit.constants.dlt.RegressionSamplingParameters(value)

Bases: enum.Enum

regression component related parameters in posteriors sampling

REGRESSION_COEFFICIENTS = 'beta'
class orbit.constants.dlt.SeasonalitySamplingParameters(value)

Bases: enum.Enum

seasonality component related parameters in posteriors sampling

SEASONALITY_LEVELS = 's'
SEASONALITY_SMOOTHING_FACTOR = 'sea_sm'

orbit.constants.lgt module

class orbit.constants.lgt.BaseSamplingParameters(value)

Bases: enum.Enum

base parameters in posteriors sampling

GLOBAL_TREND_COEF = 'gt_coef'
GLOBAL_TREND_POWER = 'gt_pow'
LEVEL_SMOOTHING_FACTOR = 'lev_sm'
LOCAL_GLOBAL_TREND_SUMS = 'lgt_sum'
LOCAL_TREND_COEF = 'lt_coef'
LOCAL_TREND_LEVELS = 'l'
LOCAL_TREND_SLOPES = 'b'
RESIDUAL_DEGREE_OF_FREEDOM = 'nu'
RESIDUAL_SIGMA = 'obs_sigma'
SLOPE_SMOOTHING_FACTOR = 'slp_sm'
class orbit.constants.lgt.DataInputMapper(value)

Bases: enum.Enum

mapping from object input to stan file

AUTO_RIDGE_SCALE = 'AUTO_RIDGE_SCALE'
CAUCHY_SD = 'CAUCHY_SD'
LASSO_SCALE = 'LASSO_SCALE'
MAX_NU = 'MAX_NU'
MIN_NU = 'MIN_NU'
NEGATIVE_REGRESSOR_BETA_PRIOR = 'NR_BETA_PRIOR'
NEGATIVE_REGRESSOR_MATRIX = 'NR_MAT'
NEGATIVE_REGRESSOR_SIGMA_PRIOR = 'NR_SIGMA_PRIOR'
NUM_OF_NEGATIVE_REGRESSORS = 'NUM_OF_NR'
NUM_OF_OBSERVATIONS = 'NUM_OF_OBS'
NUM_OF_POSITIVE_REGRESSORS = 'NUM_OF_PR'
NUM_OF_REGULAR_REGRESSORS = 'NUM_OF_RR'
POSITIVE_REGRESSOR_BETA_PRIOR = 'PR_BETA_PRIOR'
POSITIVE_REGRESSOR_MATRIX = 'PR_MAT'
POSITIVE_REGRESSOR_SIGMA_PRIOR = 'PR_SIGMA_PRIOR'
REGULAR_REGRESSOR_BETA_PRIOR = 'RR_BETA_PRIOR'
REGULAR_REGRESSOR_MATRIX = 'RR_MAT'
REGULAR_REGRESSOR_SIGMA_PRIOR = 'RR_SIGMA_PRIOR'
RESPONSE = 'RESPONSE'
WITH_MCMC = 'WITH_MCMC'
class orbit.constants.lgt.LatentSamplingParameters(value)

Bases: enum.Enum

latent variables to be sampled

INITIAL_SEASONALITY = 'init_sea'
REGRESSION_NEGATIVE_COEFFICIENTS = 'nr_beta'
REGRESSION_POSITIVE_COEFFICIENTS = 'pr_beta'
REGRESSION_REGULAR_COEFFICIENTS = 'rr_beta'
class orbit.constants.lgt.RegressionPenalty(value)

Bases: enum.Enum

An enumeration.

auto_ridge = 2
fixed_ridge = 0
lasso = 1
class orbit.constants.lgt.RegressionSamplingParameters(value)

Bases: enum.Enum

regression component related parameters in posteriors sampling

REGRESSION_COEFFICIENTS = 'beta'
class orbit.constants.lgt.SeasonalitySamplingParameters(value)

Bases: enum.Enum

seasonality component related parameters in posteriors sampling

SEASONALITY_LEVELS = 's'
SEASONALITY_SMOOTHING_FACTOR = 'sea_sm'

orbit.constants.palette module

class orbit.constants.palette.DivergingPalette(value)

Bases: enum.Enum

An enumeration.

Rainbow = <matplotlib.colors.LinearSegmentedColormap object>
Sunrise = <matplotlib.colors.ListedColormap object>
Unclesam = <matplotlib.colors.LinearSegmentedColormap object>
Watermelon = <matplotlib.colors.LinearSegmentedColormap object>
class orbit.constants.palette.KTRPalette(value)

Bases: enum.Enum

An enumeration.

KNOTS_REGION = '#5b91f5ff'
KNOTS_SEGMENT = '#276ef1'
class orbit.constants.palette.OrbitPalette(value)

Bases: enum.Enum

An enumeration.

black = '#000000'
black_gradient = <matplotlib.colors.LinearSegmentedColormap object>
blue = '#276EF1'
blue_gradient = <matplotlib.colors.LinearSegmentedColormap object>
brown = '#99644C'
green = '#05A357'
green_gradient = <matplotlib.colors.LinearSegmentedColormap object>
orange = '#ED6E33'
purple = '#7356BF'
purple_gradient = <matplotlib.colors.LinearSegmentedColormap object>
rainbow = <matplotlib.colors.LinearSegmentedColormap object>
red = '#E11900'
red_gradient = <matplotlib.colors.LinearSegmentedColormap object>
white = '#FFFFFF'
yellow = '#FFC043'
yellow_gradient = <matplotlib.colors.LinearSegmentedColormap object>
class orbit.constants.palette.PredictionPaletteClassic(value)

Bases: enum.Enum

An enumeration.

actual_obs = '#000000'
holdout_vertical_line = '#1f77b4'
prediction_line = '#12939A'
preidction_range = '#42999E'
test_obs = '#FF8C00'
class orbit.constants.palette.QualitativePalette(value)

Bases: enum.Enum

Palette for visualizing discrete categorical data

Bar5 = ['#ef476fff', '#ffd166ff', '#06d6a0ff', '#118ab2ff', '#073b4cff']
Line4 = ['#e6c72b', '#2be669', '#2b4ae6', '#e62ba8']
PostQ = ['#1fc600', '#ff4500']
Rainbow8 = ['#ffadadff', '#ffd6a5ff', '#fdffb6ff', '#caffbfff', '#9bf6ffff', '#a0c4ffff', '#bdb2ffff', '#ffc6ffff']
Stack = ['#12939A', '#F15C17', '#DDB27C', '#88572C', '#FF991F', '#DA70BF', '#125C77', '#4DC19C', '#776E57', '#17B8BE', '#F6D18A', '#B7885E', '#FFCB99', '#F89570', '#829AE3', '#E79FD5', '#1E96BE', '#89DAC1', '#B3AD9E']
bee_yellow = '#ffa600'
black = '#000000'
blue = '#0000FF'
coral = '#f95d6a'
dark_blue = '#2f4b7c'
dark_green = '#145214'
dark_purple = '#665191'
dark_teal = '#003f5c'
gray = '#cccccc'
green = '#2eb82e'
mid_blue = '#4c72b0'
orange = '#dd8452'
paired_colors = [(0.6509803921568628, 0.807843137254902, 0.8901960784313725), (0.12156862745098039, 0.47058823529411764, 0.7058823529411765), (0.6980392156862745, 0.8745098039215686, 0.5411764705882353), (0.2, 0.6274509803921569, 0.17254901960784313), (0.984313725490196, 0.6039215686274509, 0.6), (0.8901960784313725, 0.10196078431372549, 0.10980392156862745), (0.9921568627450981, 0.7490196078431373, 0.43529411764705883), (1.0, 0.4980392156862745, 0.0), (0.792156862745098, 0.6980392156862745, 0.8392156862745098), (0.41568627450980394, 0.23921568627450981, 0.6039215686274509), (1.0, 1.0, 0.6), (0.6941176470588235, 0.34901960784313724, 0.1568627450980392)]
purple = 'a05195'
red = '#FF0000'
teal = '#008080'
yellow = '#FFFF00'
class orbit.constants.palette.SequentialPalette(value)

Bases: enum.Enum

An enumeration.

Blue10 = ['#edf5ff', '#d0e2ff', '#a6c8ff', '#78a9ff', '#4589ff', '#0f62fe', '#0043ce', '#002d9c', '#001d6c', '#001141']
Cyan10 = ['#e5f6ff', '#bae6ff', '#82cfff', '#33b1ff', '#1192e8', '#0072c3', '#00539a', '#003a6d', '#012749', '#1c0f30']
Forest = <matplotlib.colors.ListedColormap object>
Orange10 = ['#fff2e6', '#ffd9b3', '#ffbf80', '#ffa64d', '#ff8c1a', '#e67300', '#b35900', '#804000', '#4d2600', '#1a0d00']
Rose = <matplotlib.colors.ListedColormap object>
Seafoam = <matplotlib.colors.ListedColormap object>
Sunshine = <matplotlib.colors.LinearSegmentedColormap object>
Teal10 = ['#d9fbfb', '#9ef0f0', '#3ddbd9', '#08bdba', '#009d9a', '#007d79', '#005d5d', '#004144', '#022b30', '#081a1c']

Module contents