Skip to contents

This function returns the total number of components in the fitted model.

Usage

ncomp(x)

Arguments

x

A fitted model object.

Value

The number of components in the fitted model.

Examples

# Example using the svd_wrapper function
data(iris)
X <- iris[, 1:4]
fit <- svd_wrapper(X, ncomp = 3, preproc = center(), method = "base")
#> Error in init_transform.pre_processor(fitted_proc, X): `X` must be an matrix.
ncomp(fit) # Should return 3
#> Error in UseMethod("ncomp"): no applicable method for 'ncomp' applied to an object of class "function"