-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwprecservice.proto
55 lines (47 loc) · 1.18 KB
/
wprecservice.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
syntax="proto3";
option java_multiple_files = true;
option java_package = "wmind.demo.wprecservice";
option java_outer_classname = "WpRecService";
package WpRecService;
service WpRecService {
rpc GetRecommend (RecommendRequest) returns (RecommendResponse) {}
rpc GetMfRecommend (MfRequest) returns (RecommendResponse) {}
rpc GetMfCateRecommend (MfRequest) returns (MfDataResponse) {}
}
message MfRequest {
string dayFrom = 1;
string dayTo = 2;
// predictMoment and user are only for one-time prediction
string predictMoment = 3;
uint32 user = 4;
uint32 dimension = 5;
// unobserved weight
float weight = 6;
// regularization coefficient
float coef = 7;
uint32 nIter = 8;
}
message RecommendRequest {
string methodName = 1;
string dayFrom = 2;
string dayTo = 3;
string predictMoment = 4;
uint32 user = 5;
}
message RecommendResponse {
// -1 for no error, 0 for bad request, 1 for process error
int32 error = 1;
repeated Predicted result = 2;
}
message Predicted {
uint32 id = 1;
uint32 slot = 2;
float score = 3;
}
message MfDataResponse {
// -1 for no error, 0 for bad request, 1 for process error
int32 error = 1;
uint32 numFeatures = 2;
string users = 3;
string items = 4;
}