Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.
biolearn.model_gallery.ModelGallery#
- class biolearn.model_gallery.ModelGallery(models=model_definitions)#
ModelGallery manages a collection of Models that can be run on biological data to produce predictions. It supports retrieving models by name with various imputation methods, and searching models based on species or tissue.
- __init__(models=model_definitions)#
Initializes the ModelGallery instance.
- Parameters:
models (dict) – A dictionary of model definitions.
- model_builders = {'DeconvolutionModel': <bound method DeconvolutionModel.from_definition of <class 'biolearn.model.DeconvolutionModel'>>, 'GrimageModel': <bound method GrimageModel.from_definition of <class 'biolearn.model.GrimageModel'>>, 'LinearMethylationModel': <bound method LinearModel.from_definition of <class 'biolearn.model.LinearMethylationModel'>>, 'LinearTranscriptomicModel': <bound method LinearModel.from_definition of <class 'biolearn.model.LinearTranscriptomicModel'>>, 'SexEstimationModel': <bound method SexEstimationModel.from_definition of <class 'biolearn.model.SexEstimationModel'>>}#
- get(name, imputation_method=None)#
Retrieves a model by its name with a specified imputation method to handle missing data.
- Parameters:
- Returns:
The requested model instance, possibly enhanced with an imputation strategy if specified.
- Return type:
- Raises:
KeyError – If the model with the specified name is not found in the library.
ValueError – If an invalid imputation method is specified.
- Available imputation_method selections are:
“none”: No imputation is applied.
“averaging”: Imputes missing values by calculating the average of data in the input set.
“dunedin”: Uses hybrid_impute with the dunedinPACE gold standard values.
“sesame_450k”: Uses hybrid_impute with the sesame 450k gold standard values.
If no imputation method is selected then the default imputation method specified within the model’s definition is used.
Examples using biolearn.model_gallery.ModelGallery
#
Building a competition submission using an existing model