fit_ontram2: Function for estimating the model

View source: R/fit_ontram.R

fit_ontram2R Documentation

Function for estimating the model

Description

Function for estimating the model

Usage

fit_ontram2(
  model,
  history = FALSE,
  x_train = NULL,
  y_train,
  img_train = NULL,
  save_model = FALSE,
  x_test = NULL,
  y_test = NULL,
  img_test = NULL,
  verbose = 1
)

Examples

data("wine", package = "ordinal")
fml <- rating ~ temp + contact
x_train <- model.matrix(fml, data = wine)[, -1L]
y_train <- model.matrix(~ 0 + rating, data = wine)
x_valid <- x_train[1:20,]
y_valid <- y_train[1:20,]
mo <- ontram_polr(x_dim = ncol(x_train), y_dim = ncol(y_train),
    method = "logit", n_batches = 10, epochs = 50)
mo_hist <- fit_ontram2(mo, x_train = x_train, y_train = y_train, history = TRUE,
    x_test = x_valid, y_test = y_valid)
plot(mo_hist)

LucasKookUZH/ontram-pkg documentation built on March 27, 2023, 6:05 p.m.