The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Title: Automate the Creation of Generalized Additive Models (GAMs)
Version: 0.1.0
Language: en-US
Description: This wrapper package for 'mgcv' makes it easier to create high-performing Generalized Additive Models (GAMs). With its central function autogam(), by entering just a dataset and the name of the outcome column as inputs, 'AutoGAM' tries to automate the procedure of configuring a highly accurate GAM which performs at reasonably high speed, even for large datasets.
License: MIT + file LICENSE
Config/testthat/edition: 3
Encoding: UTF-8
RoxygenNote: 7.3.2
Depends: R (≥ 4.2.0)
Imports: cli, dplyr, methods, mgcv, purrr, rlang, staccuracy, stats, stringr, univariateML
Suggests: testthat (≥ 3.0.0)
URL: https://github.com/tripartio/autogam, https://tripartio.github.io/autogam/
BugReports: https://github.com/tripartio/autogam/issues
NeedsCompilation: no
Packaged: 2025-02-24 17:45:53 UTC; chitu.okoli
Author: Chitu Okoli ORCID iD [aut, cre]
Maintainer: Chitu Okoli <Chitu.Okoli@skema.edu>
Repository: CRAN
Date/Publication: 2025-02-24 19:20:06 UTC

Automate the Creation of Generalized Additive Models (GAMs)

Description

This wrapper package for 'mgcv' makes it easier to create high-performing Generalized Additive Models (GAMs). With its central function autogam(), by entering just a dataset and the name of the outcome column as inputs, 'AutoGAM' tries to automate the procedure of configuring a highly accurate GAM which performs at reasonably high speed, even for large datasets.

Author(s)

Chitu Okoli Chitu.Okoli@skema.edu

See Also

Useful links:


Automate the creation of a Generalized Additive Model (GAM)

Description

autogam() is a wrapper for 'mgcv::gam()' that makes it easier to create high-performing Generalized Additive Models (GAMs). By entering just a dataset and the name of the outcome column as inputs, autogam() tries to automate the procedure of configuring a highly accurate GAM which performs at reasonably high speed, even for large datasets.

Usage

autogam(data, y_col, ..., bs = "cr")

Arguments

data

dataframe. All the variables in data will be used to predict y_col. To exclude any variables, assign as data only the subset of variables desired.

y_col

character(1). Name of the y outcome variable.

...

Arguments passed on to mgcv::gam().

bs

character(1). The default basis function for GAM smooths. See ?mgcv::smooth.terms for details. Whereas the default bs in mgcv is 'tp', autogam's default is 'cr', which is much faster and comparably accurate.

Value

Returns an mgcv::gam object, the result of predicting y_col from all other variables in data.

Examples

autogam(mtcars, 'mpg')


Generic autogam methods passed on to mgcv::gam methods

Description

An autogam object contains a gam element that is simply an mgcv::gam object. So, it supports all mgcv::gam methods by, in most cases, simply passing the gam element on to their corresponding mgcv::gam methods. Only the following methods have special specifications for autogam (see their dedicated documentation files for details): print.autogam().

Usage

## S3 method for class 'autogam'
anova(object, ...)

## S3 method for class 'autogam'
coef(object, ...)

## S3 method for class 'autogam'
cooks.distance(model, ...)

## S3 method for class 'autogam'
formula(x, ...)

## S3 method for class 'autogam'
influence(model, ...)

## S3 method for class 'autogam'
logLik(object, ...)

## S3 method for class 'autogam'
model.matrix(object, ...)

## S3 method for class 'autogam'
predict(object, ...)

## S3 method for class 'autogam'
residuals(object, ...)

## S3 method for class 'autogam'
vcov(object, ...)

Arguments

object, model

An object of class autogam.

...

other arguments

x

formula

Value

Returns the return object of the corresponding mgcv::gam method.


Plot Method for autogam Objects

Description

This function plots an autogam object. It calls the mgcv::gam object mgcv::plot.gam() method.

Usage

## S3 method for class 'autogam'
plot(x, ...)

Arguments

x

An object of class autogam.

...

Additional arguments passed to other methods.

Value

Same return object as mgcv::print.gam().


Print Method for autogam Objects

Description

This function prints an autogam object. It calls the mgcv::gam object print() method and then adds basic performance metrics from the autogam object:

Usage

## S3 method for class 'autogam'
print(x, ...)

Arguments

x

An object of class autogam.

...

Additional arguments passed to other methods.

Value

Invisibly returns the input object x.


Create a character string for a mgcv::gam formula

Description

Create a character string that wraps appropriate variables in a dataframe with s() smooth functions. Based on the datatype of each variable, it determines whether it is a numeric variable to be smoothed:

Usage

smooth_formula_string(
  data,
  y_col,
  smooth_fun = "s",
  bs = "cr",
  expand_parametric = TRUE
)

Arguments

data

dataframe. All the variables in data except y_col will be listed in the resulting formula string. To exclude any variables, assign as data only the subset of variables desired.

y_col

character(1). Name of the y outcome variable.

smooth_fun

character(1). Function to use for smooth wraps; default is 's' for the s() function.

bs

See documentation for autogam()

expand_parametric

logical(1). If TRUE (default), explicitly list each non-smooth (parametric) term. If FALSE, use . to lump together all non-smooth terms.

Value

Returns a single character string that represents a formula with y_col on the left and all other variables in data on the right, each formatted with an appropriate s() function when applicable.

Examples

smooth_formula_string(mtcars, 'mpg')


Summary Method for autogam Objects

Description

This function returns a summary of an autogam object. It calls the mgcv::gam object mgcv::summary.gam() method.

Usage

## S3 method for class 'autogam'
summary(object, ...)

Arguments

object

An object of class autogam.

...

Additional arguments passed to other methods.

Value

Same return object as mgcv::summary.gam().

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.