---
title: "score_rows_model_score_post"
method: POST
path: "/model/score"
---

# score_rows_model_score_post

`POST /model/score`

## Request

- Base URL: `https://www.example.com`
- URL: `https://www.example.com/model/score`
- Auth: none declared
- TypeScript: <https://skmtc.dev/h2o/apis/mlops-scoring-rest-api/docs/model/score/post.ts> (a function with typed inputs; its response is checked against the schema)

Computes score of the rows sent in the body of the post request.

## Headers

- `authorization` string

## Request body

- ScoreRequest
  - `fields` string[], required: An array holding the names of fields in the order of appearance in the `rows` property. The length of `fields` has to match length of each row in `rows`. No duplicates are allowed.
  - `rows` array[], required: An array of rows consisting the actual input data for scoring, one scoring request per row.
    - string[]
  - `noFieldNamesInOutput` boolean: If set to `true`. The scorer will not fill response column names in the `fields` field. This is can be useful to maintain compatibility with older scorer versions or to save bandwidth.
  - `requestPredictionIntervals` boolean: If set to `true`, the scorer will try to fill field `predictionIntervals` in response if it is supported.
  - `includeFieldsInOutput` string[]: An array holding the list of field names to be copied from the input request row to the corresponding scoring output. It is an error to specify a field name not present in the `fields` property, except when it is equal to the `idField` property. In the latter case, the row id would be generated and returned in the response. Note that the order of items in `includeFieldsInOutput` is ignored and the specified fields are returned in the order of appearance in the input request row.
  - `idField` string: Name of the field that holds a row id, e.g., a value that uniquely identifies each row of the request. The caller may specify a name of the field that is not present in fields. In which case, the scorer is allowed to generate a UUID to identify each row (e.g., for logging and monitoring purposes). To retrieve such a generated id as a part of the response, simply name it in the `includeFieldsInOutput`.
  - `requestShapleyValueType` 'ORIGINAL' | 'TRANSFORMED' | 'NONE': The string to say what type of Shap values are needed. `ORIGINAL` implies Shap values of original features are requested, `TRANSFORMED` implies that Shap values of transformed features are requested.

## Response `200`

Successful Response

- ScoreResponse
  - `id` string: A unique id of the model used for scoring.
  - `fields` string[]: An array holding the names of fields in the order of appearance, in the rows of the `score` property. This field is not populated if requested by setting the `noFieldNamesInOutput` request field to `true`.
  - `score` array[], required: An array of rows consisting the actual scoring output. The order of rows corresponds to the order of the input request rows. Each row contains any copied input fields first (in the order of appearance in the input row). If the `idField` was specified and also listed in the `includeFieldsInOutput` but not provided in `fields`, a unique id will be generated and positioned right after all the other fields copied from the input. The scoring output follows.
    - string[]
  - `featureShapleyContributions` object: An object with features and shapley values that was requested by the client. It is currently available for transformed features of binomial, regression, and multinomial models of mojo2. This field will not be populated if the Shapley values are not available for a model.
    - `features` string[], required: An array holding the names of fields in the order of appearance in the rows of the `contributions` property.
    - `contributionGroups` ContributionGroup[], required: An array of rows consisting of the shapley contributions output corresponding to an output group.
      - `output_group` string: Name of the output group. It will be populated only for multinomial models. Shapley values are not supported for third party models yet, hence this field will not be populated.
      - `contributions` array[], required: n array of rows consisting of the shapley contributions output corresponding to columns in the fields
        - string[]
  - `predictionIntervals` object: Prediction interval consist of an array of interval bound names and rows of array of bounds per bound name. Setting `requestPredictionIntervals` to true will enable populating the field. The field will be empty or an error response returned if prediction intervals arenot returned or supported by the model.
    - `fields` string[], required: An array holding the names of fields in the order of appearance in the `rows` property. The length of `fields` has to match length of each row in `rows`. No duplicates are allowed.
    - `rows` array[], required: An array of rows consisting the actual input data for scoring, one scoring request per row.
      - string[]

## Other responses

- `400`: failed because of bad request
- `401`: Unauthorized
- `422`: Validation Error
- `500`: Internal Server Error
- `501`: Not Implemented

---

[API](https://skmtc.dev/h2o/apis/mlops-scoring-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/mlops-scoring-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/mlops-scoring-rest-api/revisions/a1b84d5b62f7?raw)
