-
Notifications
You must be signed in to change notification settings - Fork 58
/
constants.tsx
78 lines (69 loc) · 2.03 KB
/
constants.tsx
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
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import { FEATURE_TYPE } from '../../../models/interfaces';
import {
ModelConfigurationFormikValues,
FeaturesFormikValues,
} from '../../ConfigureModel/models/interfaces';
import { DEFAULT_SHINGLE_SIZE } from '../../../utils/constants';
export const INITIAL_MODEL_CONFIGURATION_VALUES: ModelConfigurationFormikValues =
{
featureList: [],
categoryFieldEnabled: false,
categoryField: [],
shingleSize: DEFAULT_SHINGLE_SIZE,
imputationOption: undefined
};
export const INITIAL_FEATURE_VALUES: FeaturesFormikValues = {
featureId: '',
featureName: '',
featureEnabled: true,
featureType: FEATURE_TYPE.SIMPLE,
aggregationQuery: JSON.stringify(
{ aggregation_name: { sum: { field: 'field_name' } } },
null,
4
),
aggregationBy: '',
aggregationOf: [],
};
export const FEATURE_TYPES = [
{ text: 'Custom Aggregation', value: FEATURE_TYPE.CUSTOM },
{ text: 'Defined Aggregation', value: FEATURE_TYPE.SIMPLE },
];
export const FEATURE_TYPE_OPTIONS = [
{ text: 'Field value', value: FEATURE_TYPE.SIMPLE },
{ text: 'Custom expression', value: FEATURE_TYPE.CUSTOM },
];
export enum SAVE_FEATURE_OPTIONS {
START_AD_JOB = 'start_ad_job',
KEEP_AD_JOB_STOPPED = 'keep_ad_job_stopped',
}
export const AGGREGATION_TYPES = [
{ value: 'avg', text: 'average()' },
{ value: 'value_count', text: 'count()' },
{ value: 'sum', text: 'sum()' },
{ value: 'min', text: 'min()' },
{ value: 'max', text: 'max()' },
];
export const FEATURE_FIELDS = [
'featureName',
'aggregationOf',
'aggregationBy',
'aggregationQuery',
];
// an enum for the sparse data handling options
export enum SparseDataOptionValue {
IGNORE = 'ignore',
PREVIOUS_VALUE = 'previous_value',
SET_TO_ZERO = 'set_to_zero',
CUSTOM_VALUE = 'custom_value',
}