inst/doc/segen-introduction.R

## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 4)
library(segen)

## ----numeric------------------------------------------------------------------
set.seed(123)
fit <- segen(
  time_features[, "IBM.Close", drop = FALSE],
  seq_len = 12,
  similarity = 0.7,
  n_windows = 2,
  n_samp = 1,
  seed = 123
)

head(fit$history)
fit$best_model$predictions$IBM.Close

## ----plot, fig.alt="Forecast with uncertainty interval"-----------------------
fit$best_model$plots$IBM.Close

## ----parallel, eval=FALSE-----------------------------------------------------
# fit_parallel <- segen(time_features[, "IBM.Close", drop = FALSE],
#                      seq_len = 12, n_samp = 4,
#                      use_parallel = TRUE, parallel_workers = 2)

Try the segen package in your browser

Any scripts or data that you put into this service are public.

segen documentation built on Sept. 8, 2026, 1:09 a.m.