ofwTune {ofw}R Documentation

Tuning the parameters for ofwCART or ofwSVM

Description

ofwTune helps to tune the main parameters: mtry, nforest and ntree for ofwCART or mtry and nsvm for ofwSVM.

Usage

## Default S3 method:
ofwTune(x, y, type="CART", ntree= if(type=="CART") 50 else NULL, 
        nforest= if(type=="CART") 100 else NULL, nsvm= if(type=="SVM") 500 else NULL, 
        mtry.test=seq(5,15,length=3), do.trace=FALSE, nstable=10, weight=FALSE, ...)

Arguments

x A data frame with continuous values.
y A response vector given as a factor (classification only).
type The version of OFW to perform.
ntree Number of trees to grow for each iteration (trees aggregation) in case ofwCART is chosen.
nforest Total number of iterations to run if ofwCART.
nsvm Total number of iterations to run if ofwSVM.
mtry.test Vector defining the number of variables sampled according to the weight vector P to be tested. By default the vector is defined as 'seq(5,15,length=3)'.
do.trace If set to some integer, then current iteration is printed for every do.trace iterations and the number of the first stable variables is output.
nstable Need do.trace set to some integer. Stopping criterion before nforest or nsvm iterations are reached: if the nstable first weighted variables are the same after do.stable iterations, then stop.
weight Should the weighting procedure be applied ?
... not used currently.

Details

ofwTune consists in testing either ofwCART or ofwSVM with several variable subsets sizes in the given sequence mtry.test. For each mtry, the algorithm is performed twice and the function ofwTune outputs the intersection length of the first nstable variables selected with these 2 ofw. The value mtry to choose should be the one that gives the largest intersection.

The total number of iteration to tune should then be 2 to 3 times the maximum iterations reached for the optimal mtry.

In case of ofwCART, to choose ntree, the user should run ofwTune with several values of ntree. Usually, the more the trees the stabler the results.

Value

A list with the following components:

type The classifier applied to ofw (either CART or SVM).
nstable The number of stable variables chosen.
mtry.test The different subset size tested.
param A 2 by length(mtry.test) matrix indicating the number of stable variables obtained for each value of mtry.
iter.max A 2 by length(mtry.test) matrix indicating the maximum number of iterations reached for each value of mtry.
weight If TRUE the weighted procedure was performed during the learning.

Note

The computation of ofwTune might be slow as it consists in launching ofw $2*$length(mtry.Test).

Author(s)

Kim-Anh L^e Cao Kim-Anh.Le-Cao@toulouse.inra.fr

Patrick Chabrier Patrick.Chabrier@toulouse.inra.fr

References

L^e Cao, K-A., Gonc calves, O., Besse, P. and Gadat, S. (2007), Selection of biologically relevant genes with a wrapper stochastic algorithm Statistical Applications in Genetics and Molecular Biology: Vol. 6: Iss.1, Article 29.

See Also

ofw

Examples

## On data set "srbct"
#data(srbct)
#attach(srbct)
#tune.cart <- ofwTune(srbct, as.factor(class), type="CART", ntree=50, nforest=200, mtry.test=seq(5,10,length=2))
#tune.cart
#tune.svm <- ofwTune(srbct, as.factor(class), type="SVM", nsvm=500, mtry.test=seq(5,10,length=2))
#tune.svm
##Using do.trace options 
#tune.cart <- ofwTune(srbct, as.factor(class), type="CART", ntree=50, nforest=200, mtry.test=seq(5,10,length=2), do.trace=50, nstable=5)
#tune.cart
#tune.svm <- ofwTune(srbct, as.factor(class), type="SVM", nsvm=500, mtry.test=seq(5,10,length=2), do.trace=100, nstable=5)
#tune.svm

#detach(srbct)

[Package ofw version 1.0-0 Index]