penaltyParameter {DWDLargeR} | R Documentation |
Compute the penalty parameter for the model.
Description
Find the best penalty parameter C
for the generalized distance weighted discrimination (DWD) model.
Usage
penaltyParameter(X,y,expon,rmzeroFea = 1, scaleFea = 1)
Arguments
X |
A |
y |
A vector of length |
expon |
A positive number representing the exponent |
rmzeroFea |
Switch for removing zero features in the data matrix. Default is set to be 1 (removing zero features). |
scaleFea |
Switch for scaling features in the data matrix. This is to make the features having roughly similar magnitude. Default is set to be 1 (scaling features). |
Details
The best parameter is empirically found to be inversely proportional to the typical distance between different samples raised to the power of (expon+1
).
It is also dependent on the sample size n
and feature dimension d
.
Value
A number which represents the best penalty parameter for the generalized DWD model.
Author(s)
Xin-Yee Lam, J.S. Marron, Defeng Sun, and Kim-Chuan Toh
References
Lam, X.Y., Marron, J.S., Sun, D.F., and Toh, K.C. (2018)
“Fast algorithms for large scale generalized distance weighted discrimination", Journal of Computational and Graphical Statistics, forthcoming.
https://arxiv.org/abs/1604.05473
Examples
# load the data
data("mushrooms")
# calculate the best penalty parameter
C = penaltyParameter(mushrooms$X,mushrooms$y,expon=1)