Skip to content

Commit a2f5dd9

Browse files
authored
feat(m2): variant coverage — all 5 LGB objectives, importance, trees view (#5)
1 parent 7bcff54 commit a2f5dd9

65 files changed

Lines changed: 15838 additions & 253 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ claude.md
2525
# Runtime data: artifacts (source of truth) + derived SQLite registry + logs
2626
/data/
2727
*.cerebro.json
28+
# Committed example artifacts are the snapshot test fixtures — keep them
29+
!examples/*.cerebro.json
2830
*.db
2931
*.db-wal
3032
*.db-shm

contracts/openapi/openapi.json

Lines changed: 103 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
"model": {
2020
"$ref": "#/components/schemas/Model"
2121
},
22+
"rank_metadata": {
23+
"anyOf": [
24+
{
25+
"additionalProperties": true,
26+
"type": "object"
27+
},
28+
{
29+
"type": "null"
30+
}
31+
],
32+
"title": "Rank Metadata"
33+
},
2234
"schema_version": {
2335
"const": "1.0.0",
2436
"title": "Schema Version",
@@ -120,8 +132,35 @@
120132
},
121133
"Importance": {
122134
"additionalProperties": false,
123-
"description": "Feature importance scores keyed by feature name.\n\n`permutation` is locked to None in v1.0.0. When permutation importance\nlands, it will use the shape `{feature_name: {\"mean\": float, \"std\": float}}`\nbehind a schema-version bump.",
135+
"description": "Feature importance scores keyed by feature name.",
124136
"properties": {
137+
"divergence_warnings": {
138+
"anyOf": [
139+
{
140+
"items": {
141+
"additionalProperties": {
142+
"anyOf": [
143+
{
144+
"type": "string"
145+
},
146+
{
147+
"type": "integer"
148+
},
149+
{
150+
"type": "number"
151+
}
152+
]
153+
},
154+
"type": "object"
155+
},
156+
"type": "array"
157+
},
158+
{
159+
"type": "null"
160+
}
161+
],
162+
"title": "Divergence Warnings"
163+
},
125164
"gain": {
126165
"additionalProperties": {
127166
"type": "number"
@@ -169,7 +208,6 @@
169208
"$ref": "#/components/schemas/FeatureSchema"
170209
},
171210
"num_class": {
172-
"const": 1,
173211
"title": "Num Class",
174212
"type": "integer"
175213
},
@@ -178,7 +216,13 @@
178216
"type": "integer"
179217
},
180218
"objective": {
181-
"const": "binary",
219+
"enum": [
220+
"binary",
221+
"multiclass",
222+
"regression",
223+
"lambdarank",
224+
"multi_output"
225+
],
182226
"title": "Objective",
183227
"type": "string"
184228
},
@@ -439,6 +483,62 @@
439483
]
440484
}
441485
},
486+
"/artifacts/{artifact_id}/importance": {
487+
"get": {
488+
"description": "Return importance scores for the requested type.\n\n- gain / split: always available (computed at extraction time).\n- permutation: available only when evaluation samples were provided\n at extraction time; returns HTTP 200 with empty features list and a\n detail message when absent.",
489+
"operationId": "get_importance_artifacts__artifact_id__importance_get",
490+
"parameters": [
491+
{
492+
"in": "path",
493+
"name": "artifact_id",
494+
"required": true,
495+
"schema": {
496+
"title": "Artifact Id",
497+
"type": "string"
498+
}
499+
},
500+
{
501+
"description": "Importance type: gain, split, or permutation",
502+
"in": "query",
503+
"name": "type",
504+
"required": true,
505+
"schema": {
506+
"description": "Importance type: gain, split, or permutation",
507+
"title": "Type",
508+
"type": "string"
509+
}
510+
}
511+
],
512+
"responses": {
513+
"200": {
514+
"content": {
515+
"application/json": {
516+
"schema": {
517+
"additionalProperties": true,
518+
"title": "Response Get Importance Artifacts Artifact Id Importance Get",
519+
"type": "object"
520+
}
521+
}
522+
},
523+
"description": "Successful Response"
524+
},
525+
"422": {
526+
"content": {
527+
"application/json": {
528+
"schema": {
529+
"$ref": "#/components/schemas/HTTPValidationError"
530+
}
531+
}
532+
},
533+
"description": "Validation Error"
534+
}
535+
},
536+
"summary": "Get Importance",
537+
"tags": [
538+
"artifacts"
539+
]
540+
}
541+
},
442542
"/health": {
443543
"get": {
444544
"description": "Liveness probe \u2014 does not check storage or downstream deps.",

0 commit comments

Comments
 (0)