GenericClusteringStrategy {D2MCS} | R Documentation |
Abstract Feature Clustering Strategy class.
Description
Abstract class used as a template to ensure the proper definition of new customized clustering strategies.
Details
The GenericClusteringStrategy is an archetype class so it cannot be instantiated.
Methods
Public methods
Method new()
A function responsible for creating a GenericClusteringStrategy object.
Usage
GenericClusteringStrategy$new(subset, heuristic, description, configuration)
Arguments
subset
A
Subset
object to perform the clustering strategy.heuristic
The heuristic to be applied. Must inherit from
GenericHeuristic
class.description
A character vector describing the strategy operation.
configuration
Optional customized configuration parameters for the strategy. Must inherited from
StrategyConfiguration
abstract class.
Method getDescription()
The function is used to obtain the description of the strategy.
Usage
GenericClusteringStrategy$getDescription()
Returns
A character vector of NULL if not defined.
Method getHeuristic()
The function returns the heuristic applied for the clustering strategy.
Usage
GenericClusteringStrategy$getHeuristic()
Returns
An object inherited from GenericClusteringStrategy
class.
Method getConfiguration()
The function returns the configuration parameters used to perform the clustering strategy.
Usage
GenericClusteringStrategy$getConfiguration()
Returns
An object inherited from StrategyConfiguration
class.
Method getBestClusterDistribution()
The function obtains the best clustering distribution.
Usage
GenericClusteringStrategy$getBestClusterDistribution()
Returns
A list of clusters. Each list element represents a feature group.
Method getUnclustered()
The function is used to return the features that cannot be clustered due to incompatibilities with the used heuristic.
Usage
GenericClusteringStrategy$getUnclustered()
Returns
A character vector containing the unclassified features.
Method execute()
Abstract function responsible of performing the clustering
strategy over the defined Subset
.
Usage
GenericClusteringStrategy$execute(verbose, ...)
Arguments
verbose
A logical value to specify if more verbosity is needed.
...
Further arguments passed down to
execute
function.
Method getDistribution()
Abstract function used to obtain the set of features following an specific clustering distribution.
Usage
GenericClusteringStrategy$getDistribution( num.clusters = NULL, num.groups = NULL, include.unclustered = FALSE )
Arguments
Returns
A list with the features comprising an specific clustering distribution.
Method createTrain()
Abstract function in charge of creating a
Trainset
object for training purposes.
Usage
GenericClusteringStrategy$createTrain( subset, num.cluster = NULL, num.groups = NULL, include.unclustered = FALSE )
Arguments
Method plot()
Abstract function responsible of creating a plot to visualize the clustering distribution.
Usage
GenericClusteringStrategy$plot(dir.path = NULL, file.name = NULL, ...)
Arguments
dir.path
An optional character argument to define the name of the directory where the exported plot will be saved. If not defined, the file path will be automatically assigned to the current working directory, '
getwd()
'.file.name
The name of the PDF file where the plot is exported.
...
Further arguments passed down to
execute
function.
Method saveCSV()
Abstract function to save the clustering distribution to a CSV file.
Usage
GenericClusteringStrategy$saveCSV(dir.path, name, num.clusters = NULL)
Arguments
dir.path
The name of the directory to save the CSV file.
name
Defines the name of the CSV file.
num.clusters
An optional parameter to select the number of clusters to be saved. If not defined, all clusters will be saved.
Method clone()
The objects of this class are cloneable with this method.
Usage
GenericClusteringStrategy$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.