set.weights
Choose a combination of weights for a SPEARobject. Print SPEARobject$params$weights
to see all combinations trained.
Choose a combination of weights for a SPEARobject. Print SPEARobject$params$weights
to see all combinations trained.
set.weights(w.idx = NULL, w.x = NULL, w.y = NULL, method = "sd")
Argument |Description
------------- |----------------
w.idx
| Use a manual weight index (row from SPEARobject$params$weights
)? Defaults to NULL
method
| Which method to use? Needs to be from a $run.cv.spear
object. Can be "min"
(overall lowest mean cross validated loss), or "sd"
(take highest weight within 1 sd cross validated loss).
SPEARobj <- make.SPEARobject(...)
SPEARobj$run.cv.spear()$cv.evaluation()
# Set the weights
SPEARobj$set.weights()
SPEARobj$set.weights(w.x = 0.1)
SPEARobj$set.weights(w.idx = 1)
SPEARobj$set.weights(method = "sd")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.