mparheuristic: Function that returns a list of searching (hyper)parameters...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/model.R

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

1
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.

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.

Value

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

Note

See also http://hdl.handle.net/1822/36210 and http://www3.dsi.uminho.pt/pcortez/rminer.html

Author(s)

Paulo Cortez http://www3.dsi.uminho.pt/pcortez

References

See Also

fit and mining.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## "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)

rminer documentation built on May 1, 2019, 7:48 p.m.