rvmbinary(rvmbinary)
rvmbinary()所属R语言包:rvmbinary
Relevance Vector Machine
相关向量机
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The Relevance Vector Machine is a Bayesian model for regression and classification of identical functional form to the support vector machine.
相关向量机是一种贝叶斯模型相同的功能形式的支持向量机回归和分类。
用法----------Usage----------
## S3 method for class 'formula'[类formula的方法]
rvmbinary(formula, data=NULL, ...)
## Default S3 method:[默认方法]
rvmbinary(x,y, kernel="rbfdot", parameters=c(0.1),iterations=100, noisevar=0.1, minmaxdiff = 1e-3, ...)
## S3 method for class 'rvmbinary'
print(x, ...)
## S3 method for class 'rvmbinary'
predict(object,newdata, ...)
参数----------Arguments----------
参数:formula
Formula interface for rvmbinary
公式为rvmbinary接口
参数:x
The data to be fit by RVM. When not using a formula x can be a matrix or vector containing the training data or a kernel matrix of class rvmkernel of the training data.
RVM适合的数据。当不使用公式x可以是一个含有类rvmkernel的训练数据的训练数据或一个内核矩阵的矩阵或矢量。
参数:data
a data frame containing the variables in the model when using the formula function
一个数据框包含的变量在模型中使用的配方功能时,
参数:y
a response vector with one label for each row/component of x. Can be either a factor (for classification tasks) or a numeric vector (for regression).
每行/组件x的一个标签的响应矢量。可以是一个因子(分类任务)或一个数值向量(回归)。
参数:kernel
the kernel function used in training and predicting. The AA Kernel is supplied built in which is used by setting the kernel parameter to "aa". The Kernlab kernels are also supplied if Kernlab is installed which provides the most popular kernel functions. These can be used by setting the kernel parameter to the following strings:
在训练和预测所用的内核函数。机管局提供的内核是建立在其中所使用的内核参数设置为“AA”。 Kernlab内核还提供,如果Kernlab被安装了一个提供最流行的内核函数。这些可以使用的内核参数设置到以下的字符串:
rbfdot Radial Basis kernel "Gaussian"
rbfdot径向基核“高斯”
polydot Polynomial kernel
polydot多项式核
vanilladot Linear kernel
vanilladot线性核
tanhdot Hyperbolic tangent kernel
tanhdot双曲正切内核
laplacedot Laplacian kernel
laplacedot拉普拉斯核
besseldot Bessel kernel
besseldot贝塞尔内核
anovadot ANOVA RBF kernel
anovadot ANOVA RBF内核
splinedot Spline kernel
splinedot样条内核
stringdot String kernel
stringdot字符串核
(default = "rbfdot")
(默认=“rbfdot”)
参数:parameters
a vector of hyper-parameters (kernel parameters). This is a vector which contains the parameters to be used with the kernel function. For valid parameters for existing kernels are :
一个超参数向量(内核参数)。这是一个向量,其中包含要使用的核函数的参数。对于现有内核的有效参数是:
c(sigma) inverse kernel width for the Radial Basis kernel function "rbfdot" and the Laplacian kernel "laplacedot". And the only parameter for the AA kernel (lambda) which can be set between 0.5-1.0.
c(sigma)逆内核宽度的径向基核函数“rbfdot”的的拉普拉斯核“laplacedot”。唯一的参数为AA内核(λ),它可以设置在0.5~1.0。
c(degree, scale, offset) for the Polynomial kernel "polydot"
c(degree, scale, offset)多项式核“polydot”
c(scale, offset) for the Hyperbolic tangent kernel function "tanhdot"
c(scale, offset)为双曲正切的内核函数“tanhdot”
c(sigma, order, degree) for the Bessel kernel "besseldot".
c(sigma, order, degree)为贝塞尔内核“besseldot”的。
c(sigma, degree) for the ANOVA kernel "anovadot".
c(sigma, degree)ANOVA内核“anovadot”。
c(length, lambda, normalized) for the "stringdot" kernel where length is the length of the strings considered, lambda the decay factor and normalized a logical parameter determining if the kernel evaluations should be normalized.
c(length, lambda, normalized)为“stringdot”内核其中length是考虑的字符串的长度,λ的衰减因子和归一化的逻辑参数确定如果内核评价应被标准化。
(default = c(0.1).
(默认值= C(0.1)。
参数:noisevar
the initial noise variance
初始噪声方差
参数:iterations
Number of iterations allowed (default: 100)
迭代数(默认值:100)
参数:minmaxdiff
termination criteria. Stop when max difference is equal to this parameter (default:1e-3)
终止条件。停止时,最大的区别是等于这个参数(默认:1E-3)
参数:object
The object returned from rvmbinary in order to predict
返回的对象,以预测rvmbinary
参数:newdata
New data for testing
新的数据进行测试
参数:...
optional parameters to be passed to the low level function rvmbinary.default.
可选的参数被传递到低级别的功能rvmbinary.default。
Details
详细信息----------Details----------
The Relevance Vector Machine typically leads to sparser models then the SVM. It is probabilistic by nature and any kernel can be used unlike SVM.
相关向量机通常会导致稀疏模型的SVM。它是概率的性质,不像SVM可以使用任何内核。
值----------Value----------
An S4 object of class "rvmbinary" containing the fitted model. Accessor functions can be used to access the slots of the object which include :
S4对象的类“rvmbinary”拟合模型。存取器函数可以用来访问时隙,其中包括的对象:
<table summary="R valueblock"> <tr valign="top"><td>kernel</td> <td> The kernel used to produce the model</td></tr> <tr valign="top"><td>kernelparameter</td> <td> The parameter for the kernel</td></tr> <tr valign="top"><td>nRV</td> <td> Number of relevance vectors</td></tr> <tr valign="top"><td>type</td> <td> Classification or Regression</td></tr> <tr valign="top"><td>vectors</td> <td> The relevance vectors</td></tr> <tr valign="top"><td>values</td> <td> The weights for the relevance vectors</td></tr>
<table summary="R valueblock"> <tr valign="top"> <TD> kernel</ TD> <TD>用于生成模型的内核</ TD> </ TR> <TR VALIGN =“”> <TD>kernelparameter </ TD> <TD>为内核的参数</ TD> </ TR> <tr valign="top"> <TD>nRV <TD>的相关向量的数量/ TD> </ TD> </ TR> <tr valign="top"> <TD>type </ TD> <TD>分类或回归</ TD> </ TR> <tr valign="top"> <TD> vectors </ TD> <TD>的相关向量</ TD> </ TR> <tr valign="top"> <TD><X > </ TD> <td>使用的相关权重向量</ TD> </ TR>
</table> ...
</ TABLE> ...
(作者)----------Author(s)----------
Robert Lowe <br>
<a href="mailto:ral64@cam.ac.uk">ral64@cam.ac.uk</a>
参考文献----------References----------
Tipping, M. E. and A. C. Faul (2003). Fast marginal likelihood maximisation for sparse Bayesian models. In C. M. Bishop and B. J. Frey (Eds.), Proceedings of the Ninth International Workshop on Artificial Intelligence and Statistics, Key West, FL, Jan 3-6.
参见----------See Also----------
ksvm
ksvm
实例----------Examples----------
#Classification[分类]
data(iris)
#Create training and test splits[建立培训和测试的分裂]
datatest=rbind(iris[41:50,],iris[91:100,])
datatrain=rbind(iris[1:40,],iris[51:90,])
#Run model[运行模式]
rvm=rvmbinary(datatrain[,-dim(datatrain)[2]],datatrain[,dim(datatrain)[2]],kernel="rbfdot",parameters=0.1,1000)
#Calculate class probability for test set[计算类的概率为测试集]
y=predict(rvm,datatest[,-dim(datatest)[2]])
# create data For REGRESSION[创建数据对于回归]
x <- c(seq(-20,-0.1,0.1),seq(0.1,20,0.1))
y <- sin(x)/x + rnorm(400,sd=0.05)
# train relevance vector machine[火车相关向量机]
foo <- rvmbinary(x, y)
foo
# print relevance vectors[打印相关向量]
# predict and plot[预测和绘制]
ytest <- predict(foo, x)
plot(x, y, type ="l")
lines(x, ytest, col="red")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|