Skip to contents

Create a new data set metadata file.

Usage

new_model(
  filename,
  name,
  type,
  dir = "./inst/models",
  description = "Description of the dataset",
  train_fun = "function(formula, data) {\n\t# Run predictive model.\n\t}",
  predict_fun =
    "function(model, newdata) {\n\t# Return predicted probabilities for classification or nemeric values for regression.\n\t}",
  packages = "",
  note = "",
  open = interactive(),
  overwrite = FALSE
)

Arguments

filename

the name of the file that will be created. This will be the id for the model.

name

the name of the model.

type

type of model, either regression (quantitative dependent variables), or classification (for qualitative dependent variables).

dir

the directory to store the model file.

description

brief description of the model.

train_fun

function that will return a trained model. Must have two parameters: formula and data.

predict_fun

function that will return the predicted probabilities for classification models and predicted Y-values for regression models.

packages

comma separated list of any packages that need to be loaded prior to running either train_fun or predict_fun.

note

any additional descriptions about the model.

open

whether to open the file for editing after it has been created.

overwrite

whether to overwrite the model file if it already exists.

Value

a list with the metadata information.