mobts.configs package

Submodules

mobts.configs.config_common module

class mobts.configs.config_common.ColumnsConfig(counter: str = 'counter', timestamp: str = 'timestamp', count: str = 'count', weekday: str = 'weekday', week_num: str = 'week_num', how: str = 'how', hour: str = 'hour', date: str = 'date')

Bases: object

Canonical column names used in the pipeline after standardization.

count: str = 'count'
counter: str = 'counter'
date: str = 'date'
hour: str = 'hour'
how: str = 'how'
timestamp: str = 'timestamp'
week_num: str = 'week_num'
weekday: str = 'weekday'
class mobts.configs.config_common.SparsityConfig(drop_sparse_counters: bool = True, sparse_threshold: float = 0.5)

Bases: object

For removing counters with not enough valid counts

drop_sparse_counters: bool = True
sparse_threshold: float = 0.5

mobts.configs.config_imputation module

class mobts.configs.config_imputation.DonorsConfig

Bases: object

Configs for Donor-based imputation

max_donor_rate = 0.5
min_mutual_days = 60
min_mutual_hours = 1440
min_pred_coverage = 1
min_pred_days = 30
min_pred_hours = 720
sm_min_neighbors = 20
sm_min_overlap_day = 60
sm_min_overlap_hour = 1440
top_k_donor = 21
class mobts.configs.config_imputation.OutputConfig(col_sm_imputed: str = 'count_sm_imputed', col_reg_imputed: str = 'count_reg_imputed', col_final: str = 'count_imputed', col_method_used: str = 'imputation_method', stl_method: str = 'STL', sm_method: str = 'M7', reg_method: str = 'M8')

Bases: object

Configs for output columns and final selection

col_final: str = 'count_imputed'
col_intp = 'count_intp'
col_method_used: str = 'imputation_method'
col_reg_imputed: str = 'count_reg_imputed'
col_sm_imputed: str = 'count_sm_imputed'
col_stl_imputed = 'count_stl_imputed'
reg_method: str = 'M8'
sm_method: str = 'M7'
stl_method: str = 'STL'
class mobts.configs.config_imputation.STLConfig(rolling_median_window: int = 2, rolling_median_min_valid: int = 1)

Bases: object

Config used in STL imputation

clip_lower = 0
rolling_median_min_valid: int = 1
rolling_median_window: int = 2
stl_robust = False
stl_season_daily = 7
stl_season_hourly = 168

mobts.configs.config_preprocessing module

class mobts.configs.config_preprocessing.OutlierConfig(threshold_daily: float = 20, threshold_hourly: float = 45)

Bases: object

Parameters for thresholding STL outlier scores.

threshold_daily: float = 20
threshold_hourly: float = 45
class mobts.configs.config_preprocessing.PipelineConfig(cols: mobts.configs.config_common.ColumnsConfig = <factory>, sparse: mobts.configs.config_common.SparsityConfig = <factory>, preprocess: mobts.configs.config_preprocessing.PreprocessConfig = <factory>, stl: mobts.configs.config_preprocessing.STLConfig = <factory>, outliers: mobts.configs.config_preprocessing.OutlierConfig = <factory>, plot: mobts.configs.config_preprocessing.PlotConfig = <factory>)

Bases: object

cols: ColumnsConfig
outliers: OutlierConfig
plot: PlotConfig
preprocess: PreprocessConfig
sparse: SparsityConfig
stl: STLConfig
class mobts.configs.config_preprocessing.PlotConfig(ncols: int = 3, figsize_width: float = 15, min_fig_height: float = 10, height_per_row: float = 3, linewidth_d: float = 0.5, linewidth_h: float = 0.3, marker_size: float = 10, x_label_rotation: int = 30, max_stations: int | None = None)

Bases: object

Parameters for plotting the detected outliers.

figsize_width: float = 15
height_per_row: float = 3
linewidth_d: float = 0.5
linewidth_h: float = 0.3
marker_size: float = 10
max_stations: int | None = None
min_fig_height: float = 10
ncols: int = 3
x_label_rotation: int = 30
class mobts.configs.config_preprocessing.PreprocessConfig(low_rel_daily: float = 0.01, low_abs_daily: float = 5, low_run_min_daily: int = 2, zero_rate_max: float = 0.05, zero_run_min: int = 6, island_max_len: int = 6, surround_min_len: int = 12)

Bases: object

Parameters for low-count/zero-run cleaning and operational window trimming. if avail_min_valid days out of avail_window is not present, the whole window will be set as non-operational.

island_max_len: int = 6
low_abs_daily: float = 5
low_rel_daily: float = 0.01
low_run_min_daily: int = 2
night_hours = [1, 2, 3, 4, 5, 6]
surround_min_len: int = 12
zero_rate_max: float = 0.05
zero_run_min: int = 6
class mobts.configs.config_preprocessing.STLConfig(period: int = 28, robust: bool = False)

Bases: object

Parameters for STL decomposition outlier scoring.

period: int = 28
robust: bool = False

Module contents