Skip to contents

CategoricalDataRaw creates an data object which can be used as source object to instantiate categorical base learner.

Format

S4 object.

Arguments

x

(character())
Categorical vector.

data_identifier

(character(1))
Data id, e.g. a feature name.

Usage


CategoricalDataRaw$new(x, data_identifier)

Fields

This class doesn't contain public fields.

Methods

  • $getData(): () -> stop()
    Throws error because no representation is calculated.

  • $getRawData(): () -> character()

  • $getIdentifier(): () -> character(1)

Inherited methods from Data

  • $getDataType(): () -> character(1)

Examples

# Sample data:
x = sample(c("one","two", "three"), 20, TRUE)

# Create new data object:
data_obj = CategoricalDataRaw$new(x, "cat_raw")

# Get data and identifier:
data_obj$getRawData()
#>  [1] "two"   "two"   "one"   "two"   "two"   "two"   "three" "two"   "two"  
#> [10] "one"   "one"   "three" "two"   "three" "two"   "one"   "three" "three"
#> [19] "one"   "three"
data_obj$getIdentifier()
#> [1] "cat_raw"