featurespace: Plot method for 'trainOcc' object

Description Usage Arguments Details Value Examples

Description

Plot the decision values of a trainOcc object in its two dimensional feature space.

Usage

1
2
3
featurespace(x, thresholds = NULL, x.tr = NULL, positive = NULL,
  borders = NULL, nCells = c(100, 100), main = NULL, column = NULL,
  expandColors = TRUE, ...)

Arguments

x

An object of class trainOcc.

thresholds

a scalar or numeric vector used to plot additional contour lines.

x.tr

data to be plotted. must have a column y with labels.

positive

the class of interest in x.tr$y

borders

names list (x, y) with two vectors of length two specifiying the borders of the feature space in horizontal/x- and vertical/y- directions.

nCells

number of cells in horizontal/x- and vertical/y- directions.

main

character string for the plot title

column

select a column in case the model x is not a trainOcc object and returns more then one column, default is 1.

expandColors

if the predictive values are not positive and negative numbers (as in case of the ocsvm and biasedsvm) set this argument to FALSE

...

other arguments that can be passed to predict.

Details

featurespace

This function is an adaptation of plot.ksvm from the kernlab package.

Value

a plot of the feature space

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
data(bananas)
tr <- bananas$tr
### underfitted model
oc <- trainOcc ( x = tr[, -1], y = tr[, 1], 
                 tuneGrid=expand.grid(sigma=0.1, 
                                      cNeg=.1, 
                                      cMultiplier=100))
featurespace(oc, th=0) 

### overfitted model
oc <- trainOcc ( x = tr[, -1], y = tr[, 1], 
                 tuneGrid=expand.grid(sigma=10, 
                                      cNeg=.1, 
                                      cMultiplier=100))
featurespace(oc, th=0) 

## End(Not run)

benmack/oneClass documentation built on Dec. 15, 2020, 7:38 p.m.