immuneML.hyperparameter_optimization.core package

Submodules

immuneML.hyperparameter_optimization.core.HPAssessment module

class immuneML.hyperparameter_optimization.core.HPAssessment.HPAssessment[source]

Bases: object

static create_assessment_path(state, split_index)[source]
static reeval_on_assessment_split(state, train_val_dataset: immuneML.data_model.dataset.Dataset.Dataset, test_dataset: immuneML.data_model.dataset.Dataset.Dataset, hp_setting: immuneML.hyperparameter_optimization.HPSetting.HPSetting, path: pathlib.Path, label: immuneML.environment.Label.Label, split_index: int) immuneML.ml_methods.MLMethod.MLMethod[source]

retrain model for specific label, assessment split and hp_setting

static run_assessment(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState) immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState[source]
static run_assessment_split(state, train_val_dataset, test_dataset, split_index: int, n_splits)[source]

run inner CV loop (selection) and retrain on the full train_val_dataset after optimal model is chosen

static run_assessment_split_per_label(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, split_index: int)[source]

iterate through labels and hp_settings and retrain all models

immuneML.hyperparameter_optimization.core.HPSelection module

class immuneML.hyperparameter_optimization.core.HPSelection.HPSelection[source]

Bases: object

static create_selection_path(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, current_path: pathlib.Path) pathlib.Path[source]
static evaluate_hp_setting(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, hp_setting: immuneML.hyperparameter_optimization.HPSetting.HPSetting, train_datasets: list, val_datasets: list, current_path: pathlib.Path, label: immuneML.environment.Label.Label, assessment_split_index: int)[source]
static run_selection(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, train_val_dataset, current_path: pathlib.Path, split_index: int) immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState[source]
static run_setting(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, hp_setting, train_dataset, val_dataset, split_index: int, current_path: pathlib.Path, label: immuneML.environment.Label.Label, assessment_index: int)[source]
static update_split_count(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, train_val_dataset)[source]

immuneML.hyperparameter_optimization.core.HPUtil module

class immuneML.hyperparameter_optimization.core.HPUtil.HPUtil[source]

Bases: object

static assess_performance(method, metrics, optimization_metric, dataset, split_index, current_path: pathlib.Path, test_predictions_path: pathlib.Path, label: immuneML.environment.Label.Label, ml_score_path: pathlib.Path)[source]
static encode_dataset(dataset, hp_setting: immuneML.hyperparameter_optimization.HPSetting.HPSetting, path: pathlib.Path, learn_model: bool, context: dict, number_of_processes: int, label_configuration: immuneML.environment.LabelConfiguration.LabelConfiguration, encode_labels: bool = True)[source]
static get_average_performance(performances)[source]
static preprocess_dataset(dataset: immuneML.data_model.dataset.Dataset.Dataset, preproc_sequence: list, path: pathlib.Path, context: Optional[dict] = None, hp_setting: Optional[immuneML.hyperparameter_optimization.HPSetting.HPSetting] = None) immuneML.data_model.dataset.Dataset.Dataset[source]
static run_hyperparameter_reports(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, path: pathlib.Path) List[immuneML.reports.ReportResult.ReportResult][source]
static run_selection_reports(state: immuneML.hyperparameter_optimization.states.TrainMLModelState.TrainMLModelState, dataset, train_datasets: list, val_datasets: list, selection_state: immuneML.hyperparameter_optimization.states.HPSelectionState.HPSelectionState)[source]
static split_data(dataset: immuneML.data_model.dataset.Dataset.Dataset, split_config: immuneML.hyperparameter_optimization.config.SplitConfig.SplitConfig, path: pathlib.Path, label_config: immuneML.environment.LabelConfiguration.LabelConfiguration) tuple[source]
static train_method(label: immuneML.environment.Label.Label, dataset, hp_setting: immuneML.hyperparameter_optimization.HPSetting.HPSetting, path: pathlib.Path, train_predictions_path, ml_details_path, cores_for_training, optimization_metric) immuneML.ml_methods.MLMethod.MLMethod[source]

Module contents