tick.survival.ModelSCCS

class tick.survival.ModelSCCS(n_intervals: int, n_lags: array)[source]

Discrete-time Self Control Case Series (SCCS) likelihood. This class provides first order information (gradient and loss) model.

Parameters:

n_intervals : int

Number of time intervals observed for each sample.

n_lags : numpy.ndarray, shape=(n_features,), dtype=”uint64”

Number of lags per feature. The model will regress labels on the last observed values of the features over the corresponding n_lags time intervals. n_lags values must be between 0 and n_intervals - 1.

Attributes:

features : list of numpy.ndarray or list of scipy.sparse.csr_matrix,

list of length n_cases, each element of the list of shape=(n_intervals, n_features) The list of features matrices.

labels : list of numpy.ndarray,

list of length n_cases, each element of the list of shape=(n_intervals,) The labels vector

censoring : numpy.ndarray, shape=(n_cases,), dtype=”uint64”

The censoring data. This array should contain integers in [1, n_intervals]. If the value i is equal to n_intervals, then there is no censoring for sample i. If censoring = c < n_intervals, then the observation of sample i is stopped at interval c, that is, the row c - 1 of the corresponding matrix. The last n_intervals - c rows are then set to 0.

n_cases : int (read-only)

Number of samples

n_features : int (read-only)

Number of features

n_coeffs : int (read-only)

Total number of coefficients of the model