set.weights | R Documentation |
Choose a combination of weights for a SPEAR object. Print 'SPEAR$params$weights' to see all combinations trained.
set.weights(w.idx = NULL, w.x = NULL, w.y = NULL, method = "sd")
w.idx |
Use a manual weight index (row from 'SPEAR$params$weights')? Defaults to 'NULL' |
method |
Which method to use? Needs to be from a '$train.spear(cv = TRUE)' object. Can be '"min"' (overall lowest mean cross validated loss), or '"sd"' (take highest weight within 1 sd cross validated loss). |
SPEARobj <- SPEAR$new(...)
SPEARobj$train.spear(cv = TRUE)
# 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.