Critical Distance Graph Generation

class SAES.plots.CDplot.CDplot(data: DataFrame, metrics: DataFrame, metric: str)

Bases: object

Class to generate a critical difference plot to compare the performance of different algorithms on multiple instances.

Attributes:
table (pd.DataFrame):

A pandas DataFrame containing the performance results of different algorithms across multiple instances.

metric (str):

The metric to be used for comparison.

logger (Logger):

A logger object to record and display log messages.

Methods:
__init__(data: pd.DataFrame, metrics: pd.DataFrame, metric: str):

Initializes the CDplot object with the given data, metrics, and metric.

save(output_path: str):

Generates a critical difference plot and saves it to the specified output path.

show():

Generates a critical difference plot and displays it.

save(output_path: str, file_name: str = None, width: int = 9) None

Generates a critical difference plot and saves it to the specified output path.

Args:
output_path (str):

The path where the CDplot image will be saved.

file_name (str):

The name of the file to be saved. If not provided, the file will be saved as “cdplot_{metric}.png”.

width (int):

The width of the CDplot image.

Returns:

None

Example:
>>> frtom SAES.plots.CDplot import CDplot
>>> import os
>>> 
>>> data = pd.read_csv("data.csv")
>>> metrics = pd.read_csv("metrics.csv")
>>> metric = "HV"
>>> cd_plot = CDplot(data, metrics, metric)
>>> cd_plot.save(os.getcwd())
show(width: int = 9) None

Generates a critical difference plot and displays it.

Args:
width (int):

The width of the CDplot image.

Returns:

None

Example:
>>> frtom SAES.plots.CDplot import CDplot
>>> import os
>>> 
>>> data = pd.read_csv("data.csv")
>>> metrics = pd.read_csv("metrics.csv")
>>> metric = "HV"
>>> cd_plot = CDplot(data, metrics, metric)
>>> cd_plot.show()