The goal of predictlm is to provide an R interface to PredictLM model checkpoints from Zero One Research. For more information please see the official website: https://zerooneresearch.ai/models/
You can install the development version of predictlm like so:
pak::pak('frankiethull/predictlm')library(predictlm)
library(rsample)
corn_data <- maize::corn_data
corn_splits <- initial_validation_split(corn_data)
train <- training(corn_splits)
validate <- validation(corn_splits)
test <- testing(corn_splits)fit_cls <- predictlm_fit(
train |> dplyr::select(-type),
train$type,
device = "cpu"
)
class_preds <- predictlm_predict(fit_cls, test |> dplyr::select(-type))
class_preds |> head()
#> [1] "Sweet" "Sweet" "Sweet" "Sweet" "Sweet" "Sweet"fit_reg <- predictlm_fit(
train |> dplyr::select(-height, -type),
train$height,
problem_type = "regression",
device = "cpu"
)
preds <- predictlm_predict(fit_reg, test |> dplyr::select(-height, -type))
preds |> head()
#> [1] 70.34669 58.83693 60.45285 57.99476 61.91698 65.20015