
Normalize SHAP Values
normalize_shap_values.RdThis function takes a dataframe of SHAP values and normalizes them within each sample. The normalization is done by dividing the mean SHAP value of each variable by the sum of absolute mean SHAP values for that sample, resulting in a 'norm_shap' value that represents the relative importance of each gene within that sample.