Skip to content

Commit

Permalink
Rename NamedValue to Variable (#10)
Browse files Browse the repository at this point in the history
Minor refactoring in the UPI, no structural changes.

## Changes:
1. Rename `NamedValue` to `Variable` (and rename `value.proto` to
`variable.proto`)
3. Move `Type` to `type.proto`
  • Loading branch information
aria authored Sep 13, 2022
1 parent 8fbb12d commit 2ccbe00
Show file tree
Hide file tree
Showing 58 changed files with 1,902 additions and 469 deletions.
163 changes: 94 additions & 69 deletions docs/api_html/caraml/upi/v1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,9 @@ <h2>Table of Contents</h2>


<li>
<a href="#caraml%2fupi%2fv1%2fvalue.proto">caraml/upi/v1/value.proto</a>
<a href="#caraml%2fupi%2fv1%2ftype.proto">caraml/upi/v1/type.proto</a>
<ul>

<li>
<a href="#caraml.upi.v1.NamedValue"><span class="badge">M</span>NamedValue</a>
</li>


<li>
<a href="#caraml.upi.v1.Type"><span class="badge">E</span>Type</a>
Expand Down Expand Up @@ -216,6 +212,21 @@ <h2>Table of Contents</h2>



</ul>
</li>


<li>
<a href="#caraml%2fupi%2fv1%2fvariable.proto">caraml/upi/v1/variable.proto</a>
<ul>

<li>
<a href="#caraml.upi.v1.Variable"><span class="badge">M</span>Variable</a>
</li>




</ul>
</li>

Expand Down Expand Up @@ -265,71 +276,15 @@ <h2>Table of Contents</h2>


<div class="file-heading">
<h2 id="caraml/upi/v1/value.proto">caraml/upi/v1/value.proto</h2><a href="#title">Top</a>
<h2 id="caraml/upi/v1/type.proto">caraml/upi/v1/type.proto</h2><a href="#title">Top</a>
</div>
<p></p>


<h3 id="caraml.upi.v1.NamedValue">NamedValue</h3>
<p>Represents a named and typed data point.</p><p>Can be used as a prediction input, output or metdadata.</p><p>Oneof types are avoided as these can be difficult to handle</p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Name describing what the value represents.
Uses include:
- Ensuring ML models process columns in the correct order
- Defining a Feast row entity name
- Parsing metadata to apply traffic rules </p></td>
</tr>

<tr>
<td>type</td>
<td><a href="#caraml.upi.v1.Type">Type</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>double_value</td>
<td><a href="#double">double</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>integer_value</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>string_value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>







<h3 id="caraml.upi.v1.Type">Type</h3>
<p></p>
<p>Type supported by UPI</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
Expand All @@ -345,19 +300,19 @@ <h3 id="caraml.upi.v1.Type">Type</h3>
<tr>
<td>TYPE_DOUBLE</td>
<td>1</td>
<td><p></p></td>
<td><p>Double precision floating number (64-bit)</p></td>
</tr>

<tr>
<td>TYPE_INTEGER</td>
<td>2</td>
<td><p></p></td>
<td><p>64-bit Integer</p></td>
</tr>

<tr>
<td>TYPE_STRING</td>
<td>3</td>
<td><p></p></td>
<td><p>String</p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -532,6 +487,76 @@ <h3 id="caraml.upi.v1.Value">Value</h3>



<div class="file-heading">
<h2 id="caraml/upi/v1/variable.proto">caraml/upi/v1/variable.proto</h2><a href="#title">Top</a>
</div>
<p></p>


<h3 id="caraml.upi.v1.Variable">Variable</h3>
<p>Represents a named and typed data point.</p><p>Can be used as a prediction input, output or metadata.</p><p>Oneof types are avoided as these can be difficult to handle</p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Name describing what the value represents.
Uses include:
- Ensuring ML models process columns in the correct order
- Defining a Feast row entity name
- Parsing metadata to apply traffic rules </p></td>
</tr>

<tr>
<td>type</td>
<td><a href="#caraml.upi.v1.Type">Type</a></td>
<td></td>
<td><p>Type of the variable </p></td>
</tr>

<tr>
<td>double_value</td>
<td><a href="#double">double</a></td>
<td></td>
<td><p>One of the following field will be set depending on the type </p></td>
</tr>

<tr>
<td>integer_value</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>string_value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>













<div class="file-heading">
<h2 id="caraml/upi/v1/upi.proto">caraml/upi/v1/upi.proto</h2><a href="#title">Top</a>
</div>
Expand Down Expand Up @@ -620,7 +645,7 @@ <h3 id="caraml.upi.v1.PredictValuesRequest">PredictValuesRequest</h3>

<tr>
<td>prediction_context</td>
<td><a href="#caraml.upi.v1.NamedValue">NamedValue</a></td>
<td><a href="#caraml.upi.v1.Variable">Variable</a></td>
<td>repeated</td>
<td><p>Prediction context may contain additional data applicable to all prediction instances
For example it can be used to store information for traffic rules, experimentation
Expand Down Expand Up @@ -670,7 +695,7 @@ <h3 id="caraml.upi.v1.PredictValuesResponse">PredictValuesResponse</h3>

<tr>
<td>prediction_context</td>
<td><a href="#caraml.upi.v1.NamedValue">NamedValue</a></td>
<td><a href="#caraml.upi.v1.Variable">Variable</a></td>
<td>repeated</td>
<td><p>Extensible field to cover unforeseen requirements </p></td>
</tr>
Expand Down Expand Up @@ -800,7 +825,7 @@ <h3 id="caraml.upi.v1.TransformerInput">TransformerInput</h3>

<tr>
<td>variables</td>
<td><a href="#caraml.upi.v1.NamedValue">NamedValue</a></td>
<td><a href="#caraml.upi.v1.Variable">Variable</a></td>
<td>repeated</td>
<td><p>List of variables </p></td>
</tr>
Expand Down
83 changes: 50 additions & 33 deletions docs/api_markdown/caraml/upi/v1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

## Table of Contents

- [caraml/upi/v1/value.proto](#caraml_upi_v1_value-proto)
- [NamedValue](#caraml-upi-v1-NamedValue)

- [caraml/upi/v1/type.proto](#caraml_upi_v1_type-proto)
- [Type](#caraml-upi-v1-Type)

- [caraml/upi/v1/table.proto](#caraml_upi_v1_table-proto)
Expand All @@ -14,6 +12,9 @@
- [Table](#caraml-upi-v1-Table)
- [Value](#caraml-upi-v1-Value)

- [caraml/upi/v1/variable.proto](#caraml_upi_v1_variable-proto)
- [Variable](#caraml-upi-v1-Variable)

- [caraml/upi/v1/upi.proto](#caraml_upi_v1_upi-proto)
- [ModelMetadata](#caraml-upi-v1-ModelMetadata)
- [PredictValuesRequest](#caraml-upi-v1-PredictValuesRequest)
Expand All @@ -28,31 +29,10 @@



<a name="caraml_upi_v1_value-proto"></a>
<a name="caraml_upi_v1_type-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## caraml/upi/v1/value.proto



<a name="caraml-upi-v1-NamedValue"></a>

### NamedValue
Represents a named and typed data point.
Can be used as a prediction input, output or metdadata.
Oneof types are avoided as these can be difficult to handle


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Name describing what the value represents. Uses include: - Ensuring ML models process columns in the correct order - Defining a Feast row entity name - Parsing metadata to apply traffic rules |
| type | [Type](#caraml-upi-v1-Type) | | |
| double_value | [double](#double) | | |
| integer_value | [int64](#int64) | | |
| string_value | [string](#string) | | |



## caraml/upi/v1/type.proto



Expand All @@ -61,14 +41,14 @@ Oneof types are avoided as these can be difficult to handle
<a name="caraml-upi-v1-Type"></a>

### Type

Type supported by UPI

| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNSPECIFIED | 0 | |
| TYPE_DOUBLE | 1 | |
| TYPE_INTEGER | 2 | |
| TYPE_STRING | 3 | |
| TYPE_DOUBLE | 1 | Double precision floating number (64-bit) |
| TYPE_INTEGER | 2 | 64-bit Integer |
| TYPE_STRING | 3 | String |



Expand Down Expand Up @@ -163,6 +143,43 @@ Value of a cell within a table. Value is nullable.



<a name="caraml_upi_v1_variable-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## caraml/upi/v1/variable.proto



<a name="caraml-upi-v1-Variable"></a>

### Variable
Represents a named and typed data point.
Can be used as a prediction input, output or metadata.
Oneof types are avoided as these can be difficult to handle


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Name describing what the value represents. Uses include: - Ensuring ML models process columns in the correct order - Defining a Feast row entity name - Parsing metadata to apply traffic rules |
| type | [Type](#caraml-upi-v1-Type) | | Type of the variable |
| double_value | [double](#double) | | One of the following field will be set depending on the type |
| integer_value | [int64](#int64) | | |
| string_value | [string](#string) | | |















<a name="caraml_upi_v1_upi-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down Expand Up @@ -197,7 +214,7 @@ Represents a request to predict multiple values
| prediction_table | [Table](#caraml-upi-v1-Table) | | Prediction table contains instances to be predicted. Each row in the table correspond to one prediction instance. Prediction table should contain all preprocessed feature that model use to perform prediction. The column ordering in the prediction table must be the same as feature order expected by model in the case of standard model. Prediction table can be populated via 3 ways: - By performing preprocessing in the client-side and sent as part of original request. - By transforming feature values stored in transformer_inputs. - By retrieving precomputed feature value from feature store. Row ID of the prediction_table must be populated by the client and can be used to join a row in prediction_table with another row in the prediction_result_table, and to track predictions generated by multiple models. The user is expected to include row ID (along with prediction ID) when calling the observations API so that predictions and observations can be joined. NOTE: the ordering of rows might differ in the response but the number of row must remain the same. |
| transformer_input | [TransformerInput](#caraml-upi-v1-TransformerInput) | | Transformer input contains list of tables and variables that can be used to enrich prediction_table using transformer. Typically transformer_inputs contains: - unprocessed/raw features that requires further transformation. - list of entities for which their precomputed features are retrieved from feature store using standard transformer. |
| target_name | [string](#string) | | Name of the concept we wish to predict. For example in context of iris classification problem it can be &#34;iris-species&#34; |
| prediction_context | [NamedValue](#caraml-upi-v1-NamedValue) | repeated | Prediction context may contain additional data applicable to all prediction instances For example it can be used to store information for traffic rules, experimentation or tracking purposes. Eg. country_code, service_type, service_area_id |
| prediction_context | [Variable](#caraml-upi-v1-Variable) | repeated | Prediction context may contain additional data applicable to all prediction instances For example it can be used to store information for traffic rules, experimentation or tracking purposes. Eg. country_code, service_type, service_area_id |
| metadata | [RequestMetadata](#caraml-upi-v1-RequestMetadata) | | Request metadata |


Expand All @@ -215,7 +232,7 @@ Represents a request to predict multiple values
| ----- | ---- | ----- | ----------- |
| prediction_result_table | [Table](#caraml-upi-v1-Table) | | Prediction results corresponding to the prediction rows provided in the request. NOTE: the ordering of prediction_result_rows might differ with prediction_table in the request but the number of row must match with the prediction_table |
| target_name | [string](#string) | | Target name as defined in the request metadata |
| prediction_context | [NamedValue](#caraml-upi-v1-NamedValue) | repeated | Extensible field to cover unforeseen requirements |
| prediction_context | [Variable](#caraml-upi-v1-Variable) | repeated | Extensible field to cover unforeseen requirements |
| metadata | [ResponseMetadata](#caraml-upi-v1-ResponseMetadata) | | Response metadata |


Expand Down Expand Up @@ -267,7 +284,7 @@ All tables and variables within transformer input will be imported to the standa
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| tables | [Table](#caraml-upi-v1-Table) | repeated | List of tables All tables must have unique name. Each table doesn&#39;t need to have same number of row. |
| variables | [NamedValue](#caraml-upi-v1-NamedValue) | repeated | List of variables |
| variables | [Variable](#caraml-upi-v1-Variable) | repeated | List of variables |



Expand Down
Loading

0 comments on commit 2ccbe00

Please sign in to comment.