Skip to content

Commit 9658ea3

Browse files
committed
feat: add get model instance metrics endpoint
1 parent 700f3da commit 9658ea3

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
get:
2+
tags:
3+
- models
4+
operationId: getModelMetrics
5+
summary: Get a model’s instance metrics.
6+
description: Get the model instance’ training metrics.
7+
parameters:
8+
- $ref: '../../common/parameters.yml#/modelID'
9+
responses:
10+
'200':
11+
description: OK
12+
content:
13+
application/json:
14+
schema:
15+
title: getModelMetricsResponse
16+
type: array
17+
items:
18+
$ref: '../../responses/Models.yml#/modelMetrics'
19+
'401':
20+
$ref: '../../responses/InvalidCredentials.yml'
21+
'404':
22+
$ref: '../../responses/ModelNotFound.yml'
23+
'422':
24+
$ref: '../../../common/responses/UnprocessableEntity.yml'
25+
'500':
26+
$ref: '../../../common/responses/InternalError.yml'

specs/predict/responses/Models.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ getModelInstanceConfigStatus:
5656
`active` - model is running and generating prediction. \
5757
`invalid` - model has failed training (ex. can’t retrieve data from source). An additional error field will be set for this status. \
5858
`inactive` - model has been deactivated from the dashboard. Pipelines still exist but they are not currently running.
59+
60+
modelMetrics:
61+
type: object
62+
additionalProperties: false
63+
properties:
64+
precision:
65+
type: number
66+
format: double
67+
recall:
68+
type: number
69+
format: double
70+
mrr:
71+
type: number
72+
format: double
73+
coverage:
74+
type: number
75+
format: double
76+
f1_score:
77+
type: number
78+
format: double
79+
updatedAt:
80+
type: string

specs/predict/spec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ paths:
6363

6464
/1/predict/models:
6565
$ref: 'paths/models/models.yml'
66+
67+
/1/predict/models/{modelID}/metrics:
68+
$ref: 'paths/models/getModelMetrics.yml'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"testName": "get metrics for a model instance",
4+
"parameters": {
5+
"modelID": "model1"
6+
},
7+
"request": {
8+
"path": "/1/predict/models/model1/metrics",
9+
"method": "GET"
10+
}
11+
}
12+
]

0 commit comments

Comments
 (0)