margin.html

来自「本程序是基于linux系统下c++代码」· HTML 代码 · 共 87 行

HTML
87
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Margins of randomForest Classifier</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 margin {randomForest}"><tr><td>margin {randomForest}</td><td align="right">R Documentation</td></tr></table>
<h2>Margins of randomForest Classifier</h2>


<h3>Description</h3>

<p>
Compute or plot the margin of predictions from a randomForest classifier.
</p>


<h3>Usage</h3>

<pre>
margin(rf, observed)
## S3 method for class 'margin':
plot(x, sort=TRUE, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>rf</code></td>
<td>
an object of class <code><a href="randomForest.html">randomForest</a></code>, whose
<code>type</code> is not <code>regression</code>.</td></tr>
<tr valign="top"><td><code>observed</code></td>
<td>
the response variable (a factor) used to train
<code>rf</code>.</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
an object of class <code>margin</code>, as returned by the function
<code>margin</code>.</td></tr>
<tr valign="top"><td><code>sort</code></td>
<td>
Should the data be sorted by their class labels?</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
other graphical parameters to be passed to <code>plot.default</code>.</td></tr>
</table>

<h3>Value</h3>

<p>
For <code>margin</code>, the <EM>margin</EM> of observations from the
<code><a href="randomForest.html">randomForest</a></code> classifier.  The margin of a data point is defined as the
proportion of votes for the correct class minus maximum proportion of
votes for the other classes.  Thus under majority votes, positive
margin means correct classification, and vice versa.</p>

<h3>Author(s)</h3>

<p>
Robert Gentlemen, with slight modifications by Andy Liaw
</p>


<h3>See Also</h3>

<p>
<code><a href="randomForest.html">randomForest</a></code>
</p>


<h3>Examples</h3>

<pre>
set.seed(1)
data(iris)
iris.rf &lt;- randomForest(Species ~ ., iris, keep.forest=FALSE)
plot(margin(iris.rf, iris$Species))
</pre>



<hr><div align="center">[Package <em>randomForest</em> version 4.5-27 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

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