## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## -----------------------------------------------------------------------------
library(marsruntime)

spec <- list(
  spec_version = "1.0",
  basis_terms = list(list(kind = "constant")),
  coefficients = list(1),
  feature_schema = list(n_features = 0)
)

validate_model_spec(spec)

## -----------------------------------------------------------------------------
rows <- matrix(numeric(0), nrow = 1, ncol = 0)
design_matrix(spec, rows)
predict_model(spec, rows)

## ----eval=FALSE---------------------------------------------------------------
# fit_model(
#   x = matrix(c(0, 1, 2), ncol = 1),
#   y = c(1, 3, 5),
#   max_terms = 5,
#   max_degree = 1,
#   penalty = 3.0
# )

