mixsim: Two-dimensional synthetic data set consisting of ten Gaussian...

Description Usage Format Examples

Description

The average overlap between the distributions is 0.1 and the maximum overlap of 0.5. The data has been generated with the package MixSim.

Usage

1

Format

mixsim$x is a two-dimensional raster stack with the features and mixsim$y a one-dimensional raster with the class labels. A data frame with a training set is also available (mixsim$tr).

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
## Not run: 
data(mixsim)

### plot the features and labels (raster)
plot(stack(mixsim$x, mixsim$y))

### plot the training data (classes 2:4 in mixsim$y form the positive class)
plot(mixsim$tr[, -1], col = c('#d6604d', '#2166ac')[mixsim$tr[, 1]+1], pch=16)

### the training data mixsim.tr has been created as follows:

seed <- 123
comp.pos <- c(2:4)  # classes in mixsim.y forming the positive class
n.pos <- 30         # number of positive samples for the training set
n.un <- 300         # number of unlabeled samples for the training set

set.seed(seed)
mixsim$tr <- cbind( y = rep( c( 1, 0 ), c( n.pos, n.un ) ),
                    rbind(
                      extract( mixsim$x, # extract the positive samples
                         sample( which( values( mixsim$y ) %in% c(2:4) ), 
                           n.pos ) ), 
                      extract( mixsim$x, # extract the unlabeled samples
                         sample(ncell(mixsim$x), n.un) ) ) ) ) 

## End(Not run)

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