Title: | Common S3 Generics not Provided by Base R Methods Related to Model Fitting |
---|---|
Description: | In order to reduce potential package dependencies and conflicts, generics provides a number of commonly used S3 generics. |
Authors: | Hadley Wickham [aut, cre], Max Kuhn [aut], Davis Vaughan [aut], Posit Software, PBC [cph, fnd] |
Maintainer: | Hadley Wickham <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.3.9000 |
Built: | 2024-12-04 05:57:53 UTC |
Source: | https://github.com/r-lib/generics |
Returns range of summary measures of the forecast accuracy.
accuracy(object, ...)
accuracy(object, ...)
object |
A model for which forecasts are required. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Augment data with information from an object
augment(x, ...)
augment(x, ...)
x |
Model object or other R object with information to append to observations. |
... |
Addition arguments to |
A tibble::tibble()
with information about data points.
No methods found in currently loaded packages.
Calculate statistics.
calculate(x, ...)
calculate(x, ...)
x |
An object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Coercion functions for creating factors from other existing objects.
as.factor(x, ...) as.ordered(x, ...)
as.factor(x, ...) as.ordered(x, ...)
x |
A vector of data. |
... |
Other arguments passed on to methods. |
These functions override non-generic factor coercion functions provided in base so that packages can provide methods for different data types. The default methods call the base versions.
For as.factor()
, a factor. For as.ordered()
,
an ordered factor.
as.factor()
No methods found in currently loaded packages.
as.ordered()
No methods found in currently loaded packages.
as.factor(letters[1:5]) as.ordered(letters[1:5])
as.factor(letters[1:5]) as.ordered(letters[1:5])
Coercion functions for creating difftime
objects from other
existing objects.
as.difftime(tim, ...) ## Default S3 method: as.difftime(tim, format = "%X", units = "auto", ...)
as.difftime(tim, ...) ## Default S3 method: as.difftime(tim, format = "%X", units = "auto", ...)
tim |
A vector specifying a time interval. |
... |
Other arguments passed on to methods. |
format |
A single character specifying the format of |
units |
A single character specifying units in which the results are
desired. Required if |
This function overrides the non-generic as.difftime()
function
provided in base so that packages can provide methods for different data
types. The default method call the base version.
A difftime
object with an attribute indicating the units.
See the following help topics for more details about individual methods:
generics
coercion-time-difference
: default
as.difftime(1:5, units = "secs") as.difftime(c("01:55:22", "01:55:25")) as.difftime("01", format = "%H") as.difftime("01", format = "%H", units = "secs")
as.difftime(1:5, units = "secs") as.difftime(c("01:55:22", "01:55:25")) as.difftime("01", format = "%H") as.difftime("01", format = "%H", units = "secs")
Finalizes or completes an object.
compile(object, ...)
compile(object, ...)
object |
An object. See the individual method for specifics. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
components
can be used to extract elements from an object.
components(object, ...)
components(object, ...)
object |
A data separable object. |
... |
Other arguments passed to methods |
For example, decomposition methods and some modelling techniques can be used to decompose a dataset into components of interest. This function is used to extract these components in a tidy data format.
A dataset (tibble::tibble()
or similar) containing components from
the object.
No methods found in currently loaded packages.
Display the mathematical representation of a fitted model.
equation(object, ...)
equation(object, ...)
object |
A fitted model object. |
... |
Other arguments passed to methods |
Markup output suitable for rendering the equation.
No methods found in currently loaded packages.
Extracting the estimating functions of a fitted model.
estfun(x, ...)
estfun(x, ...)
x |
A fitted model object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Evaluate an object.
evaluate(x, ...)
evaluate(x, ...)
x |
An object. See the individual method for specifics. |
... |
other arguments passed to methods |
No methods found in currently loaded packages.
Explain details of an object
explain(x, ...)
explain(x, ...)
x |
An object. See the individual method for specifics. |
... |
other arguments passed to methods |
No methods found in currently loaded packages.
explore()
invokes a function that starts an interactive, pre-defined widget
(e.g. plotly
visualization, shiny
app, etc.) to investigate the results.
explore(x, ...)
explore(x, ...)
x |
A object |
... |
Other arguments passed to methods |
NULL
(invisibly) or some other data type (e.g. tibble) depending on
the application.
No methods found in currently loaded packages.
Estimates parameters for a given model from a set of data.
fit(object, ...)
fit(object, ...)
object |
An object. See the individual method for specifics. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Estimates parameters for a given model from a set of data in the form of
a set of predictors (x
) and outcome(s) (y
).
fit_xy(object, ...)
fit_xy(object, ...)
object |
An object. See the individual method for specifics. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
The functions allow producing forecasts based on the provided object.
forecast(object, ...)
forecast(object, ...)
object |
A model for which forecasts are required. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Generate values based on inputs
generate(x, ...)
generate(x, ...)
x |
An object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Construct a single row summary "glance" of a model, fit, or other object
glance(x, ...)
glance(x, ...)
x |
model or other R object to convert to single-row data frame |
... |
other arguments passed to methods |
glance methods always return either a one-row data frame (except on
NULL
, which returns an empty data frame)
No methods found in currently loaded packages.
Construct hypotheses.
hypothesize(x, ...)
hypothesize(x, ...)
x |
An object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Interpolates missing values provided in the training dataset using the fitted model.
interpolate(object, ...)
interpolate(object, ...)
object |
A fitted model object |
... |
Other arguments passed to methods |
A dataset (tibble::tibble()
or similar) of the same structure as
the input dataset with missing values from the response variable replaced
with interpolated values.
No methods found in currently loaded packages.
Estimates parameters for a given model from a set of data.
learn(x, ...)
learn(x, ...)
x |
An object. See the individual method for specifics. |
... |
other arguments passed to methods |
No methods found in currently loaded packages.
min_grid()
determines exactly what models should be fit in order to
evaluate the entire set of tuning parameter combinations. This is for
internal use only and the API may change in the near future.
min_grid(x, grid, ...)
min_grid(x, grid, ...)
x |
A model specification. |
grid |
A tibble with tuning parameter combinations. |
... |
Not currently used. |
A tibble with the minimum tuning parameters to fit and an additional list column with the parameter combinations used for prediction.
No methods found in currently loaded packages.
Prune or reduce an object
prune(tree, ...)
prune(tree, ...)
tree |
A fitted model object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
rank_results()
computes relative ranks of a collection of objects and
returns a summary of the results.
rank_results(x, ...)
rank_results(x, ...)
x |
A collection of objects |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Refitting models
refit(object, ...)
refit(object, ...)
object |
A fitted model object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Determine packages required by objects
required_pkgs(x, ...)
required_pkgs(x, ...)
x |
An object. |
... |
Other arguments passed to methods |
A character string of packages that are required.
No methods found in currently loaded packages.
Union (union()
), intersect (intersect()
), difference (setdiff()
),
and equality (setequal()
) for two vectors representing sets. Determine
membership with is.element()
.
intersect(x, y, ...) union(x, y, ...) setdiff(x, y, ...) setequal(x, y, ...) is.element(el, set, ...)
intersect(x, y, ...) union(x, y, ...) setdiff(x, y, ...) setequal(x, y, ...) is.element(el, set, ...)
x , y
|
Vectors to combine. |
... |
Other arguments passed on to methods. |
el , set
|
Element and set to compare. |
These functions override the set functions provided in base to make them generic so that packages can provide methods for different data types. The default methods call the base versions.
For union()
, intersect()
, and setdiff()
, a vector with all
duplicate removed.
For setequal()
and is.element()
, a logical TRUE
or FALSE
.'
intersect()
No methods found in currently loaded packages.
union()
No methods found in currently loaded packages.
setdiff()
No methods found in currently loaded packages.
setequal()
No methods found in currently loaded packages.
is.element()
No methods found in currently loaded packages.
intersect(1:5, 4:8) union(1:5, 4:8) setdiff(1:5, 4:8) setdiff(4:8, 1:5)
intersect(1:5, 4:8) union(1:5, 4:8) setdiff(1:5, 4:8) setdiff(4:8, 1:5)
Specify variables or other quantities.
specify(x, ...)
specify(x, ...)
x |
An object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Turn an object into a tidy tibble
tidy(x, ...)
tidy(x, ...)
x |
An object to be converted into a tidy |
... |
Additional arguments to tidying method. |
A tibble::tibble()
with information about model components.
No methods found in currently loaded packages.
Estimates parameters for a given model from a set of data.
train(x, ...)
train(x, ...)
x |
An object. See the individual method for specifics. |
... |
other arguments passed to methods |
No methods found in currently loaded packages.
Returns information on potential hyper-parameters that can be optimized.
tunable(x, ...)
tunable(x, ...)
x |
An object, such as a recipe, recipe step, workflow, or model specification. |
... |
Other arguments passed to methods |
For a model specification, an engine must be chosen.
If the object has no tunable parameters, a tibble with no rows is returned.
The information about the default parameter object takes the form of a
named list with an element for the function call and an optional element for
the source of the function (e.g. the dials
package). For model
specifications, If the parameter is unknown to the underlying tunable
method, a NULL
is returned.
A tibble with a column for the parameter name
, information on the
default method for generating a corresponding parameter object, the
source
of the parameter (e.g. "recipe", etc.), and the component
within
the source. For the component
column, a little more specificity is given
about the location of the parameter (e.g. "step_normalize" for recipes or
"boost_tree" for models). The component_id
column contains the unique step
id
field or, for models, a logical for whether the model specification
argument was a main parameter or one associated with the engine.
No methods found in currently loaded packages.
tune_args()
takes an object such as a model specification or a recipe and
returns a tibble of information on all possible tunable arguments and
whether or not they are actually tunable.
tune_args(object, ...)
tune_args(object, ...)
object |
A |
... |
Other arguments passed to methods. |
The source
column is determined differently for a
model_spec
or a recipe
(with additional detail on the type).
The id
field has any identifier that was passed from tune::tune()
(e.g.
tune("some note")
). If no additional detail was used in that function,
the id
field reverts to the name of the parameters.
A tibble with columns for the parameter name (name
), whether it
contains any tunable value (tune
), the id
for the parameter (id
),
and the information on where the parameter was located (source
).
No methods found in currently loaded packages.
A generic method for calculating variable importance for model objects.
var_imp(object, ...)
var_imp(object, ...)
object |
A fitted model object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Find any arguments that are not fully specified.
varying_args(object, ...)
varying_args(object, ...)
object |
An object. See the individual method for specifics. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.
Visualize a data set or object.
visualize(x, ...)
visualize(x, ...)
x |
A data frame or other object. |
... |
Other arguments passed to methods |
No methods found in currently loaded packages.