1// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6
7option optimize_for = LITE_RUNTIME;
8
9package app_list;
10
11message SerializedMrfuAppLaunchPredictorProto {
12  // Records last updates of the Score for an app.
13  message Score {
14    optional int32 num_of_trains_at_last_update = 1;
15    optional float last_score = 2;
16  }
17  // Map from app_id to its Score.
18  map<string, Score> scores = 1;
19  // Increment 1 for each Train() call.
20  optional int32 num_of_trains = 2;
21}
22
23// HourAppLaunchPredictorProto is used for materializing HourAppLaunchPredictor.
24message HourAppLaunchPredictorProto {
25  // A frequency table records app launches that happened in a particular bin.
26  message FrequencyTable {
27    // Total number of launches (within this bin), should equal to the sum of
28    // frequency below.
29    optional int32 total_counts = 1;
30    // Number of launches for each app (within this bin).
31    map<string, int32> frequency = 2;
32  }
33  // A map from bin indices to each FrequencyTable of that bin.
34  map<int32, FrequencyTable> binned_frequency_table = 1;
35  // Timestamp of last decay operation in days since windows epoch.
36  optional int32 last_decay_timestamp = 2;
37}
38
39// Used only for testing AppSearchResultRanker.
40message FakeAppLaunchPredictorProto {
41  map<string, float> rank_result = 1;
42}
43
44// AppLaunchPredictorProto contains one type of the predictor proto above.
45message AppLaunchPredictorProto {
46  oneof predictor {
47    FakeAppLaunchPredictorProto fake_app_launch_predictor = 1;
48    HourAppLaunchPredictorProto hour_app_launch_predictor = 2;
49    SerializedMrfuAppLaunchPredictorProto serialized_mrfu_app_launch_predictor =
50        3;
51  }
52}
53