Skip to content

MPM Endpoints

Note that access to the Comet REST endpoints require the {'Authorization': ${COMET_API_KEY}} header. You can find your API key in your account settings or by navigating to https://www.comet.com/api/my/settings/.

Send MPM Events¶

POST/mpm/v2/events/batch?enforceValidation=true

Send a MPM events containing the input features, output features and labels for a given prediction. If the labels are not available when the features and predictions are logged, you can also use the /mpm/v2/labels endpoint. If enforceValidation is set to true, a 400 status code will be returned if there are errors ingesting the events.

Example Request

{
    "data": [
        {
            "workspaceName": "someWorkspaceName",
            "modelName": "someModelName",
            "modelVersion": "2.1.0",
            "predictionId": "b99f9195-435d-427f-afed-03731efa2774",
            "timestamp": 1662544656000,
            "features": {
                "feature_1": "any_string",
                "feature_2": 10
            },
            "predictions": {
                "value": "true",
                "probability": 0.87
            },
            "labels": {
                "label": "true"
            }
        }
    ]
}

Example Response

{
    "code": 200
}

Send MPM Labels¶

POST/mpm/v2/labels/batch?enforceValidation=true

Send an MPM event containing the ground truth value for a prediction whose input and output features are already stored in Comet. These events are processed on a daily basis and merged with existing MPM events. If enforceValidation is set to true, a 400 status code will be returned if there are errors ingesting the labels.

Example Request

{
    "data": [
        {
            "workspaceName": "jacques-comet",
            "modelName": "someModelName",
            "predictionId": "b99f9195-435d-427f-afed-03731efa2774",
            "value": {
                "label": "false"
            }
        }
    ]
}

Example Response

{
    "code": 200
}

Dec. 17, 2024