disectModel | R Documentation |
This function dissects a model by separating its positive and negative coefficients, calculates the corresponding scores for each group (positive and negative coefficients), and normalizes them. It also provides a plot showing the composition of the score.
disectModel(mod, X, y, clf, plot = TRUE)
mod |
A valid model object. |
X |
The matrix of features (design matrix). |
y |
The class labels (response variable). |
clf |
The classifier used (not currently utilized in the function). |
plot |
Logical, if 'TRUE', a plot will be generated showing the score composition and a classification of samples based on the score. |
The function works by first identifying the positive and negative coefficients from the model. It then calculates the corresponding scores for both the positive and negative coefficients. The scores are normalized by dividing each score by the total sum of the scores. Finally, the function provides an optional plot that visualizes the score composition.
The plot shows:
A barcode plot of the score composition.
A classification of the samples according to the model's score with the intercept line.
A list containing the following components:
The provided model.
The response variable.
A matrix containing positive, negative, and raw scores.
Normalized scores.
Edi Prifti (IRD)
## Not run:
# Assuming `mod`, `X`, and `y` are already defined
dissectResult <- disectModel(mod = mod, X = X, y = y, plot = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.