
new("onlearn", ...)
.
or by calls to the function inlearn
.kernelf
:"function"
containing
the used kernel functionbuffer
:"numeric"
containing
the size of the bufferkpar
:"list"
containing the
hyperparameters of the kernel function.xmatrix
:"matrix"
containing
the data points (similar to support vectors) fit
:"numeric"
containing the
decision function value of the last data pointonstart
:"numeric"
used for indexing onstop
:"numeric"
used for indexingalpha
:"ANY"
containing the
model parametersrho
:"numeric"
containing model
parameterb
:"numeric"
containing the offsetpattern
:"factor"
used for
dealing with factorstype
:"character"
containing
the problem type (classification, regression, or novelty signature(object = "onlearn")
: returns the model
parameterssignature(object = "onlearn")
: returns the offset signature(object = "onlearn")
: returns the
buffer sizesignature(object = "onlearn")
: returns the last
decision function valuesignature(object = "onlearn")
: return the
kernel function usedsignature(object = "onlearn")
: returns the
hyper-parameters usedsignature(obj = "onlearn")
: the learning functionsignature(object = "onlearn")
: the predict functionsignature(object = "onlearn")
: returns model parametersignature(object = "onlearn")
: show functionsignature(object = "onlearn")
: returns the type
of problemsignature(object = "onlearn")
: returns the
stored data pointsonlearn
, inlearn
## 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 DataLab