create_random_subset: Create a random subset of a dataset

Description Usage Arguments Value See Also Examples

View source: R/sampling.R

Description

Create a random subset of a dataset

Usage

1
2
3
4
5
6
create_random_subset(
  mdata,
  instances,
  attributes = mdata$measures$num.inputs,
  replacement = FALSE
)

Arguments

mdata

A mldr dataset

instances

The number of expected instances

attributes

The number of expected attributes. (Default: all attributes)

replacement

A boolean value to define sample with replacement or not. (Default: FALSE)

Value

A new mldr subset

See Also

Other sampling: create_holdout_partition(), create_kfold_partition(), create_subset()

Examples

1
2
small.toy <- create_random_subset(toyml, 10, 3)
medium.toy <- create_random_subset(toyml, 50, 5)

rivolli/utiml documentation built on June 1, 2021, 11:48 p.m.