immuneML.workflows.instructions.train_gen_model package

Submodules

immuneML.workflows.instructions.train_gen_model.TrainGenModelInstruction module

class immuneML.workflows.instructions.train_gen_model.TrainGenModelInstruction.TrainGenModelInstruction(dataset: Dataset = None, method: GenerativeModel = None, number_of_processes: int = 1, gen_examples_count: int = 100, result_path: Path = None, name: str = None, reports: list = None, export_generated_dataset: bool = True, export_combined_dataset: bool = False, training_percentage: float = None)[source]

Bases: GenModelInstruction

TrainGenModel instruction implements training generative AIRR models on receptor level. Models that can be trained for sequence generation are listed under Generative Models section.

This instruction takes a dataset as input which will be used to train a model, the model itself, and the number of sequences to generate to illustrate the applicability of the model. It can also produce reports of the fitted model and reports of original and generated sequences.

To use the generative model previously trained with immuneML, see ApplyGenModel instruction.

Specification arguments:

  • dataset: dataset to use for fitting the generative model; it has to be defined under definitions/datasets

  • method: which model to fit (defined previously under definitions/ml_methods)

  • number_of_processes (int): how many processes to use for fitting the model

  • gen_examples_count (int): how many examples (sequences, repertoires) to generate from the fitted model

  • reports (list): list of report ids (defined under definitions/reports) to apply after fitting a generative model and generating gen_examples_count examples; these can be data reports (to be run on generated examples), ML reports (to be run on the fitted model)

YAML specification:

instructions:
    my_train_gen_model_inst: # user-defined instruction name
        type: TrainGenModel
        dataset: d1 # defined previously under definitions/datasets
        model: model1 # defined previously under definitions/ml_methods
        gen_examples_count: 100
        number_of_processes: 4
        training_percentage: 0.7
        export_generated_dataset: True
        export_combined_dataset: False
        reports: [data_rep1, ml_rep2]
MAX_ELEMENT_COUNT_TO_SHOW = 10
run(result_path: Path) TrainGenModelState[source]
class immuneML.workflows.instructions.train_gen_model.TrainGenModelInstruction.TrainGenModelState(result_path: pathlib.Path = None, name: str = None, gen_examples_count: int = None, model_path: pathlib.Path = None, generated_dataset: immuneML.data_model.datasets.Dataset.Dataset = None, exported_datasets: Dict[str, pathlib.Path] = <factory>, report_results: Dict[str, List[immuneML.reports.ReportResult.ReportResult]] = <factory>, combined_dataset: immuneML.data_model.datasets.Dataset.Dataset = None, train_dataset: immuneML.data_model.datasets.Dataset.Dataset = None, test_dataset: immuneML.data_model.datasets.Dataset.Dataset = None, training_percentage: float = None)[source]

Bases: object

combined_dataset: Dataset = None
exported_datasets: Dict[str, Path]
gen_examples_count: int = None
generated_dataset: Dataset = None
model_path: Path = None
name: str = None
report_results: Dict[str, List[ReportResult]]
result_path: Path = None
test_dataset: Dataset = None
train_dataset: Dataset = None
training_percentage: float = None

Module contents