PLSA.qcal package¶
Submodules¶
PLSA.qcal.func module¶
Module for quick calling
The function of this Module is served for quick calling functions, and functions of other modules will be called by it.
-
PLSA.qcal.func.div_three_groups(data, pred_col, duration_col, event_col, cutoffs=None, methods='youden', pt=None, **kws)¶ Divide data into three groups using methods and summarize result.
Parameters: - data (pandas.DataFame) – Full survival data.
- pred_col (str) – Name of column to reference for dividing groups.
- duration_col (str) – Name of column indicating time.
- event_col (str) – Name of column indicating event.
- cutoffs (default None or tuple) – Given cutoffs for risk groups. If cutoffs is not None, then methods will not be called.
- methods (str) – Methods for selecting cutoffs, default “youden”.
- pt (int) – Predicted time.
Returns: Print summary of result and plot KM-curve of each groups.
Return type: Examples
>>> # Youden index to give cutoffs >>> div_three_groups(data, "X", "T", "E") >>> # Give cutoffs explicitly >>> div_three_groups(data, "X", "T", "E", cutoffs=(20, 50))
-
PLSA.qcal.func.surv_calibration(data, duration_col, event_col, pred_proba, pt=None, n_bins=10, xlabel='Predicted Risk Probability', ylabel='Observed Risk Probability', title='Model Performance', save_fig_as='')¶ Evaluate calibration of predicted survival probability at time pt.
Parameters: Returns: Print summary of result and plot curve of calibration.
Return type: Examples
>>> surv_calibration(data, "T", "E", surv_function[10], pt=10)
-
PLSA.qcal.func.surv_time_auc(data_train, data_test, pred_col, duration_col, event_col, pt=[], labels=['Train', 'Validation'], **kws)¶ Plot curve of auc at some predicted time.
Parameters: - data_train (pandas.DataFame) – Full survival data for train.
- data_test (pandas.DataFame) – Full survival data for test.
- pred_col (str) – Name of column indicating target value.
- duration_col (str) – Name of column indicating time.
- event_col (str) – Name of column indicating event.
- pt (list(int)) – Predicted time indicating list of watching.
Returns: Print summary of result and plot curve of auc with time.
Return type: Examples
>>> surv_time_auc(train_data, test_data, 'X', 'T', 'E', pt=[1, 3, 5, 10])