docs/functions/set.weights.md

set.weights

Choose a combination of weights for a SPEARobject. Print SPEARobject$params$weights to see all combinations trained.

Description

Choose a combination of weights for a SPEARobject. Print SPEARobject$params$weights to see all combinations trained.

Usage

set.weights(w.idx = NULL, w.x = NULL, w.y = NULL, method = "sd")

Arguments

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).

Examples

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")


jgygi/SPEAR documentation built on July 5, 2023, 5:35 p.m.