-
Notifications
You must be signed in to change notification settings - Fork 292
/
Copy pathconstants.py
56 lines (47 loc) · 2.03 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
TABULAR_CLASSIFICATION = 1
IMAGE_CLASSIFICATION = 2
TABULAR_REGRESSION = 3
IMAGE_REGRESSION = 4
TIMESERIES_CLASSIFICATION = 5
TIMESERIES_REGRESSION = 6
REGRESSION_TASKS = [TABULAR_REGRESSION, IMAGE_REGRESSION, TIMESERIES_REGRESSION]
CLASSIFICATION_TASKS = [TABULAR_CLASSIFICATION, IMAGE_CLASSIFICATION, TIMESERIES_CLASSIFICATION]
TABULAR_TASKS = [TABULAR_CLASSIFICATION, TABULAR_REGRESSION]
IMAGE_TASKS = [IMAGE_CLASSIFICATION, IMAGE_REGRESSION]
TASK_TYPES = REGRESSION_TASKS + CLASSIFICATION_TASKS
TASK_TYPES_TO_STRING = \
{TABULAR_CLASSIFICATION: 'tabular_classification',
IMAGE_CLASSIFICATION: 'image_classification',
TABULAR_REGRESSION: 'tabular_regression',
IMAGE_REGRESSION: 'image_regression',
TIMESERIES_CLASSIFICATION: 'time_series_classification',
TIMESERIES_REGRESSION: 'time_series_regression'}
STRING_TO_TASK_TYPES = \
{'tabular_classification': TABULAR_CLASSIFICATION,
'image_classification': IMAGE_CLASSIFICATION,
'tabular_regression': TABULAR_REGRESSION,
'image_regression': IMAGE_REGRESSION,
'time_series_classification': TIMESERIES_CLASSIFICATION,
'time_series_regression': TIMESERIES_REGRESSION}
# 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]