Skip to contents

Add a model specification to an instrument

Usage

sframe_add_model(instrument, model, validate = TRUE, replace = TRUE)

Arguments

instrument

An sframe object.

model

An sframe_model_spec() object.

validate

Logical. Whether to validate the model against the instrument before adding it.

replace

Logical. Whether to replace an existing model with the same ID. Defaults to TRUE.

Value

The updated sframe object.

Examples

demo <- sframe_demo("tourism_services")
m <- sframe_model_spec("cb1", type = "cb_sem",
              constructs = list(sframe_construct("sat", items = c("sat_1", "sat_2"))))
instr <- sframe_add_model(demo$instrument, m)
length(instr$models)