hist.trainOcc: Diagnostic distributions plot for a 'trainOcc' object.

Description Usage Arguments Details Value Examples

View source: R/hist.trainOcc_ggplot.R View source: R/hist.trainOcc.R

Description

The histogram of the predicted unlabeled data is shown together with the hold-out predictions of the positive and unlabeled traning data (boxplots).

Usage

1
2
3
4
5
## S3 method for class 'trainOcc'
hist(x, predUn = NULL, th = NULL, cab = NULL,
  main = NULL, ylim = NULL, breaks = "Scott", col = "grey",
  border = NA, xlim = NULL, add_calBoxplot = TRUE,
  noWarnRasHist = FALSE, ...)

Arguments

x

an object of class trainOcc.

predUn

a vector of unlabeled predictions (if NULL x$predUn is used, if existing).

th

draw vertical lines in the histogram, indication for a threshold.

cab

for a color-coded histogram a list with elements colors (vector of R colors, length n) and breaks (vector of numeric values, length n+1).

main

a title for the plot. if not given the parameters of the model are added.

ylim

the y limits of the plot.

breaks

see identically named argument in hist

col

a colour to be used to fill the bars.

border

the color of the border around the bars.

add_calBoxplot

bool. Should the positive calibration predictions be plotted? Defaults to TRUE.

noWarnRasHist

Supresses warning when histogram is derived from raster.

...

other arguments that can be passed to plot.

Details

hist.trainOcc

Value

Diagnostic distributions plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
data(bananas)
### an underfitted model 
oc <- trainOcc (x = bananas$tr[, -1], y = bananas$tr[, 1], 
                tuneGrid=expand.grid(sigma=0.1, 
                                     cNeg=0.5, 
                                     cMultiplier=16))
### predict 10% or the unlabeled data and plot 
# the diagnostic distributions plot
# and the model in the 2D feature space 
set.seed(123)
idx.pred <- sample(400*400, 16000)
hist(oc, predict(oc, bananas$x[][idx.pred,]), th=0)
featurespace(oc, th=0)

### an overfitted model 
oc <- trainOcc (x = bananas$tr[, -1], y = bananas$tr[, 1], 
                tuneGrid=expand.grid(sigma=1, 
                                     cNeg=32, 
                                     cMultiplier=16))
### predict 10% or the unlabeled data and plot 
# the diagnostic distributions plot
# and the model in the 2D feature space 
set.seed(123)
idx.pred <- sample(400*400, 16000)
hist(oc, predict(oc, bananas$x[][idx.pred,]), th=0)
featurespace(oc, th=0)

### a good model 
oc <- trainOcc (x = bananas$tr[, -1], y = bananas$tr[, 1], 
                tuneGrid=expand.grid(sigma=1, 
                                     cNeg=0.0625, 
                                     cMultiplier=64))
### predict 10% or the unlabeled data and plot 
# the diagnostic distributions plot
# and the model in the 2D feature space 
set.seed(123)
idx.pred <- sample(400*400, 16000)
hist(oc, predict(oc, bananas$x[][idx.pred,]), th=0)
featurespace(oc, th=0)

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