new_model | R Documentation |
Create a new data set metadata file.
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 )
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:
|
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 |
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. |
a list with the metadata information.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.