plotFeatureModelCoeffs | R Documentation |
This function visualizes the coefficients of features across different models in a heatmap-style plot. It allows for customized ordering of the features and models, and it supports vertical or horizontal axis labels.
plotFeatureModelCoeffs(
feat.model.coeffs,
topdown = TRUE,
main = "",
col = c("deepskyblue1", "white", "firebrick1"),
vertical.label = TRUE
)
feat.model.coeffs |
A matrix or data frame where rows represent features, and columns represent models. The values in the matrix correspond to the coefficients of the features in each model. |
topdown |
Logical; if 'TRUE', the features will be arranged from top to bottom in the plot. If 'FALSE', the original order is preserved. |
main |
A string for the title of the plot. |
col |
A vector of colors for the heatmap. Default is 'c("deepskyblue1", "white", "firebrick1")'. |
vertical.label |
Logical; if 'TRUE', the feature labels on the y-axis will be rotated vertically. |
The function generates a heatmap-style plot of feature coefficients across multiple models. The color intensity represents the coefficient values, with positive values shown in one color, negative values in another, and zeros in a neutral color. The function supports customization of the plot layout and label orientation.
The 'topdown' argument controls the ordering of the features in the plot. When set to 'TRUE', the features are arranged in reverse order, and if set to 'FALSE', the original order is maintained. The function also allows the user to rotate the feature labels vertically if needed.
A 'ggplot' object displaying the heatmap of feature coefficients across models.
Edi Prifti (IRD)
# Example usage
features <- c("feature1", "feature2", "feature3")
models <- c("model1", "model2", "model3")
coeffs <- matrix(runif(9), nrow = 3, ncol = 3)
rownames(coeffs) <- features
colnames(coeffs) <- models
# Plot feature model coefficients
plotFeatureModelCoeffs(coeffs, main = "Feature Coefficients Heatmap")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.