Package 'caretS3'

Title: A Minimal S3 Interface to 'caret' Models Without Resampling
Description: Fits any 'caret' model on a matrix/data frame of predictors and a response, with fixed hyperparameters (no cross-validation), and exposes the result through standard S3 methods: predict(), print(), coef().
Authors: Thierry Moudiki [aut, cre]
Maintainer: Thierry Moudiki <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-10-25 17:04:55 UTC
Source: https://github.com/thierrymoudiki/caretS3

Help Index


Fit a caret model with fixed hyperparameters (no resampling)

Description

Fit a caret model with fixed hyperparameters (no resampling)

Usage

caretS3(x, y, method = "glmnet", ..., train_args = list())

Arguments

x

Matrix or data frame of predictors.

y

Response vector (numeric for regression, factor for classification).

method

Any model name accepted by caret::train (e.g. "glmnet", "rf", "svmRadial").

...

Hyperparameters for method, passed as a one-row tuneGrid (e.g. alpha = 0.5, lambda = 0.1 for "glmnet").

train_args

Named list of extra arguments for caret::train (e.g. list(preProcess = c("center", "scale"))).

Value

An object of class "caretS3".


Predict from a caretS3 model

Description

Predict from a caretS3 model

Usage

## S3 method for class 'caretS3'
predict(object, newx, type = c("raw", "prob"), ...)

Arguments

object

A caretS3 object.

newx

Matrix or data frame of new predictors, same columns as training.

type

"raw" (predictions/classes) or "prob" (class probabilities).

...

Unused.