Skip to content

Final model: save feature names for interpretability #234

@JudithBernett

Description

@JudithBernett

If a final model is produced, it can be loaded like:

from drevalpy.models import MODEL_FACTORY
enet_class = MODEL_FACTORY["ElasticNet"]
enet = enet_class.load("path/to/final_model")
enet_model = enet.model
print(enet_model.coef_)

Sklearn models have the option of saving feature_names_in_ when X in fit() has str names. In the gene expression-based models, we select the features with the gene list so at least it's possible to reconstruct the features. In the proteomics models and multi-omics models, it's variable.
Same for MOLIR, SuperFELTR which use the VarianceSelector.
Overall, it would probably be nice and reproducible to save the names and order of the input matrix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions