Learn R Programming

D2MCS (version 1.0.1)

ClassificationOutput: D2MCS Classification Output.

Description

Allows computing the classification performance values achieved by D2MCS. The class is automatically created when D2MCS classification method is invoked.

Arguments

Methods


Method new()

Method for initializing the object arguments during runtime.

Usage

ClassificationOutput$new(voting.schemes, models)

Arguments

voting.schemes

A list containing the voting schemes used (inherited from VotingStrategy.

models

A list containing the used Model during 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

metrics

A 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.set

A Subset object used to compute the performance.

measures

A character vector with the measures to be used to compute performance value (inherited from MeasureFunction).

voting.names

A 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.names

A character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.

cutoff.values

A 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.path

A 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.path

A character vector with location where the plot will be saved.

test.set

A Subset object used to compute the performance.

measures

A character vector with the measures to be used to compute performance value (inherited from MeasureFunction).

voting.names

A 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.names

A character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.

cutoff.values

A 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.path

A character vector with location where the plot will be saved.

test.set

A Subset object used to compute the performance.

measures

A character vector with the measures to be used to compute performance value (inherited from MeasureFunction).

voting.names

A 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.names

A character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.

cutoff.values

A 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.names

A 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.names

A character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.

cutoff.values

A 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.

type

A 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.

target

A character defining the value of the positive class.

filter

A 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.path

A character vector with location defining the location of the CSV file.

voting.names

A 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.names

A character containing the measures used during training stage. If not defined, all training metrics used during classification will be taken into account.

cutoff.values

A 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.

type

A 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.

target

A character defining the value of the positive class.

filter

A 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

deep

Whether to make a deep clone.

See Also

D2MCS