| ClassificationOutput {D2MCS} | R Documentation | 
D2MCS Classification Output.
Description
Allows computing the classification performance values achieved
by D2MCS. The class is automatically created when D2MCS
classification method is invoked.
Methods
Public methods
Method new()
Method for initializing the object arguments during runtime.
Usage
ClassificationOutput$new(voting.schemes, models)
Arguments
voting.schemesA list containing the voting schemes used (inherited from
VotingStrategy.modelsA list containing the used
Modelduring classification stage.
Method getMetrics()
The function returns the measures used during training stage.
Usage
ClassificationOutput$getMetrics()
Returns
A character vector or NULL if training was not performed.
Method getPositiveClass()
The function gets the name of the positive class used for training/classification.
Usage
ClassificationOutput$getPositiveClass()
Returns
A character vector of size 1.
Method getModelInfo()
The function compiled all the information concerning to the M.L. models used during training/classification.
Usage
ClassificationOutput$getModelInfo(metrics = NULL)
Arguments
metricsA character vector defining the metrics used during training/classification.
Returns
A list with the information of each M.L. model.
Method getPerformances()
The function is used to compute the performance of D2MCS.
Usage
ClassificationOutput$getPerformances( test.set, measures, voting.names = NULL, metric.names = NULL, cutoff.values = NULL )
Arguments
test.setA
Subsetobject used to compute the performance.measuresA character vector with the measures to be used to compute performance value (inherited from
MeasureFunction).voting.namesA character vector with the name of the voting schemes to analyze the performance. If not defined, all the voting schemes used during classification stage will be taken into account.
metric.namesA character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.
cutoff.valuesA character vector defining the minimum probability used to perform a a positive classification. If is not defined, all cutoffs used during classification stage will be taken into account.
dir.pathA character vector with location where the plot will be saved.
Returns
A list of performance values.
Method savePerformances()
The function is used to save the computed predictions into a CSV file.
Usage
ClassificationOutput$savePerformances( dir.path, test.set, measures, voting.names = NULL, metric.names = NULL, cutoff.values = NULL )
Arguments
dir.pathA character vector with location where the plot will be saved.
test.setA
Subsetobject used to compute the performance.measuresA character vector with the measures to be used to compute performance value (inherited from
MeasureFunction).voting.namesA character vector with the name of the voting schemes to analyze the performance. If not defined, all the voting schemes used during classification stage will be taken into account.
metric.namesA character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.
cutoff.valuesA character vector defining the minimum probability used to perform a a positive classification. If is not defined, all cutoffs used during classification stage will be taken into account.
Method plotPerformances()
The function allows to graphically visualize the computed performance.
Usage
ClassificationOutput$plotPerformances( dir.path, test.set, measures, voting.names = NULL, metric.names = NULL, cutoff.values = NULL )
Arguments
dir.pathA character vector with location where the plot will be saved.
test.setA
Subsetobject used to compute the performance.measuresA character vector with the measures to be used to compute performance value (inherited from
MeasureFunction).voting.namesA character vector with the name of the voting schemes to analyze the performance. If not defined, all the voting schemes used during classification stage will be taken into account.
metric.namesA character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.
cutoff.valuesA character vector defining the minimum probability used to perform a positive classification. If is not defined, all cutoffs used during classification stage will be taken into account.
Method getPredictions()
The function is used to obtain the computed predictions.
Usage
ClassificationOutput$getPredictions( voting.names = NULL, metric.names = NULL, cutoff.values = NULL, type = NULL, target = NULL, filter = FALSE )
Arguments
voting.namesA character vector with the name of the voting schemes to analyze the performance. If not defined, all the voting schemes used during classification stage will be taken into account.
metric.namesA character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.
cutoff.valuesA character vector defining the minimum probability used to perform a a positive classification. If is not defined, all cutoffs used during classification stage will be taken into account.
typeA character to define which type of predictions should be returned. If not defined all type of probabilities will be returned. Conversely if "prob" or "raw" is defined then computed 'probabilistic' or 'class' values are returned.
targetA character defining the value of the positive class.
filterA logical value used to specify if only predictions matching the target value should be returned or not. If TRUE the function returns only the predictions matching the target value. Conversely if FALSE (by default) the function returns all the predictions.
Returns
A PredictionOutput object.
Method savePredictions()
The function saves the predictions into a CSV file.
Usage
ClassificationOutput$savePredictions( dir.path, voting.names = NULL, metric.names = NULL, cutoff.values = NULL, type = NULL, target = NULL, filter = FALSE )
Arguments
dir.pathA character vector with location defining the location of the CSV file.
voting.namesA character vector with the name of the voting schemes to analyze the performance. If not defined, all the voting schemes used during classification stage will be taken into account.
metric.namesA character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.
cutoff.valuesA character vector defining the minimum probability used to perform a positive classification. If is not defined, all cutoffs used during classification stage will be taken into account.
typeA character to define which type of predictions should be returned. If not defined all type of probabilities will be returned. Conversely if "prob" or "raw" is defined then computed 'probabilistic' or 'class' values are returned.
targetA character defining the value of the positive class.
filterA logical value used to specify if only predictions matching the target value should be returned or not. If TRUE the function returns only the predictions matching the target value. Conversely if FALSE (by default) the function returns all the predictions.
Method clone()
The objects of this class are cloneable with this method.
Usage
ClassificationOutput$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.