sksurv.functions.StepFunction#

class sksurv.functions.StepFunction(x, y, *, a=1.0, b=0.0, domain=(0, None))[source]#

Callable step function.

\[f(z) = a * y_i + b, x_i \leq z < x_{i + 1}\]
Parameters:
  • x (ndarray, shape = (n_points,)) – Values on the x axis in ascending order.

  • y (ndarray, shape = (n_points,)) – Corresponding values on the y axis.

  • a (float, optional, default: 1.0) – Constant to multiply by.

  • b (float, optional, default: 0.0) – Constant offset term.

  • domain (tuple, optional) – A tuple with two entries that sets the limits of the domain of the step function. If entry is None, use the first/last value of x as limit.

__init__(x, y, *, a=1.0, b=0.0, domain=(0, None))[source]#

Methods

__init__(x, y, *[, a, b, domain])

Attributes

domain

Returns the domain of the function, that means the range of values that the function accepts.

property domain#

Returns the domain of the function, that means the range of values that the function accepts.

Returns:

  • lower_limit (float) – Lower limit of domain.

  • upper_limit (float) – Upper limit of domain.