R/mixsim.R

#' @name mixsim
#' 
#' @title Two-dimensional synthetic data set consisting of ten Gaussian 
#' distributions.   
#' 
#' @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 \code{MixSim}.
#' 
#' @docType data
#' @usage data(mixsim)
#' @format \code{mixsim$x} is a two-dimensional raster stack with the features 
#' and \code{mixsim$y} a one-dimensional raster with the class labels.
#' A data frame with a training set is also available (\code{mixsim$tr}). 
#' @keywords datasets
#' @examples
#' \dontrun{
#' 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) ) ) ) ) 
#' }
NULL
benmack/oneClass documentation built on Dec. 15, 2020, 7:38 p.m.