plot.mcfs: Plots various MCFS result components

View source: R/rmcfs.plot.R

plot.mcfsR Documentation

Plots various MCFS result components

Description

Plots various aspects of the MCFS-ID result.

Usage

  ## S3 method for class 'mcfs'
plot(x, type = c("features", "ri", "id", "distances", "cv", "cmatrix", "heatmap"), 
        size = NA, 
        ri_permutations = c("max", "all", "sorted", "none"),
        diff_bars = TRUE,
        features_margin = 10,
        cv_measure = c("wacc", "acc", "pearson", "MAE", "RMSE", "SMAPE"),
        heatmap_norm = c('none', 'norm', 'scale'),
        heatmap_fun = c('median', 'mean'),
        color = c('darkred'),
        gg = TRUE,
        cex = 1, ...)

Arguments

x

'mcfs' S3 object - result of the MCFS-ID experiment returned by mcfs function.

type
  • features plots top features set along with their RI. It is a horizontal barplot that shows important features in red color and unimportant in grey.

  • ri plots top features set with their RIs as well as max RI obtained from permutation experiments. Red color denotes important features.

  • id plots top ID values obtained from the MCFS-ID.

  • distances plots distances (convergence diagnostics of the algorithm) between subsequent feature rankings obtained during the MCFS-ID experiment.

  • cv plots cross validation results based on top features.

  • cmatrix plots the confusion matrix obtained on all s \cdot t trees.

  • heatmap plots heatmap results based on top features. Only numeric features can be presented on the heatmap.

size

number of features to plot.

ri_permutations

if type = "ri" and ri_permutations = "max", then it additionally shows horizontal lines that correspond to max RI values obtained from each single permutation experiment.

diff_bars

if type = "ri" or type = "id" and diff_bars = T, then it shows difference values for RI or ID values.

features_margin

if type = "features", then it determines the size of the left margin of the plot.

cv_measure

if type = "cv", then it determines the type of accuracy shown in the plot: weighted or unweighted accuracy ("wacc" or "acc"). If target attribute is numeric it is possible to review one of the following prediction quality measures: ("pearson", "MAE", "RMSE", "SMAPE")

heatmap_norm

if type = "heatmap", then it defines type of input data normalization 'none' - without any normalization, 'norm' - normalization within range [-1,1], 'scale' - standardization/centering by mean and stdev.

heatmap_fun

if type = "heatmap", then it determines calculation 'mean' or 'median' within the class to be shown as heatmap color intensity.

color

it defines main color of the following type of plots: 'ri', 'id', 'heatmap', 'features' and 'cmatrix'.

gg

if gg = TRUE use ggplot2.

cex

size of fonts.

...

additional plotting parameters.

Examples

  ## Not run: ###dontrunbegin

  # Create input data.
  adata <- artificial.data(rnd_features = 10)
  showme(adata)
  
  # Parametrize and run MCFS-ID procedure.
  result <- mcfs(class~., adata, cutoffPermutations = 0, featureFreq = 10,
                  finalCV = FALSE, finalRuleset = TRUE, threadsNumber = 2)

  # Plot & print out distances between subsequent projections. 
  # These are convergence MCFS-ID statistics.
  plot(result, type = "distances")
  print(result$distances)
  
  # Plot & print out 50 most important features and show max RI values from 
  # permutation experiment.
  plot(result, type = "ri", size = 50)
  print(head(result$RI, 50))
  
  # Plot & print out 50 strongest feature interdependencies.
  plot(result, type = "id", size = 50)
  print(head(result$ID, 50))
  
  # Plot features ordered by RI. Parameter 'size' is the number of 
  # top features in the chart. By default it is set on cutoff_value + 10
  plot(result, type = "features", cex = 1)

  # Here we set 'size' at fixed value 10.
  plot(result, type = "features", size = 10)
  
  # Plot cv classification result obtained on top features.
  # In the middle of x axis red label denotes cutoff_value.
  # plot(result, type = "cv", measure = "wacc", cex = 0.8)
  
  # Plot & print out confusion matrix. This matrix is the result of 
  # all classifications performed by all decision trees on all s*t datasets.
  plot(result, type = "cmatrix")
  
  
## End(Not run)###dontrunend

rmcfs documentation built on Sept. 11, 2024, 8:41 p.m.

Related to plot.mcfs in rmcfs...