Description Usage Arguments Examples
This is a function for assisting with 3d plots for the predictive analytics course
1 2 |
model |
A model object as returned by the caret::train function |
xvar |
The variable to be plotted as the x axis |
yvar |
The variable to be plotted as the y axis |
zvar |
The response variable being predicted |
phi |
Angle defining the viewing direction. phi give the colatitude direction. Default 30. |
theta |
Angles defining the viewing direction. theta gives the azimuthal direction. Default 30. |
points |
A logical argument if TRUE the resultant plot will also show the observed points around the fitted surface with red points highlighting those for which the model under estimates and blue points for those points which are below the surface. Note this can get messy when there are large numbers of points. |
... |
Other parameters to be passed to the persp function |
1 2 3 | data(advertising)
m = caret::train(Sales~TV + Radio, data = advertising, method = "lm")
plot3d(m,advertising$TV, advertising$Radio, advertising$Sales, points = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.