plotSelected.sisal {sisal} | R Documentation |
Plotting Sets of Inputs Produced by Sequential Input Selection
Description
Draws a table depicting the inputs selected by a number of
sisal
runs, one row for each run.
Usage
## S3 method for class 'sisal'
plotSelected(x, useAllNames = TRUE,
pickIntPart = FALSE, intTransform = function(x) x,
formatCArgs = list(), xLabels = 1, yLabels = NULL,
L.f.color = "black", L.v.color = "grey50",
other.color = "white", naFill = other.color,
naStripes = L.v.color, selectedLabels = TRUE,
otherLabels = FALSE,
labelPar = gpar(fontface = 1, fontsize = 20, cex = 0.35),
nestedPar = gpar(fontface = 3),
ranking = c("pairwise", "nested"), tableArgs = list(),
...)
## S3 method for class 'list'
plotSelected(x, ...)
Arguments
x |
an object of class |
useAllNames |
a |
pickIntPart |
a |
intTransform |
a |
formatCArgs |
a named |
xLabels |
a |
yLabels |
a |
L.f.color |
fill color for table cells representing an input variable in the L.f set. |
L.v.color |
fill color for table cells representing an input variable in the L.v set. |
other.color |
fill color for table cells representing an input variable outside both L.f and L.v. |
naFill |
background color for table cells representing a missing input variable. |
naStripes |
stripe color for table cells representing a missing input variable. |
selectedLabels |
a |
otherLabels |
a |
labelPar |
graphical parameters for labels of table cells. |
nestedPar |
graphical parameters for labels on rows that
represent input selection runs where the best nodes of each size are
all nested. See ‘Details’. Only used if
|
ranking |
which input ranking method(s) to use. A
|
tableArgs |
a named |
... |
In the |
Details
Currently the "sisal"
and "list"
methods are the only
methods for the generic function plotSelected
defined by the
sisal package.
Mathematical annotation can be used in text. See plotmath. If
the same input is in both the L.f and the L.v sets,
L.f.color
and L.v.color
are mixed in
alternating stripes. See col2rgb
for a description of
possible color values.
The importance rank of input variables is determined using one or both
of the following two methods (see ranking
):
- "nested"
-
This method requires that all the nodes with the smallest validation error among the nodes with the same number of input variables are nested. Let's imagine a path through the incrementally smaller best nodes (not necessarily a path in the search graph) where the edges are labeled with the ID of the input removed in order to create the smaller model. In this ranking method, the remaining input variable gets rank 1. Traversing the path in the reverse direction and printing the edge labels produces the rest of the input variables from smaller rank to larger. If
hbranches = 1
insisal
, the models are always nested and the method agrees with"pairwise"
. - "pairwise"
-
This is Copeland's pairwise aggregation method. It can be used in all cases, unlike
"nested"
. The score of an input variable is the number of pairwise victories minus the number of pairwise defeats when compared with other inputs. The inputs are ranked by their score. The method may result in ties. Tied nodes are ranked according toties.method = "min"
inrank
.The pairwise comparisons are performed in the following way: In
sisal
, at each stage of the search, input variables are ordered and inputs are removed starting from one or more (whenhbranches > 1
) of the worst ones according to that order. A record, let's sayC[A, B]
, is kept of each pair of inputs (A, B) in order to keep track of how many times A was better than B. Let L be the set of inputs to remove at the current stage of the search in one of the branches and M the set of remaining inputs. Then,C[A, B]
is incremented by one for all A in M and B in L, but also for all A in L and B in L such that A is better than B according to the order used for picking the inputs to remove. A gets a pairwise victory over B ifC[A, B] > C[B, A]
.
For information on setting graphical parameters
(labelPar
, nestedPar
), see
gpar
.
Value
The function is usually called for the side effect (a plot is drawn),
but it also returns a grob
representation of the plot.
Author(s)
Mikko Korpela
References
Pomerol, J.-C. and Barba-Romero, S. (2000) Multicriterion decision in management: principles and practice. Springer. p. 122. ISBN: 0-7923-7756-7.
See Also
sisal
, sisalTable
,
plotmath, gpar
Examples
library(grDevices)
library(grid)
toy1.2 <- list(testSisal(Mtimes=10, stepsAhead=1, dataset="tsToy"),
testSisal(Mtimes=10, stepsAhead=2, dataset="tsToy"))
## Resizing enabled:
## - mathematical expressions in titles
## - extracting the integer part of input variable names
grid.newpage()
plotSelected(toy1.2, yLabels = c("+1", "+2"),
main = "Toy time series",
xlab = expression(paste("input variables ",
italic(y[t+l]))),
ylab = expression(paste("output ", italic(y[t+k]))),
pickIntPart = TRUE, intTransform = function(x) -x)
## Fixed size plot:
## - some graphical parameters adjusted
## - cex in labelPar adjusts the space around the text in table cells
## - new device the same size as the plot
grb <- plotSelected(toy1.2, resizeText = FALSE, resizeTable = FALSE,
axesPar = gpar(fontsize = 11, col = "red"),
labelPar = gpar(fontsize = 14/0.25, cex = 0.25),
fg = "wheat", outerRect = FALSE,
linePar = gpar(lty = "dashed"),
xAxisRot = 45, just = c("left", "top"),
tableArgs = list(x = 0, y = 1), draw = FALSE)
devWidth <- convertWidth(grobWidth(grb), unitTo = "inches",
valueOnly = TRUE)
devHeight <- convertHeight(grobHeight(grb), unitTo = "inches",
valueOnly = TRUE)
dev.new(width = devWidth, height = devHeight, units = "in", res = 72)
grid.draw(grb)
if (interactive()) {
dev.set(dev.prev())
} else {
dev.off()
}