R: Downsample (subsample) a task or a data.frame.

downsample {mlr} | R Documentation

## Downsample (subsample) a task or a data.frame.

### Description

Decrease the observations in a `task` or a `ResampleInstance` to a given percentage of observations.

### Usage

    downsample(obj, perc = 1, stratify = FALSE)

### Arguments

`obj` | (Task | ResampleInstance) Input data or a `ResampleInstance`.
`perc` | (`numeric(1)`) Percentage from (0, 1). Default is 1.
`stratify` | (`logical(1)`) Only for classification: Should the downsampled data be stratified according to the target classes? Default is `FALSE`.

### Value

([data.frame`| [Task] | [ResampleInstance]). Same type as`obj'.

### See Also

makeResampleInstance

Other downsample: `makeDownsampleWrapper()`

[Package mlr version 2.17.1 Index]