Learn R Programming

D2MCS (version 1.0.1)

Subset: Classification set.

Description

The Subset is used for testing or classification purposes. If a target class is defined the Subset can be used as test and classification, otherwise the Subset only classification is compatible.

Arguments

Methods


Method new()

Method for initializing the object arguments during runtime.

Usage

Subset$new(
  dataset,
  class.index = NULL,
  class.values = NULL,
  positive.class = NULL,
  feature.id = NULL
)

Arguments

dataset

A fully filled data.frame.

class.index

A numeric value identifying the column representing the target class

class.values

A character vector containing all the values of the target class.

positive.class

A character value representing the positive class value.

feature.id

A numeric value specifying the column number used as identifier.


Method getColumnNames()

Get the name of the columns comprising the subset.

Usage

Subset$getColumnNames()

Returns

A character vector containing the name of each column.


Method getFeatures()

Gets the values of all features or those indicated by arguments.

Usage

Subset$getFeatures(feature.names = NULL)

Arguments

feature.names

A character vector comprising the name of the features to be obtained.

Returns

A character vector or NULL if subset is empty.


Method getID()

Gets the column name used as identifier.

Usage

Subset$getID()

Returns

A character vector of size 1 of NULL if column id is not defined.


Method getIterator()

Creates the DIterator object.

Usage

Subset$getIterator(chunk.size = private$chunk.size, verbose = FALSE)

Arguments

chunk.size

An integer value indicating the size of chunks taken over each iteration. By default chunk.size is defined as 10000.

verbose

A logical value to specify if more verbosity is needed.

Returns

A DIterator object to transverse through Subset instances.


Method getClassValues()

Gets all the values of the target class.

Usage

Subset$getClassValues()

Returns

A factor vector with all the values of the target class.


Method getClassBalance()

The function is used to compute the ratio of each class value in the Subset.

Usage

Subset$getClassBalance(target.value = NULL)

Arguments

target.value

The class value used as reference to perform the comparison.

Returns

A numeric value.


Method getClassIndex()

The function is used to obtain the index of the column containing the target class.

Usage

Subset$getClassIndex()

Returns

A numeric value.


Method getClassName()

The function is used to specify the name of the column containing the target class.

Usage

Subset$getClassName()

Returns

A character value.


Method getNcol()

The function is in charge of obtaining the number of columns comprising the Subset. See ncol for more information.

Usage

Subset$getNcol()

Returns

An integer of length 1 or NULL.


Method getNrow()

The function is used to determine the number of rows present in the Subset. See nrow for more information.

Usage

Subset$getNrow()

Returns

An integer of length 1 or NULL.


Method getPositiveClass()

The function returns the value of the positive class.

Usage

Subset$getPositiveClass()

Returns

A character vector of size 1 or NULL if not defined.


Method isBlinded()

The function is used to check if the Subset contains a target class.

Usage

Subset$isBlinded()

Returns

A logical value where TRUE represents the absence of target class and FALSE its presence.

Details

Use Dataset to ensure the creation of a valid Subset object.

See Also

Dataset, DatasetLoader, Trainset