kernlab (version 0.8-2)

inlearn: Onlearn object initialization

Description

Online Kernel Algorithm object onlearn initialization function.

Usage

## S3 method for class 'numeric':
inlearn(d, kernel = "rbfdot", kpar = list(sigma = 0.1), type = "novelty", 
       buffersize = 1000)

Arguments

d
the dimensionality of the data to be learned
kernel
the kernel function used in training and predicting. This parameter can be set to any function, of class kernel, which computes a dot product between two vector arguments. kernlab provides the most popular kernel functions which can be used by
kpar
the list of hyper-parameters (kernel parameters). This is a list which contains the parameters to be used with the kernel function. For valid parameters for existing kernels are :
  • sigmainverse kernel width for the Radial B
type
the type of problem to be learned by the online algorithm : classification, regression, novelty
buffersize
the size of the buffer to be used

Value

  • The function returns an S4 object of class onlearn that can be used by the onlearn function.

Details

The inlearn is used to initialize a blank onlearn object.

See Also

onlearn, onlearn-class

Examples

Run this code
## create toy data set
x <- rbind(matrix(rnorm(100),,2),matrix(rnorm(100)+3,,2))
y <- matrix(c(rep(1,50),rep(-1,50)),,1)

## initialize onlearn object
on <- inlearn(2,kernel="rbfdot",kpar=list(sigma=0.2),type="classification")

## learn one data point at the time
for(i in sample(1:100,100))
on <- onlearn(on,x[i,],y[i],nu=0.03,lambda=0.1)

sign(predict(on,x))

Run the code above in your browser using DataCamp Workspace