Learn R Programming

rminer (version 1.4.1)

mparheuristic: Function that returns a list of searching (hyper)parameters for a particular classification or regression model

Description

Function that returns a list of searching (hyper)parameters for a particular classification or regression model. The result is to be put in a search argument, used by fit or mining functions. Something like: search=list(search=mparheuristic(...),...).

Usage

mparheuristic(model, n = NA, lower = NA, upper = NA, by = NA, kernel = "rbfdot")

Arguments

model
model type name. See fit for details.
n
number of searches (either n or by should be used, n has prevalence over by).
lower
lower bound for the (hyper)parameter (if NA a default value is assumed).
upper
upper bound for the (hyper)parameter (if NA a default value is assumed).
by
increment in the sequence (if NA a default value is assumed depending on n).

kernel
optional kernel type, only used when model="ksvm". Currently mapped kernels are "rbfdot", "polydot" and "vanilladot"; see ksvm for kernel details.

Value

A list with one ore more (hyper)parameter values to be searched.

Details

This function facilitates the definition of the search argument used by fit or mining functions. Using simple heuristics, reasonable (hyper)parameter search values are suggested for several rminer models. For models not mapped in this function, the function returns NULL, which means that no hyperparameter search is executed (often, this implies using rminer or R function default values).

The heuristic assumes lower and upper bounds for a (hyper)parameter. If n=1, then rminer or R defaults are assumed. Else, a search is created using seq(lower,upper,by), where by was set by the used or computed from n. For model="ksvm", 2^seq(...) is used for sigma and C, (1/10)^seq(...) is used for scale.

References

  • To check for more details about rminer and for citation purposes: P. Cortez. Data Mining with Neural Networks and Support Vector Machines Using the R/rminer Tool. In P. Perner (Ed.), Advances in Data Mining - Applications and Theoretical Aspects 10th Industrial Conference on Data Mining (ICDM 2010), Lecture Notes in Artificial Intelligence 6171, pp. 572-583, Berlin, Germany, July, 2010. Springer. ISBN: 978-3-642-14399-1. @Springer: http://www.springerlink.com/content/e7u36014r04h0334 http://www3.dsi.uminho.pt/pcortez/2010-rminer.pdf

  • This tutorial shows additional code examples: P. Cortez. A tutorial on using the rminer R package for data mining tasks. Teaching Report, Department of Information Systems, ALGORITMI Research Centre, Engineering School, University of Minho, Guimaraes, Portugal, July 2015. http://hdl.handle.net/1822/36210

  • Some bounds were retrieved from: M. Fernandez-Delgado, E. Cernadas, S. Barro and D. Amorim. Do we need hundreds of classifiers to solve real world classification problems?. In The Journal of Machine Learning Research, 15(1), 3133-3181, 2014.

See Also

fit and mining.

Examples

Run this code
## "kknn"
s=mparheuristic("kknn",n=1)
print(s)
s=mparheuristic("kknn",n=10)
print(s)
s=mparheuristic("kknn",lower=5,upper=15,by=2)
print(s)

## "mlpe"
s=mparheuristic("mlpe")
print(s) # "NA" means set size with inputs/2 in fit
s=mparheuristic("mlpe",n=10)
print(s) 

## "randomForest"
s=mparheuristic("randomForest",n=10)
print(s) 

## "ksvm"
s=mparheuristic("ksvm",n=10)
print(s) 
s=mparheuristic("ksvm",n=10,kernel="vanilladot")
print(s) 
s=mparheuristic("ksvm",n=10,kernel="polydot")
print(s) 

## "rpart" and "ctree" are special cases (see help(fit,package=rminer) examples):
s=mparheuristic("rpart",n=3)
print(s) 
s=mparheuristic("ctree",n=3)
print(s) 

### examples with fit
## Not run: 
# ### classification
# data(iris)
# s=mparheuristic("ksvm",n=3,kernel="vanilladot")
# print(s)
# search=list(search=s,method=c("holdout",2/3,123))
# M=fit(Species~.,data=iris,model="ksvm",search=search,fdebug=TRUE)
# print(M@mpar)
# 
# ### regression
# data(sa_ssin)
# s=mparheuristic("ksvm",n=3,kernel="polydot")
# print(s)
# search=list(search=s,metric="MAE",method=c("holdout",2/3,123))
# M=fit(y~.,data=sa_ssin,model="ksvm",search=search,fdebug=TRUE)
# print(M@mpar)
# ## End(Not run)

Run the code above in your browser using DataLab