disectModel: Dissects the model by separating positive and negative...

View source: R/global.visu.R

disectModelR Documentation

Dissects the model by separating positive and negative coefficients

Description

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.

Usage

disectModel(mod, X, y, clf, plot = TRUE)

Arguments

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.

Details

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.

Value

A list containing the following components:

mod

The provided model.

y

The response variable.

scores

A matrix containing positive, negative, and raw scores.

scores.norm

Normalized scores.

Author(s)

Edi Prifti (IRD)

Examples

## Not run: 
# Assuming `mod`, `X`, and `y` are already defined
dissectResult <- disectModel(mod = mod, X = X, y = y, plot = TRUE)

## End(Not run)


predomics/predomicspkg documentation built on Dec. 11, 2024, 11:06 a.m.