spicer: spicer

Description Usage Arguments Value References

View source: R/Spicer.R

Description

Port of Tomioka and Suzuki's SpicyMKL to R, expanded for multiclass and probability outputs.

Usage

1
spicer(K, yapp, C, opt = list())

Arguments

K

N x N x M array. the (i,j,m)-element contains the (i,j)-element of the m-th kernel gram matrix.

yapp

vector of length N with sample labels. It should be a factor for binary/multiclass classification

C

regularization parameter . Large values of C induce strong regularization. For L1 regularization C is a scalar; for elasticnet, C is a vector of length 2: C(1)|x| + C(2)x^2/2

opt

list of options which control spicer behavior:

loss

type of loss function:'logit' (logistic regression, log(1+exp(- f(x)y))) for classification, 'square' (square loss, 0.5*(y - f(x))^2) for regression

regname

type of regularization: 'l1' (default), 'elasticnet'

optname

optimization solver for dual variable (rho) inner minimization: 'Newton' (default), 'BFGS'

stop_duality_gap

TRUE/FALSE. If TRUE, Spicer employs duality gap for stopping criterion of outer loop. Default TRUE.

stop_ineq_violation

TRUE/FALSE. If TRUE, Spicer employs violation of inequality for stopping criterion of outer loop. Default FALSE.

outer_maxiter

maximum number of iterations of outer loop. (default 300)

inner_maxiter

maximum number of iterations of inner loop. (default 500)

tol_outer

tolerance of stopping criteria of outer loop. (default 0.001)

tol_inner

tolerance of stopping criteria of inner loop. (default tol_outer/1000)

miniter

minimum number of iterations of outer loop. (default 30)

tol_miniter

minimum relative improvement required for each outer iteration after miniter. (default 0.001)

calpha

increment factor of gamma: gamma^(t+1)=calpha*gamma^(t). (default 10)

incl_subw

TRUE/FALSE. If TRUE, Spicer includes the full NxM matrix of alpha coefficients. Default FALSE.

display

1:display no progress messages, 2(default):display outer loop progress messages, 3:display inner loop progress messaages.

Value

A SPICER model with the following components:

comb_alpha

N x 1 coefficient vector.

kern_weight

1 x M kernel weight vector, scaled to sum to 1

bias

bias term

activeset

indices of kernels that are active (m : kern_weight[m] is not zero).

sorted_kern_weight

vector of non-zero kernel weights sorted by magnitude, scaled to sum to 1.

opt

list of SPICER options used in run.

history

contains history of primal objective, dual objective, number of active kernels, and duality gap.

kern_alpha

If incl_subw is TRUE, the NxM matrix of alpha coefficients.

References


VladoUzunangelov/SPICER documentation built on July 20, 2020, 12:53 a.m.