tempor.methods.time_to_event package¶
Submodules¶
- tempor.methods.time_to_event.helper_embedding module
- tempor.methods.time_to_event.plugin_ddh module
- tempor.methods.time_to_event.plugin_ts_coxph module
- tempor.methods.time_to_event.plugin_ts_coxph.monkeypatch_lifelines_pd2_compatibility
- tempor.methods.time_to_event.plugin_ts_coxph.CoxPHTimeToEventAnalysisParams
- tempor.methods.time_to_event.plugin_ts_coxph.drop_constant_columns
- tempor.methods.time_to_event.plugin_ts_coxph.CoxPHSurvivalAnalysis
- tempor.methods.time_to_event.plugin_ts_coxph.CoxPHTimeToEventAnalysis
- tempor.methods.time_to_event.plugin_ts_xgb module
- tempor.methods.time_to_event.plugin_ts_xgb.monkeypatch_xgbse_xgboost2_compatibility
- tempor.methods.time_to_event.plugin_ts_xgb.XGBTimeToEventAnalysisParams
- xgb_n_estimators
- xgb_colsample_bynode
- xgb_colsample_bytree
- xgb_colsample_bylevel
- xgb_max_depth
- xgb_subsample
- xgb_learning_rate
- xgb_min_child_weight
- xgb_tree_method
- xgb_booster
- xgb_objective
- xgb_strategy
- xgb_bce_n_iter
- xgb_time_points
- xgb_reg_lambda
- xgb_reg_alpha
- n_iter
- batch_size
- lr
- n_layers_hidden
- n_units_hidden
- split
- rnn_mode
- alpha
- beta
- sigma
- dropout
- device
- val_size
- patience
- output_mode
- random_state
- tempor.methods.time_to_event.plugin_ts_xgb.XGBSurvivalAnalysis
- tempor.methods.time_to_event.plugin_ts_xgb.XGBTimeToEventAnalysis
Module contents¶
Time-to-event (survival) analysis methods.
- class tempor.methods.time_to_event.BaseTimeToEventAnalysis(**params: Any)[source]¶
Bases:
BasePredictorAbstract base class for all predictors.
Defines some core methods, primarily: -
predict: Predicts the target variable for the given data. -predict_proba: Predicts the probability of the target variable for the given data. -predict_counterfactuals: Predicts the counterfactuals for the given data. - The_versions of the above methods are the implementations of the above methods in the derived classes.- fit(data: BaseDataset, *args: Any, **kwargs: Any) Self[source]¶
Fit the method to the data.
- Parameters:¶
- data : dataset.BaseDataset¶
The dataset to fit the model to.
- *args : Any
Additional arguments to pass to the
_fitmethod.- **kwargs : Any
Additional keyword arguments to pass to the
_fitmethod.
- Returns:¶
The fitted model.
- Return type:¶
Self
- predict(data: PredictiveDataset, horizons: list[float] | list[int] | list[Timestamp], *args, **kwargs) TimeSeriesSamplesBase[source]¶
Predict risk scores for the given data. Output is risk scores at time points, hence
samples.TimeSeriesSamplesBase.- Parameters:¶
- data : dataset.PredictiveDataset¶
Dataset to predict on. Should be
dataset.TimeToEventAnalysisDataset.- horizons : data_typing.TimeIndex¶
Time points to predict at.
- *args
Additional arguments.
- **kwargs
Additional keyword arguments.
- Returns:¶
Predicted risk scores at the given time points.
- Return type:¶