cox_regression.config module
Configuration parsing and storage for logistic regression
- class cox_regression.config.Config(clients, server, data_columns, target_column, intercept, n_epochs, learning_rate, hessian, time_column, n_bins)[source]
Bases:
Config
The configuration of the experiment. Contains all attributes of the logistic regression config together with:
- Parameters:
time_column (
str
) – The column containing event/censoring timesn_bins (
int
) – The number of bins to use in stacking
- __init__(clients, server, data_columns, target_column, intercept, n_epochs, learning_rate, hessian, time_column, n_bins)[source]
Forwards initialization arguments to parent class.
- static from_file(config_path)[source]
Create config from config file
- Parameters:
config_path (
Path
) – The path to the file- Return type:
- Returns:
The configuration according to config file
-
n_bins:
int
-
time_column:
str
- class cox_regression.config.ConfigParser(config_file_path)[source]
Bases:
ConfigParser
Parser for cox regression config file.
- Parameters:
EXPERIMENT_TIME_COLUMN_KEY – Key for which column contains event/censoring times
EXPERIMENT_N_BINS_KEY – Key for number of bins
- EXPERIMENT_N_BINS_COLUMN_KEY = 'n_bins'
- EXPERIMENT_TIME_COLUMN_KEY = 'time_column'
- __init__(config_file_path)[source]
Load the config file and parse the objects variables from the file.
- Parameters:
config_file_path (
Path
) – The path to the config file
- parse_intercept()[source]
In cox regression, an intercept is never used.
- Return type:
bool
- Returns:
False, indicating no intercept is used.
- parse_n_bins()[source]
Parse the number of bins to use in stacking.
- Return type:
int
- Returns:
the number of bins
- Raises:
ValueError – if the number of bins is nonpositive