MKLR: Multi-class Kernel Logistic Regression

Description Usage Arguments Details Value See Also

View source: R/MKLR.R

Description

This function fit a Multi-class Kernel Logistic Regression model to the data (y, x) using some pre-specified kernel. The return list contains the estimated kernel weights as well as the original data to perform predictions.There are two types of kernel, they are 'RBF' and 'polynomial'

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
MKLR(
  y,
  x,
  kernel = c("RBF", "polynomial")[1],
  lambda = 0.01,
  sigma2 = 1,
  d = 3,
  lr = 0.001,
  threshold = 1e-06,
  max_iter = 1000
)

Arguments

y

A n x 1 column vector containing multiclass responses.

x

A n x p matrix containing the covariates.

kernel

The kernel to use. Either RBF (default) or polynomial.

lambda

The regularization parameter.

sigma2

The scale in the RBF and polynomial kernel. See details.

d

The degree in the polynomial kernel.

threshold

The convergence threshold.

max_iter

The maximum number of iterations.

Details

The RBF kernel has the following form:

exp(-||x-y||^2/sigma2).

The polynomial kernel has the following form:

(1+x'y/sigma2)^d.

Value

A list containing:

x

The original x.

alpha

The vector of fitted weights.

kernel

The kernel.

sigma2

The scale parameter.

d

The polynomial degree.

See Also

predict.MKLR


hyj12345/MKLR documentation built on Dec. 20, 2021, 5:54 p.m.