View source: R/SOptim_ClassificationFunctions.R
replaceDefaultClassificationParams | R Documentation |
An auxiliary function to replace default parameters of classification algorithms.
replaceDefaultClassificationParams(oldParamSet, newParamSet)
oldParamSet |
A parameter list object of class |
newParamSet |
A nested list with names equal to the parameters defined in |
A nested list object of class classificationParamList
with parameters for the available algorithms.
generateDefaultClassifierParams
to get the list of parameters that can be changed for each
classification algorithm.
# x is the classification dataset with one column with the segment ID,
# other for train/test data inputs, and the remaining columns with classification features
x<-data.frame(SID=1:10, train=sample(c(0,1),10, replace=TRUE), feature1=rnorm(10),
feature2=rnorm(10,5,2), feature3=rnorm(10,12,3))
oldParams<-generateDefaultClassifierParams(x)
newParams<-list(RF=list(mtry=3),
GBM=list(n.trees=3000))
replaceDefaultClassificationParams(oldParams, newParams)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.