logml.survival_analysis.handlers.cox

Classes

CoxArtifactsHandler(cfg, sa_setup, ...[, logger])

Implements backward-forward Cox regression.

class logml.survival_analysis.handlers.cox.CoxArtifactsHandler(cfg: GlobalConfig, sa_setup: SurvivalAnalysisSetup, global_params: dict, output_structure: logml.survival_analysis.CoxSAOutputStructure, logger=None)

Bases: object

Implements backward-forward Cox regression.

LABEL = 'cox'
set_target_columns(target_columns: List[str])

Sets a list of target columns for Cox.

set_cutoff_mapping(cutoff_mapping: Dict[str, float])

Sets optimal cut-offs mapping.

initialize_dataset()

Creates a survival dataset and adjusts it based on a given parameters.

The preprocessing pipeline is adjusted to include the following steps:
  • select only target features + survival target

  • normalize numericals, if needed

  • one-hot encoding for categoricals

  • missing values imputation

backward_path()

Iteratively removes features from Cox model until all features are significant.

forward_path()

Iteratively trying to add removed features back and keep the Cox model significant.

dump_artifacts()

Saves Cox model and history summary.