.fit.glm {tidyfit}R Documentation

Generalized linear regression for tidyfit

Description

Fits a linear or logistic regression on a 'tidyFit' R6 class. The function can be used with regress and classify.

Usage

## S3 method for class 'glm'
.fit(self, data = NULL)

Arguments

self

a 'tidyFit' R6 class.

data

a data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

Details

Hyperparameters:

None. Cross validation not applicable.

Important method arguments (passed to m)

The function provides a wrapper for stats::glm. See ?glm for more details.

Implementation

No implementation notes

Value

A fitted 'tidyFit' class model.

Author(s)

Johann Pfitzinger

See Also

.fit.lm and m methods

Examples

# Load data
data <- tidyfit::Factor_Industry_Returns
data$Return <- ifelse(data$Return > 0, 1, 0)

# Stand-alone function
fit <- m("glm", Return ~ ., data)
fit

# Within 'classify' function
fit <- classify(data, Return ~ ., m("glm"), .mask = c("Date", "Industry"))
coef(fit)


[Package tidyfit version 0.7.1 Index]