Skip to content

Commit f8947af

Browse files
tonybove-appleabove3
andauthored
Mlmodel Docs - Update Proto Pages Batch 1 (#2093)
* Mlmodel Docs - Update Proto Pages Batch 1 * Edit For Mlmodel Docs - Update Proto Pages Batch 1 --------- Co-authored-by: above3 <anthony_bove@apple.com>
1 parent 4cb0e20 commit f8947af

File tree

4 files changed

+588
-509
lines changed

4 files changed

+588
-509
lines changed

mlmodel/docs/Format/DataStructures.rst

Lines changed: 108 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ to a 64-bit integer.
1212

1313
.. code-block:: proto
1414
15-
message StringToInt64Map {
16-
map<string, int64> map = 1;
17-
}
15+
message StringToInt64Map {
16+
map<string, int64> map = 1;
17+
}
1818
1919
2020
@@ -32,9 +32,9 @@ to a string.
3232

3333
.. code-block:: proto
3434
35-
message Int64ToStringMap {
36-
map<int64, string> map = 1;
37-
}
35+
message Int64ToStringMap {
36+
map<int64, string> map = 1;
37+
}
3838
3939
4040
@@ -52,9 +52,9 @@ to a double-precision floating point number.
5252

5353
.. code-block:: proto
5454
55-
message StringToDoubleMap {
56-
map<string, double> map = 1;
57-
}
55+
message StringToDoubleMap {
56+
map<string, double> map = 1;
57+
}
5858
5959
6060
@@ -72,9 +72,9 @@ to a double-precision floating point number.
7272

7373
.. code-block:: proto
7474
75-
message Int64ToDoubleMap {
76-
map<int64, double> map = 1;
77-
}
75+
message Int64ToDoubleMap {
76+
map<int64, double> map = 1;
77+
}
7878
7979
8080
@@ -91,9 +91,9 @@ A vector of strings.
9191

9292
.. code-block:: proto
9393
94-
message StringVector {
95-
repeated string vector = 1;
96-
}
94+
message StringVector {
95+
repeated string vector = 1;
96+
}
9797
9898
9999
@@ -108,9 +108,9 @@ A vector of 64-bit integers.
108108

109109
.. code-block:: proto
110110
111-
message Int64Vector {
112-
repeated int64 vector = 1;
113-
}
111+
message Int64Vector {
112+
repeated int64 vector = 1;
113+
}
114114
115115
116116
@@ -125,9 +125,9 @@ A vector of floating point numbers.
125125

126126
.. code-block:: proto
127127
128-
message FloatVector {
129-
repeated float vector = 1;
130-
}
128+
message FloatVector {
129+
repeated float vector = 1;
130+
}
131131
132132
133133
@@ -142,9 +142,9 @@ A vector of double-precision floating point numbers.
142142

143143
.. code-block:: proto
144144
145-
message DoubleVector {
146-
repeated double vector = 1;
147-
}
145+
message DoubleVector {
146+
repeated double vector = 1;
147+
}
148148
149149
150150
@@ -159,10 +159,10 @@ A range of int64 values
159159

160160
.. code-block:: proto
161161
162-
message Int64Range {
163-
int64 minValue = 1;
164-
int64 maxValue = 2;
165-
}
162+
message Int64Range {
163+
int64 minValue = 1;
164+
int64 maxValue = 2;
165+
}
166166
167167
168168
@@ -177,9 +177,9 @@ A set of int64 values
177177

178178
.. code-block:: proto
179179
180-
message Int64Set {
181-
repeated int64 values = 1;
182-
}
180+
message Int64Set {
181+
repeated int64 values = 1;
182+
}
183183
184184
185185
@@ -194,7 +194,80 @@ A range of double values
194194

195195
.. code-block:: proto
196196
197-
message DoubleRange {
198-
double minValue = 1;
199-
double maxValue = 2;
200-
}
197+
message DoubleRange {
198+
double minValue = 1;
199+
double maxValue = 2;
200+
}
201+
202+
203+
204+
PrecisionRecallCurve
205+
________________________________________________________________________________
206+
207+
The syntax comprises two tables: one to look up the precision value threshold
208+
for a given precision, and the other for a given recall.
209+
210+
.. list-table:: Example
211+
:widths: 55 5 5 5 5 5 5 5 5 5
212+
:header-rows: 0
213+
214+
* - ``precisionValues``
215+
- .1
216+
- .2
217+
- .3
218+
- .4
219+
- .5
220+
- .6
221+
- .7
222+
-
223+
-
224+
* - ``precisionConfidence``
225+
- .0
226+
- .0
227+
- .0
228+
- .0
229+
- .1
230+
- .3
231+
- .4
232+
-
233+
-
234+
* - ``recallValues``
235+
- .1
236+
- .2
237+
- .3
238+
- .4
239+
- .5
240+
- .6
241+
- .7
242+
- .8
243+
- .9
244+
* - ``recallConfidence``
245+
- .7
246+
- .6
247+
- .5
248+
- .4
249+
- .3
250+
- .3
251+
- .2
252+
- .1
253+
- .0
254+
255+
The application expects that, when it filters out samples with
256+
confidence threshold = 0.1, it gets precision = 0.5. Likewise,
257+
with threshold = 0.2 it gets recall = 0.7.
258+
259+
The table must have only valid values; do not use ``NaN``, ``+/- INF``,
260+
or negative values. The application is responsible for inter/extrapolating the
261+
appropriate confidence threshold based on the application's specific need.
262+
263+
.. code-block:: proto
264+
265+
message PrecisionRecallCurve {
266+
FloatVector precisionValues = 1;
267+
FloatVector precisionConfidenceThresholds = 2;
268+
FloatVector recallValues = 3;
269+
FloatVector recallConfidenceThresholds = 4;
270+
}
271+
272+
273+

0 commit comments

Comments
 (0)