-
Notifications
You must be signed in to change notification settings - Fork 282
/
constants.py
87 lines (72 loc) · 3.33 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
TABULAR_CLASSIFICATION = 1
IMAGE_CLASSIFICATION = 2
TABULAR_REGRESSION = 3
IMAGE_REGRESSION = 4
TIMESERIES_FORECASTING = 5
REGRESSION_TASKS = [TABULAR_REGRESSION, IMAGE_REGRESSION]
CLASSIFICATION_TASKS = [TABULAR_CLASSIFICATION, IMAGE_CLASSIFICATION]
FORECASTING_TASKS = [TIMESERIES_FORECASTING] # TODO extend FORECASTING TASKS to Classification and regression tasks
TABULAR_TASKS = [TABULAR_CLASSIFICATION, TABULAR_REGRESSION]
IMAGE_TASKS = [IMAGE_CLASSIFICATION, IMAGE_REGRESSION]
TIMESERIES_TASKS = [TIMESERIES_FORECASTING]
TASK_TYPES = REGRESSION_TASKS + CLASSIFICATION_TASKS + FORECASTING_TASKS
TASK_TYPES_TO_STRING = \
{TABULAR_CLASSIFICATION: 'tabular_classification',
IMAGE_CLASSIFICATION: 'image_classification',
TABULAR_REGRESSION: 'tabular_regression',
IMAGE_REGRESSION: 'image_regression',
TIMESERIES_FORECASTING: 'time_series_forecasting'}
STRING_TO_TASK_TYPES = \
{'tabular_classification': TABULAR_CLASSIFICATION,
'image_classification': IMAGE_CLASSIFICATION,
'tabular_regression': TABULAR_REGRESSION,
'image_regression': IMAGE_REGRESSION,
'time_series_forecasting': TIMESERIES_FORECASTING}
# Output types have been defined as in scikit-learn type_of_target
# (https://scikit-learn.org/stable/modules/generated/sklearn.utils.multiclass.type_of_target.html)
BINARY = 10
CONTINUOUSMULTIOUTPUT = 11
MULTICLASS = 12
CONTINUOUS = 13
MULTICLASSMULTIOUTPUT = 14
OUTPUT_TYPES = [BINARY, CONTINUOUSMULTIOUTPUT, MULTICLASS, CONTINUOUS]
OUTPUT_TYPES_TO_STRING = \
{BINARY: 'binary',
CONTINUOUSMULTIOUTPUT: 'continuous-multioutput',
MULTICLASS: 'multiclass',
CONTINUOUS: 'continuous',
MULTICLASSMULTIOUTPUT: 'multiclass-multioutput'}
STRING_TO_OUTPUT_TYPES = \
{'binary': BINARY,
'continuous-multioutput': CONTINUOUSMULTIOUTPUT,
'multiclass': MULTICLASS,
'continuous': CONTINUOUS,
'multiclass-multioutput': MULTICLASSMULTIOUTPUT}
CLASSIFICATION_OUTPUTS = [BINARY, MULTICLASS, MULTICLASSMULTIOUTPUT]
REGRESSION_OUTPUTS = [CONTINUOUS, CONTINUOUSMULTIOUTPUT]
ForecastingDependenciesNotInstalledMSG = "Additional dependencies must be installed to work with time series " \
"forecasting tasks! Please run \n pip install autoPyTorch[forecasting] \n to "\
"install the corresponding dependencies!"
# This value is applied to ensure numerical stability: Sometimes we want to rescale some values: value / scale.
# We make the scale value to be 1 if it is smaller than this value to ensure that the scaled value will not resutl in
# overflow
VERY_SMALL_VALUE = 1e-12
# The constant values for time series forecasting comes from
# https://github.com/rakshitha123/TSForecasting/blob/master/experiments/deep_learning_experiments.py
# seasonality map, maps a frequency value to a number
FORECASTING_BUDGET_TYPE = ('resolution', 'num_seq', 'num_sample_per_seq')
SEASONALITY_MAP = {
"1min": [1440, 10080, 525960],
"10min": [144, 1008, 52596],
"30min": [48, 336, 17532],
"1H": [24, 168, 8766],
"1D": 7,
"1W": 365.25 / 7,
"1M": 12,
"1Q": 4,
"1Y": 1
}
# To avoid that we get a sequence that is too long to be fed to a network
MAX_WINDOW_SIZE_BASE = 500
# AutoPyTorch optionally allows network inference or metrics calculation for the following datasets
OPTIONAL_INFERENCE_CHOICES = ('test',)