Binary Prediction¶
Prediction of binary classes such as tumor vs. normal patients.
Elastic Net regression with nested cross validation module.
This workflow trains an elastic net model for a binary classification task (e.g., tumor vs. normal patients). The training is conducted using a nested cross validation approach (the number of cross validation in both loops can be selected). The model used can be easily changed since most of the models in scikit-learn (the machine learning library used by this package) required the same input.
-
pathway_forte.prediction.binary.
ssgsea_nes_to_df
(ssgsea_scores_csv, classes_file, removed_random=None)[source]¶ Create dataFrame of Normalized Enrichment Scores (NES) from ssGSEA of TCGA expression data.
-
pathway_forte.prediction.binary.
get_l1_ratios
()[source]¶ Return a list of values that are used by the elastic net as hyperparameters.
-
pathway_forte.prediction.binary.
train_elastic_net_model
(x, y, outer_cv_splits, inner_cv_splits, l1_ratio, model_name, max_iter=None, export=True)[source]¶ Train elastic net model via a nested cross validation given expression data.
Uses a defined hyperparameter space for l1_ratio.
- Parameters
x (numpy.array) – 2D matrix of pathway scores and samples
y (list) – class labels of samples
outer_cv_splits (
int
) – number of folds for cross validation split in outer loopinner_cv_splits (
int
) – number of folds for cross validation split in inner loopl1_ratio (
List
[float
]) – list of hyper-parameters for l1 and l2 priorsmodel_name (
str
) – name of the modelmax_iter (
Optional
[int
]) – default to 1000 to ensure convergenceexport (
bool
) – Export the models usingjoblib
- Return type
- Returns
A list of AUC-ROC scores