smda(sparseLDA)
smda()所属R语言包:sparseLDA
Sparse mixture discriminant analysis
稀疏混合判别分析
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Performs sparse linear discriminant analysis for mixture of gaussians models.
执行稀疏线性判别分析的混合高斯模型。
用法----------Usage----------
smda(x, ...)
## Default S3 method:[默认方法]
smda(x, y, Z = NULL, Rj = NULL,
lambda = 1e-6, stop, maxIte = 50, Q=R-1,
trace = FALSE, tol = 1e-4, ...)
参数----------Arguments----------
参数:x
A matrix of the training data with observations down the rows and variables in the columns.
向下的行和列中的变量与观测的训练数据的矩阵。
参数:y
A matrix initializing the dummy variables representing the groups.
矩阵初始化虚拟变量代表的群体。
参数:Z
Am optional matrix initializing the probabilities representing the groups.
可选的矩阵初始化代表的群体的概率。
参数:Rj
K length vector containing the number of subclasses in each of the K classes.
ķ长度向量包含在每个的K类的子类的数量。
参数:lambda
The weight on the L2-norm for elastic net regression. Default: 1e-6.
弹性网回归的L2-模的重量。默认值:1E-6。
参数:stop
If STOP is negative, its absolute value corresponds to the desired number of variables. If STOP is positive, it corresponds to an upper bound on the L1-norm of the b coefficients. There is a one to one correspondence between stop and t.
如果STOP(停止)是负的,其绝对值对应至所需的号码的变量。如果STOP是积极的,它对应于一个上限的L1范数的系数b。停止和t之间有一个一一对应。
参数:maxIte
Maximum number of iterations. Default: 50.
最大迭代次数。默认值:50。
参数:Q
The number of components to include. Maximum and default is R-1 (total number of subclasses less one).
组件的数目,包括。最大值和默认是R-1(总数少了一个子类)。
参数:trace
If TRUE, prints out its progress. Default: FALSE.
如果是TRUE,打印出其进展情况。默认值:FALSE。
参数:tol
Tolerance for the stopping criterion (change in RSS). Default: 1e-4
公差停止标准(RSS的变化)。默认值:1E-4
参数:...
additional arguments
额外的参数
Details
详细信息----------Details----------
The function finds sparse directions for linear classification of mixture og gaussians models.
该功能发现稀疏方向的混合OG高斯模型的线性分类。
值----------Value----------
Returns a list with the following attributes:
返回一个具有以下属性的列表:
参数:call
The call
呼叫
参数:beta
The loadings of the sparse discriminative directions.
稀疏的歧视性方向的负荷。
参数:theta
The optimal scores.
最佳的成绩。
参数:Z
Updated subclass probabilities.
更新子类概率。
参数:Rj
a vector of the number of ssubclasses per class
一个向量的每个类的数目ssubclasses
参数:rss
A vector of the Residual Sum of Squares at each iteration.
在每次迭代的残差平方和的矢量。
(作者)----------Author(s)----------
Line Clemmensen
参考文献----------References----------
analysis", Technometrics, To appear.
参见----------See Also----------
normalize, normalizetest, sda
normalize,normalizetest,sda
实例----------Examples----------
# load data[加载数据]
data(penicilliumYES)
X <- penicilliumYES$X
Y <- penicilliumYES$Y
Z <- penicilliumYES$Z
## test samples[#检测样品]
Iout <- c(3, 6, 9, 12)
Iout <- c(Iout, Iout+12, Iout+24)
## training data[#培训资料]
Xtr <- X[-Iout,]
k <- 3
n <- dim(Xtr)[1]
Rj <- rep(4, 3)
## Normalize data[#标准化数据]
Xc <- normalize(Xtr)
Xn <- Xc$Xc
p <- dim(Xn)[2]
## perform SMDA with one non-zero loading for each discriminative[执行SMDA一个非零加载的每个歧视]
## direction[#方向]
smdaFit <- smda(x = Xn,
y = Y,
Z = Z,
Rj = Rj,
lambda = 1e-6,
stop = -5,
maxIte = 10,
trace = TRUE,
tol = 1e-2)
# testing[测试]
Xtst <- X[Iout,]
Xtst <- normalizetest(Xtst, Xc)
test <- predict(smdaFit, Xtst)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|