LaTeX Report Generation

class SAES.latex_generation.stats_table.Anova(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = True)

Bases: Table

Class for generating the Anova table.

compute_table() None

Computes the Anova table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.Friedman(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = False, friedman_test: str = 'base')

Bases: Table

Class for generating the Friedman table.

compute_table() None

Computes the Friedman table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.FriedmanPValues(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = False)

Bases: Table

Class for generating the Friedman table.

compute_table() None

Computes the Friedman table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.MeanMedian(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = False)

Bases: Table

Class for generating the Mean and Standard Deviation or Median and Interquartile Range table.

compute_table() None

Computes the Mean and Standard Deviation or Median and Interquartile Range table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.TTest(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = True)

Bases: Table

Class for generating the T-Test table.

compute_table() None

Computes the T-Test table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.TTestPivot(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = True, pivot: str = None)

Bases: Table

Class for generating the T-Test Pivot table.

compute_table() None

Computes the T-Test Pivot table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.Table(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = False)

Bases: ABC

Abstract class for generating statistical tables.

Attributes:
data (pd.DataFrame):

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

maximize (bool):

A boolean value indicating whether the metric should be maximized or minimized.

metric (str):

The metric to be used for comparison.

normality (bool):

A boolean value indicating whether the data is normally distributed.

normal (bool):

A boolean value indicating whether the data should be treated as normally distributed.

algorithms (np.ndarray):

An array containing the names of the algorithms.

instances (np.ndarray):

An array containing the names of the instances.

mean_median (pd.DataFrame):

A DataFrame containing the mean or median values for each algorithm and instance.

std_iqr (pd.DataFrame):

A DataFrame containing the standard deviation or interquartile range values for each algorithm and instance.

table (pd.DataFrame):

A DataFrame containing the formatted table data.

latex_doc (str):

A string containing the LaTeX document structure for the table.

logger (Logger):

A logger object to record and display log messages.

Methods:
__init__(data: str | pd.DataFrame, metrics: str | pd.DataFrame, metric: str, normal: bool = False):

Initializes the Table object with the given data, metrics, metric, and normality.

compute_base_table():

Computes the base table with mean/median and standard deviation/interquartile range values.

save(output_path: str, sideways: bool = False):

Saves the table to a LaTeX file.

create_latex_table(sideways: bool = False):

Computes the LaTeX code for the table in string format.

show():

Displays the table in a Jupyter notebook.

compute_table():

Computes the specifies table guided by the implementation of the subclass.

compute_base_table() None

Computes the base table with mean/median and standard deviation/interquartile range values.

Example:
>>> from SAES.latex_generation.stats_table import MeanMedian
>>>
>>> data = pd.read_csv("data.csv")
>>> metrics = pd.read_csv("metrics.csv")
>>> metric = "HV"
>>> table = MeanMedian(data, metrics, metric)
>>> table.compute_base_table()
abstract compute_table() None

Computes the specifies table guided by the implementation of the subclass.

Example:
>>> from SAES.latex_generation.stats_table import MeanMedian
>>> 
>>> data = pd.read_csv("data.csv")
>>> metrics = pd.read_csv("metrics.csv")
>>> metric = "HV"
>>> table = MeanMedian(data, metrics, metric)
>>> table.compute_table()
create_latex_table(sideways: bool = False) None

Computes the LaTeX code for the table in string format.

Args:
sideways (bool):

A boolean value indicating whether the table should be displayed in landscape mode. Default is False.

Returns:

None

Example:
>>> from SAES.latex_generation.stats_table import MeanMedian
>>>
>>> data = pd.read_csv("data.csv")
>>> metrics = pd.read_csv("metrics.csv")
>>> metric = "HV"
>>> table = MeanMedian(data, metrics, metric)
>>> table.create_latex_table()
rank_top_two(instance: str) tuple

Returns the first and second best algorithms based on the data.

save(output_path: str, file_name: str = None, sideways: bool = False) None

Saves the table to a LaTeX file.

Args:
output_path (str):

The path to the directory where the LaTeX file will be saved.

file_name (str):

The name of the LaTeX file. Default is None.

sideways (bool):

A boolean value indicating whether the table should be displayed in landscape mode. Default is False.

Returns:

None

Example:
>>> from SAES.latex_generation.stats_table import MeanMedian
>>> import os
>>>
>>> data = pd.read_csv("data.csv")
>>> metrics = pd.read_csv("metrics.csv")
>>> metric = "HV"
>>> table = MeanMedian(data, metrics, metric)
>>> table.save(os.getcwd(), sideways=True)
abstract show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.Wilcoxon(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = False)

Bases: Table

Class for generating the Wilcoxon table.

compute_table() None

Computes the Wilcoxon table.

show() None

Displays the table in a Jupyter notebook.

class SAES.latex_generation.stats_table.WilcoxonPivot(data: str | DataFrame, metrics: str | DataFrame, metric: str, normal: bool = False, pivot: str = None)

Bases: Table

Class for generating the Wilcoxon Pivot table.

compute_table() None

Computes the Wilcoxon Pivot table.

show() None

Displays the table in a Jupyter notebook.