plot_proj
and plot_importance
are convenience functions providing diagnostic plots for projections, plot_proj
plots predictions. This function is tailored for use on ranger projections, with out-of bag predictions for the training set shown in blue, and predictions for points outside the training set shown in black. Either parm
or proj
will then be needed to identify the projection to be plotted (perhaps both in some programming contexts, or if other projections methods are used).
plot_importance
plots the importance metric variable.importance
stored in a ranger
object. Here, the projection may be identified by either parm
or proj
, or even directly provided as the object
.
plot_proj(
object, parm=NULL, proj,
new_rawdata,
use_oob=Infusion.getOption("use_oob"), is_trainset=FALSE,
xlab=NULL, ylab=NULL, ...) plot_importance(object, parm, proj, n.var = 30L, xlim=NULL,
xlab = "Variable Importance", ylab = "", main="", ...)
These functions are mainly used for their side effect (the plot). plot_importance
returns the vector of importance values invisibly. plot_proj
returns invisibly, for each parameter a list with the x
,y
xlab
and ylab
elements of the plot
call, or a structured list of such lists when plots are produced for several parameters.
An object of class SLik_j
. For plot_importance
, it may also be an object of class ranger
.
Character string: a parameter name. Either one of parm
or proj
is required to get a diagnostic plot for a specific projector. Otherwise, a multipanel plot will be produced for all projectors.
Character string: name of projected statistic.
Reference table on which projections should be computed. If NULL,
projections are not recomputed. Instead, the values stored in the object
are used.
Passed to project.default
. Ignored if new_rawdata
is NULL.
Integer: (maximum) number of predictor variables to be included in the plot.
Passed to plot
(for plot_proj
) or to dotchart
(for plot_importance
).
Projectors may be updated in an object after the projected statistics have been computed and included in the reference table, without any explicit action of the user on the object (see general information about Infusion for why and when this may occur). In particular the projectors stored in input and output fit objects of a refine
call are stored in the same environment, and therefore the projectors stored in the input object are modified in light of new simulations. In that case, the plots produced by plot_proj
may reflect properties either of the updated projections (if new_rawdata
is used), or worse, may mix results of different projections (if new_rawdata
is not used). A message or a warning may be issued when such events occur.
## see Note for links to examples.
Run the code above in your browser using DataLab