Skip to main content

Usage

The following examples show how the step can be used in a recipe.

Examples

  • Example 1
  • Example 2
  • Example 3
  • Signature
Without configuration, the median survival time is returned.
predict_survival(ds, "surv-model") -> (ds.median_survival_time)

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").
ds
dataset
required
Contains the target column and the rest of the columns you wish to use in the model.
model
file[model_survival[ds]]
required
File containing the model used to make the prediction.
predicted
column[number]
required
Column containing the model predictions.

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

kind
string
default:"median"
Kind of prediction. median returns the median survival time. percentile returns the survival time at the given percentile. expectation returns the expected survival time. survival_function returns the whole survival function (one series per sample).Values must be one of the following:
  • median
  • percentile
  • expectation
  • survival_function
percentile
number
default:"0.5"
Percentile when kind is set to percentileValues must be in the following range:
0percentile1
times
[array, object]
Points in time to predict. Configures at which points to predict when kind is set to survival_function. Either an explicit array of durations, or an object specifying a duration step size and maximum duration.
  • array
  • object
{_}
array[number]
array.
Item
number
Each item in array.
conditional_after
boolean
default:"false"
Whether to predict remaining time. Conditions the predictions on known durations. In other words, the prediction is made for each sample taking into account that the sample has survived up to the duration in this column, and the prediction is made for the remaining time. This applies only to censored samples, where the event has not been observed. If the event has already been observed, on the other hand, predicted remaining time will be 0 / null.To use this feature, the target parameter must also be provided to identify the event and duration columns in the dataset.
target
array
Target variables. Two names, exactly, corresponding to the target columns that contain in the following order:
  1. whether the event was observed (boolean) and
  2. the time (duration) to event or censoring (number).
Item 0
string (ds.column:boolean)
Item 1
string (ds.column:number)
I