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.
new()
Method for initializing the object arguments during runtime.
Subset$new(
dataset,
class.index = NULL,
class.values = NULL,
positive.class = NULL,
feature.id = NULL
)
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.
getColumnNames()
Get the name of the columns comprising the subset.
Subset$getColumnNames()
A character vector containing the name of each column.
getFeatures()
Gets the values of all features or those indicated by arguments.
Subset$getFeatures(feature.names = NULL)
feature.names
A character vector comprising the name of the features to be obtained.
A character vector or NULL if subset is empty.
getID()
Gets the column name used as identifier.
Subset$getID()
A character vector of size 1 of NULL if column id is not defined.
getIterator()
Creates the DIterator object.
Subset$getIterator(chunk.size = private$chunk.size, verbose = FALSE)
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.
A DIterator
object to transverse through
Subset
instances.
getClassValues()
Gets all the values of the target class.
Subset$getClassValues()
A factor vector with all the values of the target class.
getClassBalance()
The function is used to compute the ratio of each class
value in the Subset
.
Subset$getClassBalance(target.value = NULL)
target.value
The class value used as reference to perform the comparison.
A numeric value.
getClassIndex()
The function is used to obtain the index of the column containing the target class.
Subset$getClassIndex()
A numeric value.
getClassName()
The function is used to specify the name of the column containing the target class.
Subset$getClassName()
A character value.
getNcol()
The function is in charge of obtaining the number of columns
comprising the Subset
. See ncol
for more
information.
Subset$getNcol()
getNrow()
The function is used to determine the number of rows present
in the Subset
. See nrow
for more information.
Subset$getNrow()
getPositiveClass()
The function returns the value of the positive class.
Subset$getPositiveClass()
isBlinded()
The function is used to check if the Subset contains a target class.
Subset$isBlinded()
Use Dataset
to ensure the creation of a valid
Subset
object.
Dataset
, DatasetLoader
,
Trainset