| 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
subsetA
Subsetobject to perform the clustering strategy.heuristicThe heuristic to be applied. Must inherit from
GenericHeuristicclass.descriptionA character vector describing the strategy operation.
configurationOptional customized configuration parameters for the strategy. Must inherited from
StrategyConfigurationabstract 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
verboseA logical value to specify if more verbosity is needed.
...Further arguments passed down to
executefunction.
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.pathAn 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.nameThe name of the PDF file where the plot is exported.
...Further arguments passed down to
executefunction.
Method saveCSV()
Abstract function to save the clustering distribution to a CSV file.
Usage
GenericClusteringStrategy$saveCSV(dir.path, name, num.clusters = NULL)
Arguments
dir.pathThe name of the directory to save the CSV file.
nameDefines the name of the CSV file.
num.clustersAn 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
deepWhether to make a deep clone.