Skip to contents

Provides a convenient stream interface for data sets from the mlbench package.

Usage

DSD_mlbenchData(data = NULL, loop = FALSE, random = FALSE, scale = FALSE)

Arguments

data

The name of the dataset from mlbench. If missing then a list of all available data sets is shown and returned.

loop

logical; loop or not to loop over the data frame.

random

logical; should the data be used a random order?

scale

logical; apply scaling to the data?

Value

Returns a DSD_mlbenchData object which is also of class DSD_Memory.

Details

The DSD_mlbenchData class is designed to be a wrapper class for data from the mlbench package.

All data is held in memory in either data frame or matrix form. It is served as a stream using the DSD_Memory class. The stream can be reset to position 1 using reset_stream().

Call DSD_mlbenchData with a missing value for data to get a list of all available data sets.

Author

Michael Hahsler and Matthew Bolanos

Examples

DSD_mlbenchData()
#> Available data sets:
#>  [1] "BostonHousing"       "BostonHousing2"      "BreastCancer"       
#>  [4] "DNA"                 "Glass"               "Ionosphere"         
#>  [7] "LetterRecognition"   "Ozone"               "PimaIndiansDiabetes"
#> [10] "Satellite"           "Servo"               "Shuttle"            
#> [13] "Sonar"               "Soybean"             "Vehicle"            
#> [16] "Vowel"               "Zoo"                 "HouseVotes84"       

stream <- DSD_mlbenchData("Shuttle")
stream
#> mlbench:Shuttle(d = 9, k = 7) 
#> Class: DSD_mlbenchData, DSD_Memory, DSD_R, DSD 
#> Contains 58000 data points - currently at position 1 - loop is FALSE 

get_points(stream, n = 5)
#>   V1 V2 V3 V4 V5  V6 V7 V8 V9 .class
#> 1 50 21 77  0 28   0 27 48 22      2
#> 2 55  0 92  0  0  26 36 92 56      4
#> 3 53  0 82  0 52  -5 29 30  2      1
#> 4 37  0 76  0 28  18 40 48  8      1
#> 5 37  0 79  0 34 -26 43 46  2      1

plot(stream, n = 100)