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

📄 partialplot.html

📁 本程序是基于linux系统下c++代码
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Partial dependence plot</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 partialPlot {randomForest}"><tr><td>partialPlot {randomForest}</td><td align="right">R Documentation</td></tr></table>
<h2>Partial dependence plot</h2>


<h3>Description</h3>

<p>
Partial dependence plot gives a graphical depiction of the marginal
effect of a variable on the class probability (classification) or
response (regression).
</p>


<h3>Usage</h3>

<pre>
## S3 method for class 'randomForest':
partialPlot(x, pred.data, x.var, which.class,
      w, plot = TRUE, add = FALSE,
      n.pt = min(length(unique(pred.data[, xname])), 51),
      rug = TRUE, xlab=deparse(substitute(x.var)), ylab="",
      main=paste("Partial Dependence on", deparse(substitute(x.var))),
      ...) 
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
an object of class <code>randomForest</code>, which contains a
<code>forest</code> component.</td></tr>
<tr valign="top"><td><code>pred.data</code></td>
<td>
a data frame used for contructing the plot, usually
the training data used to contruct the random forest.</td></tr>
<tr valign="top"><td><code>x.var</code></td>
<td>
name of the variable for which partial
dependence is to be examined.</td></tr>
<tr valign="top"><td><code>which.class</code></td>
<td>
For classification data, the class to focus on
(default the first class).</td></tr>
<tr valign="top"><td><code>w</code></td>
<td>
weights to be used in averaging; if not supplied, mean is not
weighted</td></tr>
<tr valign="top"><td><code>plot</code></td>
<td>
whether the plot should be shown on the graphic device.</td></tr>
<tr valign="top"><td><code>add</code></td>
<td>
whether to add to existing plot (<code>TRUE</code>).</td></tr>
<tr valign="top"><td><code>n.pt</code></td>
<td>
if <code>x.var</code> is continuous, the number of points on the
grid for evaluating partial dependence.</td></tr>
<tr valign="top"><td><code>rug</code></td>
<td>
whether to draw hash marks at the bottom of the plot
indicating the deciles of <code>x.var</code>.</td></tr>
<tr valign="top"><td><code>xlab</code></td>
<td>
label for the x-axis.</td></tr>
<tr valign="top"><td><code>ylab</code></td>
<td>
label for the y-axis.</td></tr>
<tr valign="top"><td><code>main</code></td>
<td>
main title for the plot.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
other graphical parameters to be passed on to <code>plot</code>
or <code>lines</code>.</td></tr>
</table>

<h3>Details</h3>

<p>
The function being plotted is defined as:
</p><p align="center"><i>
tilde{f}(x) = frac{1}{n} sum_{i=1}^n f(x, x_{iC}),
</i></p><p>
where <i>x</i> is the variable for which partial dependence is sought,
and <i>x_{iC}</i> is the other variables in the data.  The summand is
the predicted regression function for regression, and logits
(i.e., log of fraction of votes) for <code>which.class</code> for
classification:
</p><p align="center"><i> f(x) = log p_k(x) - frac{1}{K} sum_{j=1}^K log p_j(x),</i></p><p>
where <i>K</i> is the number of classes, <i>k</i> is <code>which.class</code>,
and <i>p_j</i> is the proportion of votes for class <i>j</i>.
</p>


<h3>Value</h3>

<p>
A list with two components: <code>x</code> and <code>y</code>, which are the values
used in the plot.</p>

<h3>Note</h3>

<p>
The <code>randomForest</code> object must contain the <code>forest</code>
component; i.e., created with <code>randomForest(...,
    keep.forest=TRUE)</code>.
</p>
<p>
This function runs quite slow for large data sets.
</p>


<h3>Author(s)</h3>

<p>
Andy Liaw <a href="mailto:andy_liaw@merck.com">andy_liaw@merck.com</a>
</p>


<h3>References</h3>

<p>
Friedman, J. (2001). Greedy function approximation: the gradient
boosting machine, <EM>Ann. of Stat.</EM>
</p>


<h3>See Also</h3>

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


<h3>Examples</h3>

<pre>
data(airquality)
airquality &lt;- na.omit(airquality)
set.seed(131)
ozone.rf &lt;- randomForest(Ozone ~ ., airquality)
partialPlot(ozone.rf, airquality, Temp)

data(iris)
set.seed(543)
iris.rf &lt;- randomForest(Species~., iris)
partialPlot(iris.rf, iris, Petal.Width, "versicolor")
</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 + -