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 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 (%)",
...
)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).
object of class as_data.
How to deal with ties. Must be one of:
"different_data_points": Tied algorithms in the optimal selection are all counted as different data points (increasing the total number of x values and therefore giving all of the tied algorithms the same weight).
"ml_if_optimal": For tied algorithms, the one selected by ML is chosen if it corresponds to the optimal one. Otherwise, the same as in option different_data_points is done.
"ml_selection": For tied algorithms, the one preferred by the ML is chosen.
an overall title for the plot.
character vector with the labels for each of the algorithms. If NULL, the y names of the data_object names will be used.
character vector with the labels for the Optimal and ML bars. If NULL, default names will be used.
flag that indicates whether the function should use test data or training data.
a data frame with the predicted KPI for each algorithm (columns) and for each instance (rows).
boolean indicating whether the function should represent data by families or not. The family information must be included in the data_object parameter.
boolean to choose between bar plot and stacked bar plot.
list with the colors for the plots. If NULL, or insufficient number of colors, the colors will be generated automatically.
boolean to activate or deactivate the legend in the plot.
vector with the name of the columns of data_object y variable in the correct order.
a label for the x axis.
a label for the y axis.
other parameters.
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)
Run the code above in your browser using DataLab