SymetryML Documentation
Kaplan meier

Kaplan-Meier prediction

Runs one or more Kaplan-Meier survival queries against the project's fitted KM model. Each query in `values` has: - **`type`**: only `survival` is supported. - **`times`**: required array of time points to evaluate. - **`group`** (optional): if omitted/empty, results for every group (including the aggregate `"Total"` group) are returned instead of just one. - **`alpha`** (optional): confidence level; defaults to `0.05`, must satisfy `0 < alpha < 1`. Results are returned under `values.kmResultList.values`, one entry per query in request order; each entry is an object keyed by group name whose value is the prediction `DataFrame`.

POST
/{user}/projects/{project}/km/kaplanmeier

Runs one or more Kaplan-Meier survival queries against the project's fitted KM model. Each query in values has:

  • type: only survival is supported.
  • times: required array of time points to evaluate.
  • group (optional): if omitted/empty, results for every group (including the aggregate "Total" group) are returned instead of just one.
  • alpha (optional): confidence level; defaults to 0.05, must satisfy 0 < alpha < 1.

Results are returned under values.kmResultList.values, one entry per query in request order; each entry is an object keyed by group name whose value is the prediction DataFrame.

Authorization

SymetryMLAuth
AuthorizationBearer <token>

HMAC-SHA256 signature-based authentication: requests are signed with your secret key and sent with the Customer-ID, Sym-date, Authorization, Content-MD5 and sym-version headers. See SymetryML REST API Security for the signature algorithm and a complete example.

In: header

Path Parameters

user*string

User/Customer identifier

project*string

Project identifier

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/c1/projects/nbra_prj_iris/km/kaplanmeier" \  -H "Content-Type: application/json" \  -d '{    "values": [      {        "type": "survival",        "alpha": 0.05,        "group": "1",        "times": [          200,          300,          400        ]      }    ]  }'

{  "statusCode": 200,  "statusString": "OK",  "values": {    "kmResultList": {      "values": [        {          "1": {            "attributeNames": [              "time",              "at_risk",              "survival_func",              "[0.025",              "0.975]",              "standard_error"            ],            "attributeTypes": [              "C",              "C",              "C",              "C",              "C",              "C"            ],            "data": [              [                "200.0",                "44.0",                "0.6757943143812709",                "0.5533509863469374",                "0.7714412160458454",                "0.055692452940644885"              ],              [                "300.0",                "31.0",                "0.5745395107073258",                "0.44659154603018103",                "0.6831826900604641",                "0.06087440933741857"              ],              [                "400.0",                "20.0",                "0.402177657495128",                "0.2768046952002437",                "0.5241715357597271",                "0.06423752380435209"              ]            ]          }        }      ]    }  }}

{  "statusCode": 400,  "statusString": "java.lang.IllegalArgumentException: Query type not specified",  "values": {}}