marginTree            package:marginTree            R Documentation

_A _f_u_n_c_t_i_o_n _t_o _t_r_a_i_n  _a
_m_a_r_g_i_n _t_r_e_e  _c_l_a_s_s_i_f_i_e_r

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

     A function to train a margin tree  classifier. This is a
     hierachical version of the support vector classifier, useful for
     more than 2 classes.

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

     marginTree(x,y, method="complete",  n.threshold=20, predict.trainingset=TRUE)

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

       x: The input data of feature values, n samples by p features

       y: Class labels- vector of length n

  method: Clustering method- "complete" (default and recommended); 
          "average" or "single"

n.threshold: Number of threshold values desired (default 10)

predict.trainingset: Predict the training set? Required for computing
          error rates and in preparation for cross-validation. Slows
          the computation down a bit for large datasets. Default TRUE

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

     'marginTree' fits a margin tree classifier. It is useful with more
     than 2 outcome classes, and when the number of features exceeds
     the number of observations, for example in genomic and proteomic
     applications. Details may be found in the paper on the website
     listed below. This function calls the 'svm' function from library
     'e1071'.

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

     A list with components: 

marg.obj: List with components 'marg'- the matrix of pairwise margins,
          and 'svmfit', a list of svm classifiers used to  find each
          pairwise margin

marg.tree: The margin tree. Same format as that produced by  hclust.

svm.splitters: List a svm objects for classification at each junction
          in the margin tree.

plot.heights: Heights for plotting the margin tree

nclasses: Number of outcome classes

   nlist: For internal use

   ynams: Character names of outcome classes

threshold: Threshold values tried

     err: Number of training errors for each threshold value

       y: Training class labels

    yhat: Matrix of predicted classes, one column per threshold value

 nonzero: Average number of  nonzero features per threshold value

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

     Robert Tibshirani and Trevor Hastie

_R_e_f_e_r_e_n_c_e_s:

     Rob Tibshirani and Trevor Hastie. Tech report. Feb. 2006. Margin
     trees for high-dimensional classification Available at
     http://www-stat.stanford.edu/~tibs/research.html

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

     #generate some data with 5 classes and 100 features
     set.seed(543)

     x=matrix(rnorm(40*1000),nrow=40)
     y=sort(rep(1:5,8))
     x[y==2 | y==3, 1:50]=x[y==2|y==3, 1:50]+1
     x[y==3,51:100]=x[y==3,51:100]+1
     x[y==4|y==5,1:50]=x[y==4|y==5,1:50]-1
     x[y==5, 51:100]=x[y==5,51:100]+1


     #train the classifier

     train.obj<-   marginTree(x,y)

     # print out results to see training error rates
      
       train.obj

