Datasets: Datasets Class

Description Usage Arguments Value Super classes Active bindings Methods

Description

Key-value dictionary contains data.frame class objects. This class is used to extract train and test data for model input, and also contains ResampleCalls class object to generate resamples.

Usage

1
2
3
4
5
6
7
new_datasets(
  ...,
  .id_col = NULL,
  .test_ids = NULL,
  .resample_calls = NULL,
  .value_width = Inf
)

Arguments

...

Key and value pairs.

.id_col

A character scalar. An id column name contains integer ids. Leave NULL if dataset does not have id column.

.test_ids

A integer vector specifiying test data. If id_col is not NULL, test_ids must be id_col ranges. If NULL test_ids are considered as row numbers.

.resample_calls

A ResampleCalls class object.

.value_width

A integer scalar of character length. Used as max width of output value by self$print() method.

Value

A new Datasets class object

Super classes

Dict::Dict -> ml4e::Option -> Datasets

Active bindings

id_col

An id column name.

test_ids

Test data ids.

resample_calls

A ResampleCalls class object.

has_id_col

Wheather to have id_col.

has_test_ids

Wheather to have test_ids.

has_resample_calls

Wheather to have resample_calls.

Methods

Public methods

Inherited methods

Method new()

Construct a new Datasets class object.

Usage
Datasets$new(
  ...,
  .id_col = NULL,
  .test_ids = NULL,
  .resample_calls = NULL,
  .value_width = Inf
)
Arguments
...

Key and value pairs.

.id_col

A character scalar. An id column name contains integer ids. Leave NULL if dataset does not have id column.

.test_ids

A integer vector specifiying test data. If id_col is not NULL, test_ids must be id_col ranges. If NULL test_ids are considered as row numbers.

.resample_calls

A ResampleCalls class object.

.value_width

A integer scalar of character length. Used as max width of output value by self$print() method.

Returns

A new Datasets class object


Method print()

Print object.

Usage
Datasets$print()

Method add()

Adds key-value objects to the dictionary.

Usage
Datasets$add(...)
Arguments
...

Key and value pairs.


Method get()

Get data.

Usage
Datasets$get(key = NULL, preproc_call = NULL)
Arguments
key

A character or integer scalar of the keys.

preproc_call

A call to convert data.

Returns

A data.frame.


Method get_train()

Get train data.

Usage
Datasets$get_train(key = NULL, preproc_call = NULL)
Arguments
key

A character or integer scalar of the keys.

preproc_call

A call to convert data.

Returns

A data.frame of train data.


Method get_test()

Get test data.

Usage
Datasets$get_test(key = NULL, preproc_call = NULL)
Arguments
key

A character or integer scalar of the keys.

preproc_call

A call to convert data.

Returns

A data.frame of test data.


Method get_resample()

Get resample data. Internally call self$resample_calls$get_resample().

Usage
Datasets$get_resample(
  dataset_key = NULL,
  resample_call_key = NULL,
  seed = NULL,
  preproc_call = NULL
)
Arguments
dataset_key

A character or integer scalar of the datasets keys.

resample_call_key

A character or integer scalar of the resample_calls keys.

seed

A integer scalar seed.

preproc_call

A call to convert data.

Returns

A resample of rset class object.


Method clone()

The objects of this class are cloneable with this method.

Usage
Datasets$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


five-dots/ml4e documentation built on June 19, 2020, 4:26 p.m.