⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 predict.qda.html

📁 本程序是基于linux系统下c++代码
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Classify from Quadratic Discriminant Analysis</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for predict.qda {MASS}"><tr><td>predict.qda {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Classify from Quadratic Discriminant Analysis</h2>


<h3>Description</h3>

<p>
Classify multivariate observations in conjunction with <code>qda</code>
</p>


<h3>Usage</h3>

<pre>
## S3 method for class 'qda':
predict(object, newdata, prior = object$prior,
        method = c("plug-in", "predictive", "debiased", "looCV"), ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>object</code></td>
<td>
object of class <code>"qda"</code>
</td></tr>
<tr valign="top"><td><code>newdata</code></td>
<td>
data frame of cases to be classified or, if <code>object</code>
has a formula, a data frame with columns of the same names as the
variables used.  A vector will be interpreted
as a row vector.  If newdata is missing, an attempt will be
made to retrieve the data used to fit the <code>qda</code> object.
</td></tr>
<tr valign="top"><td><code>prior</code></td>
<td>
The prior probabilities of the classes, by default the proportions in the
training set or what was set in the call to <code>qda</code>.
</td></tr>
<tr valign="top"><td><code>method</code></td>
<td>
This determines how the parameter estimation is handled. With <code>"plug-in"</code>
(the default) the usual unbiased parameter estimates are used and
assumed to be correct. With <code>"debiased"</code> an unbiased estimator of
the log posterior probabilities is used, and with <code>"predictive"</code> the
parameter estimates are integrated out using a vague prior.  With
<code>"looCV"</code> the leave-one-out cross-validation fits to the original
dataset are computed and returned.
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
arguments based from or to other methods
</td></tr>
</table>

<h3>Details</h3>

<p>
This function is a method for the generic function
<code>predict()</code> for class <code>"qda"</code>.
It can be invoked by calling <code>predict(x)</code> for an
object <code>x</code> of the appropriate class, or directly by
calling <code>predict.qda(x)</code> regardless of the
class of the object.
</p>
<p>
Missing values in <code>newdata</code> are handled by returning <code>NA</code> if the
quadratic discriminants cannot be evaluated. If <code>newdata</code> is omitted and
the <code>na.action</code> of the fit omitted cases, these will be omitted on the
prediction.
</p>


<h3>Value</h3>

<p>
a list with components
</p>
<table summary="R argblock">
<tr valign="top"><td><code>class</code></td>
<td>
The MAP classification (a factor)
</td></tr>
<tr valign="top"><td><code>posterior</code></td>
<td>
posterior probabilities for the classes
</td></tr>
</table>

<h3>References</h3>

<p>
Venables, W. N. and Ripley, B. D. (2002)
<EM>Modern Applied Statistics with S.</EM> Fourth edition.  Springer.
</p>
<p>
Ripley, B. D. (1996)
<EM>Pattern Recognition and Neural Networks</EM>. Cambridge University Press.
</p>


<h3>See Also</h3>

<p>
<code><a href="qda.html">qda</a></code>, <code><a href="lda.html">lda</a></code>, <code><a href="predict.lda.html">predict.lda</a></code>
</p>


<h3>Examples</h3>

<pre>
tr &lt;- sample(1:50, 25)
train &lt;- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3])
test &lt;- rbind(iris3[-tr,,1], iris3[-tr,,2], iris3[-tr,,3])
cl &lt;- factor(c(rep("s",25), rep("c",25), rep("v",25)))
zq &lt;- qda(train, cl)
predict(zq, test)$class
</pre>



<hr><div align="center">[Package <em>MASS</em> version 7.2-44 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -