knnB              package:MLInterfaces              R Documentation

_A_n _i_n_t_e_r_f_a_c_e _t_o _v_a_r_i_o_u_s _m_a_c_h_i_n_e _l_e_a_r_n_i_n_g _m_e_t_h_o_d_s _f_o_r _e_x_p_r_S_e_t_s

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

     This function is a wrapper for a call to 'knn' for objects of
     class 'exprSet'. These interfaces provide a common calling
     sequence and common return value for machine learning code.

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

     knnB(exprObj, classifLab, trainInd, k = 1, l = 1, prob = TRUE,
       use.all = TRUE, metric = "euclidean") 

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

 exprObj: An instance of the 'exprset' class. 

classifLab: A vector of class labels. 

trainInd: Which are the training set. 

       k: The number of nearest neighbors. 

       l: See 'knn' for a complete description. 

    prob: See 'knn' for a complete description. 

 use.all: See 'knn' for a complete description. 

  metric: See 'knn' for a complete description. 

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

     See 'knn' for a complete description.

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

     An object of class 'classifOutput-class'.

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

     Jess Mar, VJ Carey <stvjc@channing.harvard.edu>

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

     'ldaB'

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

     ##get these from the source files
     library(golubEsets)
     data(golubMerge)
     smallG <- golubMerge[1:60,]
     knnB( smallG, "ALL.AML", 1:40 )
     set.seed(1234) # needed for nnet initialization
     nnetB( smallG, "ALL.AML", 1:40, size=5, decay=.01 )
     lvq1B( smallG, "ALL.AML", 1:40 )
     agnesB( smallG, k=5, height=0, FALSE )
     dianaB( smallG, k=5, height=0, FALSE )
     pamB( smallG, k=5, height=0, FALSE )
     bclustB( smallG, k=5, height=0 )
     cmeansB( smallG, k=5, height=0 )
     cshellB( smallG, k=5, height=0 , iter.max=1)
     #lcaB( BsmG, k=3 )
     naiveBayesB( smallG, "ALL.AML", 1:40 )
     svmB( smallG, "ALL.AML", 1:40 )
     baggingB( smallG, "ALL.AML", 1:40 )
     ipredknnB( smallG, "ALL.AML", 1:40 )
     sldaB( smallG, "ALL.AML", 1:40 )
     ldaB( smallG, "ALL.AML", 1:40 )
     qdaB( smallG[1:10,], "ALL.AML", 1:40 )
     pamrB( smallG, "ALL.AML", 1:40 )
     LOO1 <- xval(smallG, "ALL.AML", knnB, "LOO", 0:0)
     LOO2 <- xval(smallG, "ALL.AML", knnB, "FUN", 0:0, function(x,y,i) {
       (1:ncol(exprs(x)))[-i] }, niter=72 )
     table(LOO1, LOO2)
     kmeansB( smallG, k=4 )
     rpartB( smallG, "ALL.AML", 1:35 )
     randomForestB( smallG, "ALL.AML", 1:35 )
     hclustB( smallG, k=4 )
     hclustB( smallG, height=40000 )
     gbmB( smallG, "ALL.AML", 1:40, n.minobsinnode=3 , n.trees=6000)
     if (require(LogitBoost)) logitboostB( smallG, "ALL.AML", 1:40, 200 ) # summarize won't work with polych
     stat.diag.daB( smallG, "ALL.AML", 1:40 )

