CellPhenoX Module¶
CellPhenoX Class¶
- class pyCellPhenoX.CellPhenoX(X, y, CV_repeats, outer_num_splits, inner_num_splits)¶
Bases:
object- __init__(X, y, CV_repeats, outer_num_splits, inner_num_splits)¶
_summary_
- Parameters:
X (dataframe) – cell by latent dimensions dataframe
y (series) – the target variable
CV_repeats (int) – number of times to repeat the cross-validation
outer_num_splits (int) – number of outer folds (stratified k fold)
inner_num_splits (int) – number of inner folds (for hyperparameter tuning)
- get_best_model()¶
- get_best_score()¶
- get_interpretable_score()¶
- get_model_training_time()¶
- get_prc_curves()¶
- get_roc_curves()¶
- get_shap_values(outpath)¶
- get_shap_values_per_cv()¶
- model_training_shap_val(fast, outpath)¶
Train the model using nested cross validation strategy and generate shap values for each fold/CV repeat
Parameters: fast (bool): whether to use the fasttreeshap package or the shap package outpath (str): the path for the output folder
Returns:
- shap_values_explainer(model, X, fast=True, n_jobs=-1)¶
- split_data(train_outer_ix, test_outer_ix)¶