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: TrainMLModelState, train_val_dataset: Dataset, test_dataset: Dataset, hp_setting: HPSetting, path: Path, label: Label, split_index: int) TrainMLModelState[source]

retrain model for specific label, assessment split and hp_setting

static run_assessment(state: 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: TrainMLModelState, split_index: int)[source]

iterate through labels and hp_settings and retrain all models

static update_hp_setting_for_assessment(hp_setting: HPSetting, state: TrainMLModelState, split_index: int, label_name: str)[source]

immuneML.hyperparameter_optimization.core.HPSelection module

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

Bases: object

static create_selection_path(state: TrainMLModelState, current_path: Path) Path[source]
static evaluate_hp_setting(state: TrainMLModelState, hp_setting: HPSetting, train_datasets: list, val_datasets: list, current_path: Path, label: Label, assessment_split_index: int)[source]
static run_selection(state: TrainMLModelState, train_val_dataset, current_path: Path, split_index: int) TrainMLModelState[source]
static run_setting(state: TrainMLModelState, hp_setting, train_dataset, val_dataset, split_index: int, current_path: Path, label: Label, assessment_index: int)[source]
static update_split_count(state: 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: Path, test_predictions_path: Path, label: Label, ml_score_path: Path)[source]
static encode_dataset(dataset, hp_setting: HPSetting, path: Path, learn_model: bool, context: dict, number_of_processes: int, label_configuration: LabelConfiguration, encode_labels: bool = True, sequence_type: SequenceType = SequenceType.AMINO_ACID, region_type: RegionType = RegionType.IMGT_CDR3)[source]
static get_average_performance(performances)[source]
static preprocess_dataset(dataset: Dataset, preproc_sequence: list, path: Path, context: dict = None, hp_setting: HPSetting = None, number_of_processes: int = 1) Dataset[source]
static run_hyperparameter_reports(state: TrainMLModelState, path: Path) List[ReportResult][source]
static run_selection_reports(state: TrainMLModelState, dataset, train_datasets: list, val_datasets: list, selection_state: HPSelectionState)[source]
static split_data(dataset: Dataset, split_config: SplitConfig, path: Path, label_config: LabelConfiguration) tuple[source]
static weight_examples(dataset, weighting_strategy: ExampleWeightingStrategy, path: Path, learn_model: bool, number_of_processes: int)[source]

Module contents