Skip to content

Rust bindings for tidymodels [experimental]

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

simonpcouch/rinfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

db1dc75 · Aug 26, 2024

History

66 Commits
Jul 30, 2024
Aug 26, 2024
Aug 26, 2024
Aug 26, 2024
Jul 29, 2024
Aug 26, 2024
Aug 26, 2024
Jul 30, 2024
Jul 30, 2024
May 13, 2024
May 13, 2024
Jul 30, 2024
Aug 26, 2024
Aug 26, 2024
Aug 1, 2024
May 13, 2024
May 13, 2024

Repository files navigation

rinfa

Lifecycle: experimental CRAN status R-CMD-check

The goal of rinfa is to provide Rust bindings for parsnip model specifications.

Installation

You can install the development version of rinfa from GitHub with:

# install.packages("devtools")
devtools::install_github("simonpcouch/rinfa")

Example

x <- matrix(rnorm(3e7), ncol = 3, dimnames = list(NULL, paste0("X", 1:3)))
y <- rnorm(1e7)

dat <- cbind(as.data.frame(x), y)

# the usual formula interface
system.time(
  lm(y ~ ., dat)
)
#>    user  system elapsed 
#>   1.097   0.189   1.292

system.time(
  # lm()'s speedy friend (still from base R)
  .lm.fit(x, y)
)
#>    user  system elapsed 
#>   0.321   0.022   0.344

# rinfa's implementation
library(rinfa)

system.time({
  .linfa_linear_reg(x, y)
})
#>    user  system elapsed 
#>   0.115   0.046   0.161

To use rinfa with tidymodels, set the modeling engine to "linfa":

# using the formula interface:
linfa_fit <- fit(linear_reg(engine = "linfa"), y ~ ., dat)

# using the (more performant, in this case) XY interface:
linfa_fit_xy <- fit_xy(linear_reg(engine = "linfa"), x = x, y = y)

Available implementations

The rinfa package provides an additional engine "linfa" for the models in the following table:

model engine mode
decision_tree linfa classification
linear_reg linfa regression
logistic_reg linfa classification
multinom_reg linfa classification
naive_Bayes linfa classification
svm_linear linfa classification

To read more about the design of rinfa, see R/README.md.

About

Rust bindings for tidymodels [experimental]

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published