📄 varused.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Variables used in a random forest</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 varUsed {randomForest}"><tr><td>varUsed {randomForest}</td><td align="right">R Documentation</td></tr></table>
<h2>Variables used in a random forest</h2>
<h3>Description</h3>
<p>
Find out which predictor variables are actually used in the random forest.
</p>
<h3>Usage</h3>
<pre>
varUsed(x, by.tree=FALSE, count=TRUE)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
An object of class <code>randomForest</code>.</td></tr>
<tr valign="top"><td><code>by.tree</code></td>
<td>
Should the list of variables used be broken down by
trees in the forest?</td></tr>
<tr valign="top"><td><code>count</code></td>
<td>
Should the frequencies that variables appear in trees be
returned?</td></tr>
</table>
<h3>Value</h3>
<p>
If <code>count=TRUE</code> and {by.tree=FALSE}, a integer vector containing
frequencies that variables are used in the forest. If
<code>by.tree=TRUE</code>, a matrix is returned, breaking down the counts by
tree (each column corresponding to one tree and each row to a variable).
<br>
If <code>count=FALSE</code> and <code>by.tree=TRUE</code>, a list of integer
indices is returned giving the variables used in the trees, else if
<code>by.tree=FALSE</code>, a vector of integer indices giving the
variables used in the entire forest.</p>
<h3>Author(s)</h3>
<p>
Andy Liaw
</p>
<h3>See Also</h3>
<p>
<code><a href="randomForest.html">randomForest</a></code>
</p>
<h3>Examples</h3>
<pre>
data(iris)
set.seed(17)
varUsed(randomForest(Species~., iris, ntree=100))
</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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -