Skip to contents

Estimates the nonlinear R2 from a machine learning model compared to a `feature_data` object.

Usage

rsquared(object, ...)

# S4 method for class 'feature_data'
rsquared(
  object,
  model,
  subset = c("all", "test", "train"),
  prep = c("both", "scale", "transform", "none"),
  ...
)

Arguments

object

A `feature_data` object.

...

Additional arguments passed down to `predict()`.

model

A fitted model object.

subset

Subset of the `preproc` dataset (`"all"`, `"train"`, or `"test"`).

prep

Character argument if transformed data ("transform"), scaled data ("scale"), transformed and scaled data ("both"), or original raw data ("none") will be returned.

Value

The coefficient of determination as an un-named scalar numeric value.

Methods (by class)

  • rsquared(feature_data): Method for estimating the coefficient of determination of a model for a `feature_data` object.