subsample: Subsample a pixel_data object

Description Usage Arguments

Description

Subsample a pixel_data object

Usage

1
2
3
4
5
6
subsample(x, size, strata = "sources", type = "training", flag = TRUE,
  classes = levels(x@y))

## S4 method for signature 'pixel_data,numeric'
subsample(x, size, strata = "sources",
  type = "training", flag = TRUE, classes = levels(x@y))

Arguments

x

a pixel_data object

size

either 1) a number from 0 to 1, indicating size is the fraction of pixels to sample, or 2) a number greater than 1, in which case size is the number of pixels to sample. Size applies per strata, if stratification is chosen.

strata

whether to draw samples from within individual classes, nested within source polygons (strata='sources'), or from within individual classes alone (strata='classes')

type

whether to subsample training data (type='training') or testing data (type='testing'). Whichever type is chosen, the other type will be left untouched (for example, if type='testing', the training data will not be changed).

flag

whether to swap training flag on sampled data (for example, flag sampled training data as testing data, if flag=TRUE and type='training') or remove sampled data from dataset entirely (flag=FALSE).

classes

specifies which classes to sample, defaults to all classes in x


azvoleff/teamlucc documentation built on June 4, 2017, 12:08 a.m.