Skip to contents

This is an internal function that interfaces directly with the Rust implementation from linfa. The preferred entry point is via tidymodels, i.e. with:

model_spec <- linear_reg(engine = "linfa")
model <- fit(model_spec, mpg ~ ., mtcars)

Usage

.linfa_linear_reg(x, y)

Arguments

x

A numeric matrix of predictors.

y

A numeric vector of outcome values.

Examples

x <- matrix(rnorm(300), ncol = 3)
y <- rnorm(100)

m <- .linfa_linear_reg(x, y)
m
#> A linear_reg fitted with linfa.

predict(m, matrix(rnorm(12), ncol = 3))
#> [1] -0.37904704 -0.21636341  0.21567260  0.09364324