Skip to content

Commit

Permalink
feat: add output contract in prediction model (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar-rudder authored Jul 11, 2024
1 parent 0916b5d commit f31f151
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/predictions/profiles_mlcorelib/py_native/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ class PredictionModel(BaseModelType):
}

def __init__(self, build_spec: dict, schema_version: int, pb_version: str) -> None:
build_spec["contract"] = {
"with_entity_ids": [build_spec["entity_key"]],
"with_columns": [
{
"name": build_spec["ml_config"]["outputs"]["column_names"][
"percentile"
]
},
{"name": build_spec["ml_config"]["outputs"]["column_names"]["score"]},
],
}
super().__init__(build_spec, schema_version, pb_version)

def get_material_recipe(self) -> PyNativeRecipe:
Expand Down

0 comments on commit f31f151

Please sign in to comment.