figure_comparison.as_data | R Documentation |
Represents a bar plot with the percentage of times each algorithm is selected by ML compared with the optimal selection (according to the response variable or KPI).
## S3 method for class 'as_data'
figure_comparison(
data_object,
ties = "different_data_points",
main = "Option Comparison",
labels = NULL,
mllabel = NULL,
test = TRUE,
predictions,
by_families = FALSE,
stacked = TRUE,
color_list = NULL,
legend = TRUE,
ordered_option_names = NULL,
xlab = "Criteria",
ylab = "Instances (%)",
...
)
data_object |
object of class |
ties |
How to deal with ties. Must be one of:
|
main |
an overall title for the plot. |
labels |
character vector with the labels for each of the algorithms. If NULL, the y names of the |
mllabel |
character vector with the labels for the Optimal and ML bars. If NULL, default 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). |
by_families |
boolean indicating whether the function should represent data by families or not. The family information must be included in the |
stacked |
boolean to choose between bar plot and stacked bar plot. |
color_list |
list with the colors for the plots. If NULL, or insufficient number of colors, the colors will be generated automatically. |
legend |
boolean to activate or deactivate the legend in the plot. |
ordered_option_names |
vector with the name of the columns of data_object y variable in the correct order. |
xlab |
a label for the x axis. |
ylab |
a label for the y axis. |
... |
other parameters. |
A ggplot
object representing the bar plot with the percentage of times each algorithm is selected by ML compared with the optimal selection (according to the response variable or KPI).
data(branchingsmall)
data <- partition_and_normalize(branchingsmall$x, branchingsmall$y)
training <- AStrain(data, method = "glm")
predict_test <- ASpredict(training, newdata = data$x.test)
figure_comparison(data, predictions = predict_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.