File: ItemSimilarityRecommender.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (75 lines) | stat: -rw-r--r-- 2,567 bytes parent folder | download | duplicates (9)
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
// Copyright (c) 2017, Apple Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-3-clause license that can be
// found in LICENSE.txt or at https://opensource.org/licenses/BSD-3-Clause

syntax = "proto3";
option optimize_for = LITE_RUNTIME;

import public "DataStructures.proto";

package CoreML.Specification;

/*
 * Item Similarity Recommender
 *
 *  The Item Similarity recommender takes as input a list of items and scores,
 *  then uses that information and a table of item similarities to predict
 * similarity scores for all items.  By default, the items predicted are most
 * similar to the given items but not part of that item set.
 *
 *  The predicted score for a given item k is
 *    sum_(i in observed items)   sim_(k,i) * (score_i - shift_k)
 *
 *  Because only the most similar scores for each item i are stored,
 *  sim_(k,i) is often zero.
 *
 *  For many models, the score adjustment parameter shift_j is zero -- it's
 * occasionally used to counteract global biases for popular items.
 *
 *
 *  References:
 */
message ItemSimilarityRecommender {
  /* The items similar to a given base item.
   */
  message ConnectedItem {
    uint64 itemId = 1;
    double similarityScore = 2;
  }

  /*  The formula for the score of a given model as given above, with shift_k
   *   parameter given by itemScoreAdjustment, and the similar item list filling
   * in all the known sim(k,i) scores for i given by itemID and k given by the
   * itemID parameter in the similarItemList.
   */
  message SimilarItems {
    uint64 itemId = 1;
    repeated ConnectedItem similarItemList = 2;
    double itemScoreAdjustment = 3;
  }

  repeated SimilarItems itemItemSimilarities = 1;

  /* One or none of these are given.  If none are given, then the items must
   * number 0, 1, ..., num_items - 1. If either is given, the length must be
   * exactly num_items.
   */
  StringVector itemStringIds = 2;
  Int64Vector itemInt64Ids = 3;

  /* Input parameter names specifying different possible inputs to the
   * recommender.
   */
  string itemInputFeatureName = 10; /* Required */
  string numRecommendationsInputFeatureName =
      11; /* Optional; defaults to all items if not given.*/
  string itemRestrictionInputFeatureName = 12; /* Optional. */
  string itemExclusionInputFeatureName =
      13; /* Optional; defaults to input item list if not given. */

  /* The predicted outputs.  At least one of these must be specified.
   */
  string recommendedItemListOutputFeatureName = 20;
  string recommendedItemScoreOutputFeatureName = 21;
}