immuneML.reports.gen_model_reports package

Submodules

immuneML.reports.gen_model_reports.GenModelReport module

class immuneML.reports.gen_model_reports.GenModelReport.GenModelReport(dataset: Dataset = None, model: GenerativeModel = None, result_path: Path = None, name: str = None)[source]

Bases: Report, ABC

Generative model reports show some type of features or statistics about a generative model.

DOCS_TITLE = 'Generative model reports'

immuneML.reports.gen_model_reports.VAESummary module

class immuneML.reports.gen_model_reports.VAESummary.VAESummary(dim_dist_rows: int, dim_dist_cols: int, dataset: Dataset = None, model: GenerativeModel = None, result_path: Path = None, name: str = None)[source]

Bases: GenModelReport

This report provides the summary of the train SimpleVAE and shows the following:

  • plots of the latent space after applying PCA to reduce the data to 2 dimensions, highlighted by V and J gene

  • plots the histogram for each latent dimension

  • plots loss per epoch

Specification arguments:

  • dim_dist_cols (int): how many columns to use to plot the histograms of latent dimensions (either this or dim_dist_rows has to be set, or both)

  • dim_dist_rows (int): how many rows to use to plot the histogram of latent dimensions (either this or dim_dist_cols has to be set, or both)

YAML specification:

definitions:
    reports:
        my_vae_summary:
            VAESummary:
                dim_dist_cols: 4
                dim_dist_rows: None
classmethod build_object(**kwargs)[source]

Creates the object of the subclass of the Report class from the parameters so that it can be used in the analysis. Depending on the type of the report, the parameters provided here will be provided in parsing time, while the other necessary parameters (e.g., subset of the data from which the report should be created) will be provided at runtime. For more details, see specific direct subclasses of this class, describing different types of reports.

Parameters:

**kwargs – keyword arguments that will be provided by users in the specification (if immuneML is used as a command line tool) or in the dictionary when calling the method from the code, and which should be used to create the report object

Returns:

the object of the appropriate report class

check_prerequisites() bool[source]

Checks prerequisites for the generation of the report of specific class (e.g., if the class of the MLMethod instance is the one required by the report, if the data has been encoded to make a report of encoded dataset). In the instructions in immuneML, this function is used to determine whether to call generate_report() in the specific situation. Each report subclass has its own set of prerequisites. If the report cannot be run, the information on this will be logged and the report skipped in the specific situation. No error will be raised. See subclasses of the class Instruction for more information on how the reports are executed.

Returns:

boolean value True if the prerequisites are o.k., and False otherwise.

Module contents