Learn R Programming

ASML (version 1.1.0)

plot.as_data: Plot

Description

For an object of class as_data, function that makes several plots, including the following: a boxplot, a ranking plot and comparisons between the different options.

Usage

# S3 method for as_data
plot(
  x,
  labels = NULL,
  test = TRUE,
  predictions = NULL,
  by_families = FALSE,
  stacked = TRUE,
  legend = TRUE,
  color_list = NULL,
  ml_color = NULL,
  path = NULL,
  ...
)

Value

A list with boxplot, ranking, fig_comp, optml_fig_comp and optmlall_fig_comp plots.

Arguments

x

object of class as_data.

labels

character vector with the labels for each of the algorithms. If NULL, the y names of the data_object names will be used.

test

flag that indicates whether the function should use test data or training data.

predictions

a data frame with the predicted KPI for each algorithm (columns) and for each instance (rows). If NULL, the plot won't include a ML column.

by_families

boolean indicating whether the function should represent data by families or not. The family information must be included in the data_object parameter.

stacked

boolean to choose between bar plot and stacked bar plot.

legend

boolean to activate or deactivate the legend in the plot.

color_list

list with the colors for the plots. If NULL, or insufficient number of colors, the colors will be generated automatically.

ml_color

color for the ML boxplot. If NULL, it will be generated automatically.

path

path where plots will be saved. If NULL they won't be saved.

...

other parameters.

Examples

Run this code
# \donttest{
data(branchingsmall)
data <- partition_and_normalize(branchingsmall$x, branchingsmall$y)
training <- AStrain(data, method = "glm")
predict_test <- ASpredict(training, newdata = data$x.test)
plot(data, predictions = predict_test)
# }

Run the code above in your browser using DataLab