VIPRSGridSearch
VIPRSGridSearch
¶
Bases: VIPRSGrid
The VIPRSGridSearch
class is an extension of the VIPRSGrid
class that
implements grid search for the VIPRS
models. The grid search procedure
fits multiple models to the data, each with different hyperparameters,
and selects the best model based on user-defined criteria.
The criteria supported are:
ELBO
: The model with the highest ELBO is selected.validation
: The model with the highest R^2 on the validation set is selected.pseudo_validation
: The model with the highest pseudo-validation R^2 is selected.
Note that the validation
and pseudo_validation
criteria require the user to provide
validation data in the form of paired genotype/phenotype data or external GWAS summary
statistics.
Source code in viprs/model/gridsearch/VIPRSGridSearch.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
__init__(gdl, grid, **kwargs)
¶
Initialize the VIPRSGridSearch
model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gdl |
An instance of |
required | |
grid |
An instance of |
required | |
kwargs |
Additional keyword arguments to pass to the parent |
{}
|
Source code in viprs/model/gridsearch/VIPRSGridSearch.py
select_best_model(validation_gdl=None, criterion='ELBO')
¶
From the grid of models that were fit to the data, select the best
model according to the specified criterion
. If the criterion is the ELBO,
the model with the highest ELBO will be selected. If the criterion is
validation or pseudo-validation, the model with the highest R^2 on the
validation set will be selected.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validation_gdl |
An instance of |
None
|
|
criterion |
The criterion for selecting the best model. Options are: ( |
'ELBO'
|