inlearn               package:kernlab               R Documentation

_O_n_l_e_a_r_n _o_b_j_e_c_t _i_n_i_t_i_a_l_i_z_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Online Kernel Algorithm object 'onlearn' initialization function.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

       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 setting the kernel parameter to the following strings:

             *  'rbfdot' Radial Basis kernel function "Gaussian"

             *  'polydot' Polynomial kernel function

             *  'vanilladot' Linear kernel function

             *  'tanhdot' Hyperbolic tangent kernel function

             *  'laplacedot' Laplacian kernel function

             *  'besseldot' Bessel kernel function

             *  'anovadot' ANOVA RBF kernel function

          The kernel parameter can also be set to a user defined
          function of class kernel by passing the function name as an
          argument. 

    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 :

             *  'sigma' inverse kernel width for the Radial Basis
                kernel function "rbfdot" and the Laplacian kernel
                "laplacedot".

             *  'degree, scale, offset' for the Polynomial kernel
                "polydot"

             *  'scale, offset' for the Hyperbolic tangent kernel
                function "tanhdot"

             *  'sigma, order, degree' for the Bessel kernel
                "besseldot".

             *  'sigma, degree' for the ANOVA kernel "anovadot".

          Hyper-parameters for user defined kernels can be passed
          through the 'kpar' parameter as well.

    type: the type of problem to be learned by the online algorithm :
          'classification', 'regression', 'novelty'

buffersize: the size of the buffer to be used

_D_e_t_a_i_l_s:

     The 'inlearn' is used to initialize a blank 'onlearn' object.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Alexandros Karatzoglou
      alexandros.karatzoglou@ci.tuwien.ac.at

_S_e_e _A_l_s_o:

     'onlearn', 'onlearn-class'

_E_x_a_m_p_l_e_s:

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

