-
Notifications
You must be signed in to change notification settings - Fork 3
/
prediction_schema.proto
75 lines (69 loc) · 2.02 KB
/
prediction_schema.proto
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
syntax = "proto3";
package predictionschema.v1;
import "google/api/field_behavior.proto";
import "protoc-gen-validate/validate/validate.proto";
message PredictionSchema {
repeated FeatureSchema requests = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).repeated .min_items = 1
];
repeated FeatureSchema responses = 2 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).repeated .min_items = 1
];
}
enum DataType {
FLOAT = 0;
INT = 1;
BOOL = 2;
STRING = 3;
BYTES = 4;
}
enum FeatureType {
REAL = 0; /* A numerical variable*/
CATEGORICAL = 1; /* A categorical variable*/
PROBA = 2; /* A list of probabilities*/
ONE_HOT = 3; /* A list of one-hot encodings*/
TEXT = 4; /* A text string*/
TENSOR = 5; /* N-dimensional Tensor*/
}
message FeatureCategorySchema {
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string.max_len = 200
];
DataType data_type = 2 [
(google.api.field_behavior) = OPTIONAL,
(validate.rules).enum.defined_only = true
];
}
message FeatureSchema {
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string.max_len = 200
];
FeatureType type = 2 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).enum.defined_only = true
];
DataType data_type = 3 [
(google.api.field_behavior) = OPTIONAL,
(validate.rules).enum.defined_only = true
];
int64 n_categories = 4 [
(google.api.field_behavior) = OPTIONAL,
(validate.rules).int64 = {ignore_empty : true, gte : 1}
];
map<string, string> category_map = 5 [
(google.api.field_behavior) = OPTIONAL,
(validate.rules).map = {ignore_empty : true, min_pairs : 1}
];
repeated FeatureCategorySchema schema = 6 [
(google.api.field_behavior) = OPTIONAL,
(validate.rules).repeated = {ignore_empty : true, min_items : 1}
];
repeated int64 shape = 7 [
(google.api.field_behavior) = OPTIONAL,
(validate.rules).repeated = {ignore_empty : true, min_items : 1}
];
}