Skip to content

Python API Reference

Every capability in the SAES ecosystem is exposed first as a strongly typed Python API under import saes and saes.statistics.

1. Top-Level Workflow API (import saes)

Function Signature / Purpose Return Type
saes.load load(source) — Load CSV filepath or buffer Dataset
saes.validate validate(dataset) — Strict schema & type validation ValidationReport
saes.explore explore(dataset, metrics=None, algorithms=None, instances=None, alpha=0.05) DataExplorationResult
saes.export_exploration export_exploration(exploration, view_mode="reveal_metrics", export_format="csv", ...) bytes
saes.analyze analyze(dataset, alpha=0.05, generate_plots=True, paired=False) AnalysisReport
saes.generate_table generate_table(dataset, metric=None, table_type="instance_algorithm", ..., paired=False) StatisticalTableResult
saes.export_table export_table(table_result, export_format="latex", ...) bytes
saes.plot plot(dataset, plot_type="boxplot", metric=None, instance=None, interactive=False, **kwargs) Figure
saes.export_plot export_plot(dataset, plot_type="boxplot", ..., export_format="png", dpi=300) tuple[bytes, str, str]
saes.profiles profiles(dataset, metric=None, alpha=0.05, max_tau=None, num_tau_points=60, paired=False, posthoc_correction="holm") PerformanceProfilesResult
saes.power power(dataset, metric=None, alpha=0.05, target_power=0.80, target_effect_size=0.50, paired=False) PowerAnalysisResult
saes.tost tost(x1, x2, low_eqbound, high_eqbound=None, alpha=0.05, paired=False, equal_var=False, ...) TOSTResult
saes.compute_minimum_detectable_effect compute_minimum_detectable_effect(n, target_power=0.80, alpha=0.05, paired=False) float
saes.reproducibility reproducibility(dataset, metric=None, alpha=0.05, filename="dataset.csv", raw_csv=None) ReproducibilityResult

2. Statistical Namespace (saes.statistics.*)

Assumption Diagnostics

  • shapiro(groups, alpha=0.05) -> list[AssumptionResult]
  • lilliefors(groups, alpha=0.05) -> list[AssumptionResult]
  • anderson(groups, alpha=0.05) -> list[AssumptionResult]
  • levene(groups, alpha=0.05) -> AssumptionResult

Two-Sample & Multi-Group Tests (groups: dict[str, np.ndarray])

  • Parametric: ttest_ind, ttest_welch, ttest_rel, anova_oneway, anova_welch
  • Non-parametric: mann_whitney, wilcoxon, brunner_munzel, kruskal

Effect Sizes, Exact Confidence Intervals & Forest Summary

  • cohens_d_ci(d, n1, n2=None, alpha=0.05, paired=False, hedges_correction=False) -> tuple[float, float]
  • eta_squared_ci(f_stat, df_between, df_within, alpha=0.05) -> tuple[float, float]
  • vargha_delaney_a12(x1, x2, maximize=True) -> tuple[float, str]
  • vargha_delaney_a12_ci(x1, x2, maximize=True, alpha=0.05) -> tuple[float, str, tuple[float, float]]
  • cliffs_delta(x1, x2, maximize=True) -> tuple[float, str]
  • cliffs_delta_ci(x1, x2, maximize=True, alpha=0.05) -> tuple[float, str, tuple[float, float]]
  • effect_size_forest(dataset, metric, scope="single-instance", instance=None, reference_algorithm=None, alpha=0.05, paired=False, p_adjust="holm") -> EffectSizeForestResult

Multiple-Testing Adjustments & Post-Hoc Tests

  • adjust_pvalues(p_values, method="holm") -> list[float] (holm, bonferroni, hochberg, hommel, finner, holland, rom, li, fdr_bh, fdr_by, none)
  • adjust_pvalues_shaffer(p_matrix: np.ndarray) -> np.ndarray
  • adjust_pvalues_bergmann_hommel(p_matrix: np.ndarray, max_exact_k: int = 9) -> tuple[np.ndarray, list[str]]
  • tukey_hsd(groups, alpha=0.05) -> PostHocResult
  • games_howell(groups, alpha=0.05) -> PostHocResult
  • dunnett(groups, control, alpha=0.05) -> PostHocResult
  • dunn(groups, alpha=0.05, p_adjust="holm") -> PostHocResult
  • conover_iman(groups, alpha=0.05, p_adjust="holm") -> PostHocResult

Blocked Multi-Instance Omnibus Tests

  • friedman_nemenyi(dataset, metric, alpha=0.05, scope="all-instances", instance=None) -> CriticalDistanceResult
  • friedman_aligned_ranks(dataset, metric, alpha=0.05, scope="all-instances", instance=None) -> BlockedOmnibusResult
  • quade(dataset, metric, alpha=0.05, scope="all-instances", instance=None) -> BlockedOmnibusResult
  • rm_anova(dataset, metric, alpha=0.05, scope="all-instances", instance=None, greenhouse_geisser=True) -> BlockedOmnibusResult

Bayesian Comparisons & Ranking

  • bayesian_ranking(dataset, metric, scope="all-instances", instance=None, rope_percent=1.0, rope=None, prior_strength=1.0, num_samples=1500, algo_a=None, algo_b=None, method="signed-rank") -> BayesianRankResult
  • bayesian_sign(...) -> BayesianRankResult
  • bayesian_signed_rank(...) -> BayesianRankResult
  • bayesian_correlated_ttest(x_a, x_b, algo_a="Algorithm A", algo_b="Algorithm B", rope=0.01, rho=None, maximize=True) -> BayesianCorrelatedTResult
  • bayesian_plackett_luce(dataset, metric, scope="all-instances", instance=None, num_samples=400, prior_alpha=1.0, seed=42) -> BayesianPlackettLuceResult

Power, Sensitivity (MDES) & Equivalence (TOST)

  • minimum_detectable_effect(n, target_power=0.80, alpha=0.05, paired=False) -> float
  • tost(x1, x2, low_eqbound, high_eqbound=None, alpha=0.05, paired=False, equal_var=False, ...) -> TOSTResult

Extensibility & Python Plugins (saes.plugins / saes.PluginRegistry)

  • saes.plugins.discover(force=False) -> list[PluginManifest] — Discover installed entry_points (saes.tests, saes.renderers, saes.plotters, saes.plugins).
  • saes.plugins.list_installed() -> list[PluginManifest] — List active SAES domain plugins.
  • saes.plugins.get(plugin_id) -> SAESPlugin / saes.plugins.get_namespace(plugin_id) -> Any — Access a plugin instance or its Python API namespace.
  • saes.plugins.register(plugin) / saes.plugins.unregister(plugin_id) — Programmatic runtime registration.

3. Auto-Generated Module Documentation

Top-Level API (saes.api)

Public API surface for SAES library.

load

load(source: Any) -> Dataset

Load a CSV dataset into a SAES Dataset object.

Parameters:

Name Type Description Default
source Any

Filepath or file-like buffer.

required

Returns:

Type Description
Dataset

Dataset entity.

Source code in src/saes/api.py
def load(source: Any) -> Dataset:
    """Load a CSV dataset into a SAES Dataset object.

    Args:
        source: Filepath or file-like buffer.

    Returns:
        Dataset entity.
    """
    pipeline = AnalysisPipeline()
    return pipeline.load_csv(source)

validate

validate(dataset: Dataset) -> ValidationReport

Validate dataset structure, schema, and types.

Parameters:

Name Type Description Default
dataset Dataset

Dataset instance.

required

Returns:

Type Description
ValidationReport

ValidationReport object.

Source code in src/saes/api.py
def validate(dataset: Dataset) -> ValidationReport:
    """Validate dataset structure, schema, and types.

    Args:
        dataset: Dataset instance.

    Returns:
        ValidationReport object.
    """
    pipeline = AnalysisPipeline()
    return pipeline.validate(dataset)

explore

explore(dataset: Dataset, metrics: list[str] | None = None, algorithms: list[str] | None = None, instances: list[str] | None = None, alpha: float = 0.05) -> DataExplorationResult

Explore dataset observations, reveal multi-metric tables, check normality, and get test recommendations.

Source code in src/saes/api.py
def explore(
    dataset: Dataset,
    metrics: list[str] | None = None,
    algorithms: list[str] | None = None,
    instances: list[str] | None = None,
    alpha: float = 0.05,
) -> DataExplorationResult:
    """Explore dataset observations, reveal multi-metric tables, check normality, and get test recommendations."""
    return DataExplorerEngine().explore(
        dataset=dataset,
        metrics=metrics,
        algorithms=algorithms,
        instances=instances,
        alpha=alpha,
    )

analyze

analyze(dataset: Dataset, alpha: float = 0.05, generate_plots: bool = True, paired: bool = False) -> AnalysisReport

Run comprehensive automated statistical analysis across dataset.

Parameters:

Name Type Description Default
dataset Dataset

Validated Dataset instance.

required
alpha float

Significance level (default 0.05).

0.05
generate_plots bool

Whether to generate distribution boxplots (default True).

True
paired bool

Whether per-instance observations are explicitly statistically paired (e.g., identical CV folds or Common Random Numbers). Defaults to False.

False

Returns:

Name Type Description
AnalysisReport AnalysisReport

Comprehensive report of all statistical tests and plots.

Source code in src/saes/api.py
def analyze(
    dataset: Dataset,
    alpha: float = 0.05,
    generate_plots: bool = True,
    paired: bool = False,
) -> AnalysisReport:
    """Run comprehensive automated statistical analysis across dataset.

    Args:
        dataset: Validated Dataset instance.
        alpha: Significance level (default 0.05).
        generate_plots: Whether to generate distribution boxplots (default True).
        paired: Whether per-instance observations are explicitly statistically paired
            (e.g., identical CV folds or Common Random Numbers). Defaults to False.

    Returns:
        AnalysisReport: Comprehensive report of all statistical tests and plots.
    """
    pipeline = AnalysisPipeline(alpha=alpha, paired=paired)
    return pipeline.analyze(dataset, generate_plots=generate_plots, paired=paired)

generate_table

generate_table(dataset: Dataset, metric: str | None = None, table_type: str = 'instance_algorithm', test_type: str = 'auto', posthoc_correction: str = 'holm', summary_stat: str = 'auto', reference_algorithm: str | None = None, scope: str = 'all-instances', selected_instance: str | None = None, algorithms_filter: list[str] | None = None, instances_filter: list[str] | None = None, alpha: float = 0.05, precision: int = 4, latex_document_mode: str = 'standalone', latex_notation: str = 'scientific', paired: bool = False) -> StatisticalTableResult

Generate a publication-grade ANOVA, Friedman, Wilcoxon, or Pairwise statistical benchmark table.

Source code in src/saes/api.py
def generate_table(
    dataset: Dataset,
    metric: str | None = None,
    table_type: str = "instance_algorithm",
    test_type: str = "auto",
    posthoc_correction: str = "holm",
    summary_stat: str = "auto",
    reference_algorithm: str | None = None,
    scope: str = "all-instances",
    selected_instance: str | None = None,
    algorithms_filter: list[str] | None = None,
    instances_filter: list[str] | None = None,
    alpha: float = 0.05,
    precision: int = 4,
    latex_document_mode: str = "standalone",
    latex_notation: str = "scientific",
    paired: bool = False,
) -> StatisticalTableResult:
    """Generate a publication-grade ANOVA, Friedman, Wilcoxon, or Pairwise statistical benchmark table."""
    return StatisticalTableGenerator().generate(
        dataset=dataset,
        metric=metric,
        table_type=table_type,
        test_type=test_type,
        posthoc_correction=posthoc_correction,
        summary_stat=summary_stat,
        reference_algorithm=reference_algorithm,
        scope=scope,
        selected_instance=selected_instance,
        algorithms_filter=algorithms_filter,
        instances_filter=instances_filter,
        alpha=alpha,
        precision=precision,
        latex_document_mode=latex_document_mode,
        latex_notation=latex_notation,
        paired=paired,
    )

export_table

export_table(table_result: StatisticalTableResult, export_format: str = 'latex', document_mode: str | None = None, notation: str | None = None, title: str | None = None, caption: str | None = None, pdf_theme: str = 'slate', pdf_orientation: str = 'landscape', pdf_font_size: float = 8.5, pdf_highlight_best: bool = True, pdf_show_zebra: bool = True, pdf_grid_style: str = 'full') -> bytes

Export a generated StatisticalTableResult to LaTeX, CSV, Markdown, HTML, DOCX, or PDF bytes.

Source code in src/saes/api.py
def export_table(
    table_result: StatisticalTableResult,
    export_format: str = "latex",
    document_mode: str | None = None,
    notation: str | None = None,
    title: str | None = None,
    caption: str | None = None,
    pdf_theme: str = "slate",
    pdf_orientation: str = "landscape",
    pdf_font_size: float = 8.5,
    pdf_highlight_best: bool = True,
    pdf_show_zebra: bool = True,
    pdf_grid_style: str = "full",
) -> bytes:
    """Export a generated StatisticalTableResult to LaTeX, CSV, Markdown, HTML, DOCX, or PDF bytes."""
    file_bytes, _, _ = export_statistical_table(
        table_result,
        export_format=export_format,
        document_mode=document_mode,
        notation=notation,
        title=title,
        caption=caption,
        pdf_theme=pdf_theme,
        pdf_orientation=pdf_orientation,
        pdf_font_size=pdf_font_size,
        pdf_highlight_best=pdf_highlight_best,
        pdf_show_zebra=pdf_show_zebra,
        pdf_grid_style=pdf_grid_style,
    )
    return file_bytes

plot

plot(dataset: Dataset, plot_type: str = 'boxplot', metric: str | None = None, instance: str | None = None, interactive: bool = False, **kwargs: Any) -> Any

Generate a publication-grade figure directly from a SAES Dataset.

Supported plot_type values
  • 'boxplot': Quartile box plot with centered observations
  • 'violin': Kernel density + internal box plot
  • 'critical-distance': Demšar (2006) Friedman + Nemenyi CD diagram
  • 'bayesian-rank': Dirichlet Process posterior rank distribution & ROPE
  • 'barplot', 'ecdf', 'lineplot', 'scatter'

Parameters:

Name Type Description Default
dataset Dataset

SAES Dataset object.

required
plot_type str

Key registered in PlotterRegistry.

'boxplot'
metric str | None

Metric identifier (defaults to first metric in dataset).

None
instance str | None

Problem instance identifier (defaults to first instance for cell plots).

None
interactive bool

If True, returns a Plotly Figure; otherwise returns a Matplotlib Figure.

False
**kwargs Any

Additional styling parameters (paper_format='golden'|'single-col'|..., palette, alpha, etc.).

{}

Returns:

Type Description
Any

matplotlib.figure.Figure or plotly.graph_objects.Figure.

Source code in src/saes/api.py
def plot(
    dataset: Dataset,
    plot_type: str = "boxplot",
    metric: str | None = None,
    instance: str | None = None,
    interactive: bool = False,
    **kwargs: Any,
) -> Any:
    """Generate a publication-grade figure directly from a SAES Dataset.

    Supported plot_type values:
        - 'boxplot': Quartile box plot with centered observations
        - 'violin': Kernel density + internal box plot
        - 'critical-distance': Demšar (2006) Friedman + Nemenyi CD diagram
        - 'bayesian-rank': Dirichlet Process posterior rank distribution & ROPE
        - 'barplot', 'ecdf', 'lineplot', 'scatter'

    Args:
        dataset: SAES Dataset object.
        plot_type: Key registered in PlotterRegistry.
        metric: Metric identifier (defaults to first metric in dataset).
        instance: Problem instance identifier (defaults to first instance for cell plots).
        interactive: If True, returns a Plotly Figure; otherwise returns a Matplotlib Figure.
        **kwargs: Additional styling parameters (paper_format='golden'|'single-col'|..., palette, alpha, etc.).

    Returns:
        matplotlib.figure.Figure or plotly.graph_objects.Figure.
    """
    from saes.visualization.registry import PlotterRegistry

    target_metric = metric or (dataset.metrics[0] if dataset.metrics else "value")
    resolved_plot_type = plot_type.lower()
    if resolved_plot_type in {"bayesian-sign", "bayesian-signed-rank"}:
        kwargs = {
            **kwargs,
            "method": "sign" if resolved_plot_type == "bayesian-sign" else "signed-rank",
        }
        plotter = PlotterRegistry.get("bayesian-rank")
    else:
        plotter = PlotterRegistry.get(plot_type)

    is_ranking = resolved_plot_type in {
        "critical-distance",
        "bayesian-rank",
        "bayesian-sign",
        "bayesian-signed-rank",
        "plackett-luce",
        "effect-size-forest",
    }
    default_scope = "single-instance" if resolved_plot_type == "effect-size-forest" else "all-instances"
    scope = str(kwargs.get("scope", default_scope))

    if is_ranking and scope == "all-instances":
        df_sub = dataset.df[dataset.df["metric"] == target_metric].copy()
        target_inst = instance or ""
    else:
        target_inst = instance or (dataset.instances[0] if dataset.instances else "")
        df_sub = dataset.get_cell(target_inst, target_metric) if target_inst else dataset.df.copy()

    plot_kwargs = {
        "metric": target_metric,
        "instance": target_inst,
        **kwargs,
    }
    if interactive:
        return plotter.plot_interactive(df_sub, **plot_kwargs)
    return plotter.plot(df_sub, **plot_kwargs)

export_plot

export_plot(dataset: Dataset, plot_type: str = 'boxplot', metric: str | None = None, instance: str | None = None, export_format: str = 'png', dpi: int = 300, **kwargs: Any) -> tuple[bytes, str, str]

Generate and export a publication-grade plot as PNG, SVG, or PDF bytes.

Parameters:

Name Type Description Default
dataset Dataset

SAES Dataset object.

required
plot_type str

Key registered in PlotterRegistry.

'boxplot'
metric str | None

Metric identifier (defaults to first metric in dataset).

None
instance str | None

Problem instance identifier (defaults to first instance for cell plots).

None
export_format str

Target format ('png', 'svg', or 'pdf').

'png'
dpi int

Resolution in dots per inch for raster formats (default 300).

300
**kwargs Any

Additional plotting parameters passed to plot().

{}

Returns:

Type Description
tuple[bytes, str, str]

Tuple of (file_bytes, media_type, extension).

Source code in src/saes/api.py
def export_plot(
    dataset: Dataset,
    plot_type: str = "boxplot",
    metric: str | None = None,
    instance: str | None = None,
    export_format: str = "png",
    dpi: int = 300,
    **kwargs: Any,
) -> tuple[bytes, str, str]:
    """Generate and export a publication-grade plot as PNG, SVG, or PDF bytes.

    Args:
        dataset: SAES Dataset object.
        plot_type: Key registered in PlotterRegistry.
        metric: Metric identifier (defaults to first metric in dataset).
        instance: Problem instance identifier (defaults to first instance for cell plots).
        export_format: Target format ('png', 'svg', or 'pdf').
        dpi: Resolution in dots per inch for raster formats (default 300).
        **kwargs: Additional plotting parameters passed to `plot()`.

    Returns:
        Tuple of (file_bytes, media_type, extension).
    """
    import io

    import matplotlib.pyplot as plt

    fmt = export_format.strip().lower()
    format_map: dict[str, tuple[str, str]] = {
        "png": ("image/png", "png"),
        "svg": ("image/svg+xml", "svg"),
        "pdf": ("application/pdf", "pdf"),
    }
    if fmt not in format_map:
        raise ValueError(f"Unsupported plot export format '{export_format}'. Supported: png, svg, pdf.")

    fig = plot(
        dataset,
        plot_type=plot_type,
        metric=metric,
        instance=instance,
        interactive=False,
        **kwargs,
    )
    buf = io.BytesIO()
    try:
        fig.savefig(buf, format=fmt, dpi=dpi, bbox_inches="tight")
    finally:
        plt.close(fig)

    media_type, ext = format_map[fmt]
    return buf.getvalue(), media_type, ext

compute_performance_profiles

compute_performance_profiles(dataset: Dataset, metric: str | None = None, alpha: float = 0.05, max_tau: float | None = None, num_tau_points: int = 60, paired: bool = False, posthoc_correction: str = 'holm') -> PerformanceProfilesResult

Compute Dolan-Moré performance profiles and multiplicity-adjusted Win/Tie/Loss meta-ranking.

Reference

Dolan, E. D., & Moré, J. J. (2002). Benchmarking optimization software with performance profiles. Mathematical Programming, 91(2), 201-213.

Parameters:

Name Type Description Default
dataset Dataset

Validated SAES Dataset.

required
metric str | None

Evaluation metric identifier (defaults to first metric).

None
alpha float

Statistical significance threshold for Win/Tie/Loss comparisons.

0.05
max_tau float | None

Optional upper bound for performance ratio tau.

None
num_tau_points int

Number of evaluation points along the tau axis.

60
paired bool

Whether per-instance runs are explicitly paired across algorithms (default False -> Mann-Whitney U; True -> Wilcoxon Signed-Rank when equal lengths).

False
posthoc_correction str

Multiple-testing p-value adjustment applied to the Win/Tie/Loss comparisons within each instance (default 'holm').

'holm'

Returns:

Type Description
PerformanceProfilesResult

PerformanceProfilesResult with curves, W/T/L matrix, and meta-rankings.

Source code in src/saes/stats/profiles.py
def compute_performance_profiles(
    dataset: Dataset,
    metric: str | None = None,
    alpha: float = 0.05,
    max_tau: float | None = None,
    num_tau_points: int = 60,
    paired: bool = False,
    posthoc_correction: str = "holm",
) -> PerformanceProfilesResult:
    """Compute Dolan-Moré performance profiles and multiplicity-adjusted Win/Tie/Loss meta-ranking.

    Reference:
        Dolan, E. D., & Moré, J. J. (2002). Benchmarking optimization software
        with performance profiles. Mathematical Programming, 91(2), 201-213.

    Args:
        dataset: Validated SAES Dataset.
        metric: Evaluation metric identifier (defaults to first metric).
        alpha: Statistical significance threshold for Win/Tie/Loss comparisons.
        max_tau: Optional upper bound for performance ratio tau.
        num_tau_points: Number of evaluation points along the tau axis.
        paired: Whether per-instance runs are explicitly paired across algorithms (default False ->
            Mann-Whitney U; True -> Wilcoxon Signed-Rank when equal lengths).
        posthoc_correction: Multiple-testing p-value adjustment applied to the Win/Tie/Loss
            comparisons within each instance (default 'holm').

    Returns:
        PerformanceProfilesResult with curves, W/T/L matrix, and meta-rankings.
    """
    if not dataset.metrics:
        raise StatisticalAnalysisError("Dataset contains no evaluation metrics.")

    target_metric = metric if metric in dataset.metrics else dataset.metrics[0]
    metric_df = dataset.df[dataset.df["metric"] == target_metric].copy()

    if metric_df.empty:
        raise StatisticalAnalysisError(f"No records found for metric '{target_metric}'.")

    maximize: bool = bool(metric_df["maximize"].iloc[0])
    algorithms = sorted(metric_df["algorithm"].unique().tolist())
    instances = sorted(metric_df["instance"].unique().tolist())

    if len(algorithms) < 1 or len(instances) < 1:
        raise StatisticalAnalysisError("Need at least 1 algorithm and 1 instance for performance profiling.")

    # 1. Representative performance per (instance, algorithm) cell (median across runs)
    perf_matrix: dict[str, dict[str, float]] = {}
    for inst in instances:
        perf_matrix[inst] = {}
        for algo in algorithms:
            sub = metric_df[(metric_df["instance"] == inst) & (metric_df["algorithm"] == algo)]
            perf_matrix[inst][algo] = float(sub["value"].median()) if not sub.empty else float("nan")

    # 2. Dolan-Moré (2002) performance ratios r_{p, s}
    ratio_matrix: dict[str, dict[str, float]] = {inst: {} for inst in instances}
    all_finite_ratios: list[float] = []

    for inst in instances:
        row_vals = [perf_matrix[inst][a] for a in algorithms if not math.isnan(perf_matrix[inst][a])]
        if not row_vals:
            continue

        min_val = min(row_vals)
        max_val = max(row_vals)
        shift = (abs(min_val) + 1.0) if min_val <= 0.0 else 0.0

        for algo in algorithms:
            val = perf_matrix[inst][algo]
            if math.isnan(val):
                ratio = float("inf")
            else:
                shifted_val = val + shift
                if maximize:
                    best_shifted = max_val + shift
                    ratio = best_shifted / max(1e-12, shifted_val)
                else:
                    best_shifted = min_val + shift
                    ratio = shifted_val / max(1e-12, best_shifted)

            if abs(ratio - 1.0) < 1e-9:
                ratio = 1.0

            ratio_matrix[inst][algo] = ratio
            if math.isfinite(ratio):
                all_finite_ratios.append(ratio)

    if not all_finite_ratios:
        all_finite_ratios = [1.0]

    computed_max_tau = max(all_finite_ratios)
    upper_tau = max_tau if max_tau is not None else min(10.0, max(2.0, computed_max_tau))
    if upper_tau <= 1.0:
        upper_tau = 2.0

    tau_grid = np.unique(
        np.concatenate(
            [
                np.array([1.0]),
                np.linspace(1.0, upper_tau, num_tau_points),
                np.array(sorted(all_finite_ratios)),
            ]
        )
    )
    tau_grid = tau_grid[(tau_grid >= 1.0) & (tau_grid <= upper_tau)]
    tau_values = [round(float(t), 4) for t in sorted(set(tau_grid.tolist()))]

    # 3. Profile curves rho_s(tau) = fraction of problems where r_{p,s} <= tau
    total_instances = len(instances)
    curves: list[AlgorithmProfileCurve] = []

    for algo in algorithms:
        algo_ratios = [ratio_matrix[inst].get(algo, float("inf")) for inst in instances]
        rho_vals: list[float] = []
        for t in tau_values:
            solved = sum(1 for r in algo_ratios if r <= t)
            rho_vals.append(round(solved / total_instances, 4))

        efficiency = rho_vals[0] if rho_vals else 0.0
        robustness = rho_vals[-1] if rho_vals else 0.0

        curves.append(
            AlgorithmProfileCurve(
                algorithm=algo,
                tau_values=tau_values,
                rho_values=rho_vals,
                efficiency=efficiency,
                robustness=robustness,
            )
        )

    # 4. Multiplicity-adjusted Win / Tie / Loss (W/T/L) Score Matrix
    # Compute symmetric upper-triangle tests per instance, adjust p-values per instance family,
    # and assign win/loss direction via non-parametric stochastic dominance (A12 with median tie-break).
    wilcoxon = WilcoxonSignedRankTest()
    mannwhitney = MannWhitneyUTest()

    k = len(algorithms)
    pair_wtl: dict[tuple[int, int], list[int]] = {(i, j): [0, 0, 0] for i in range(k) for j in range(k) if i != j}

    for inst in instances:
        inst_df = metric_df[metric_df["instance"] == inst]
        pair_indices: list[tuple[int, int]] = []
        raw_ps: list[float] = []
        pair_dirs: list[int] = []  # +1 if i better than j, -1 if j better than i, 0 if tie

        for i in range(k):
            for j in range(i + 1, k):
                a_i, a_j = algorithms[i], algorithms[j]
                v_i = inst_df[inst_df["algorithm"] == a_i]["value"].dropna().to_numpy(dtype=float)
                v_j = inst_df[inst_df["algorithm"] == a_j]["value"].dropna().to_numpy(dtype=float)

                pair_indices.append((i, j))
                if len(v_i) < 2 or len(v_j) < 2:
                    raw_ps.append(1.0)
                    pair_dirs.append(0)
                    continue

                try:
                    if paired and len(v_i) == len(v_j) and len(v_i) >= 3:
                        res = wilcoxon.run({a_i: v_i, a_j: v_j}, alpha=alpha)
                    else:
                        res = mannwhitney.run({a_i: v_i, a_j: v_j}, alpha=alpha)
                    p_val = res.p_value
                except Exception:
                    p_val = 1.0

                # Stochastic superiority direction (Vargha-Delaney A12, median fallback on exact 0.5 tie)
                a12, _ = compute_vargha_delaney_a12(v_i, v_j, maximize=maximize)
                if a12 > 0.5 + 1e-12:
                    direction = 1
                elif a12 < 0.5 - 1e-12:
                    direction = -1
                else:
                    med_i, med_j = float(np.median(v_i)), float(np.median(v_j))
                    if abs(med_i - med_j) <= 1e-12:
                        direction = 0
                    else:
                        direction = 1 if ((med_i > med_j) if maximize else (med_i < med_j)) else -1

                raw_ps.append(p_val)
                pair_dirs.append(direction)

        adj_ps = adjust_pvalues(raw_ps, method=posthoc_correction) if raw_ps else []
        for (i, j), p_adj, direction in zip(pair_indices, adj_ps, pair_dirs, strict=False):
            if p_adj < alpha and direction != 0:
                if direction > 0:
                    pair_wtl[(i, j)][0] += 1  # i wins over j
                    pair_wtl[(j, i)][2] += 1  # j loses to i
                else:
                    pair_wtl[(i, j)][2] += 1  # i loses to j
                    pair_wtl[(j, i)][0] += 1  # j wins over i
            else:
                pair_wtl[(i, j)][1] += 1
                pair_wtl[(j, i)][1] += 1

    wtl_matrix: list[list[WinTieLossCell]] = []
    algo_wins: dict[str, int] = {a: 0 for a in algorithms}
    algo_ties: dict[str, int] = {a: 0 for a in algorithms}
    algo_losses: dict[str, int] = {a: 0 for a in algorithms}

    for i, algo_row in enumerate(algorithms):
        matrix_row: list[WinTieLossCell] = []
        for j, algo_col in enumerate(algorithms):
            if i == j:
                matrix_row.append(
                    WinTieLossCell(
                        algo_row=algo_row,
                        algo_col=algo_col,
                        wins=0,
                        ties=total_instances,
                        losses=0,
                        net=0,
                    )
                )
                continue
            wins, ties, losses = pair_wtl[(i, j)]
            net = wins - losses
            algo_wins[algo_row] += wins
            algo_ties[algo_row] += ties
            algo_losses[algo_row] += losses
            matrix_row.append(
                WinTieLossCell(
                    algo_row=algo_row,
                    algo_col=algo_col,
                    wins=wins,
                    ties=ties,
                    losses=losses,
                    net=net,
                )
            )
        wtl_matrix.append(matrix_row)

    # 5. Global Meta-Rankings
    curve_map = {c.algorithm: c for c in curves}
    num_comparisons = max(1, (len(algorithms) - 1) * total_instances)

    meta_items: list[GlobalMetaRankingItem] = []
    for algo in algorithms:
        c = curve_map.get(algo)
        eff = c.efficiency if c else 0.0
        rob = c.robustness if c else 0.0
        win_cnt = algo_wins[algo]
        tie_cnt = algo_ties[algo]
        loss_cnt = algo_losses[algo]
        net = win_cnt - loss_cnt
        copeland = round(net / num_comparisons, 4)

        meta_items.append(
            GlobalMetaRankingItem(
                rank=1,
                algorithm=algo,
                efficiency=eff,
                robustness=rob,
                total_wins=win_cnt,
                total_ties=tie_cnt,
                total_losses=loss_cnt,
                net_score=net,
                copeland_score=copeland,
            )
        )

    meta_items.sort(key=lambda x: (x.net_score, x.efficiency, x.robustness), reverse=True)
    for rank_idx, item in enumerate(meta_items, start=1):
        object.__setattr__(item, "rank", rank_idx)

    return PerformanceProfilesResult(
        metric=target_metric,
        maximize=maximize,
        alpha=alpha,
        tau_values=tau_values,
        curves=curves,
        wtl_matrix=wtl_matrix,
        meta_rankings=meta_items,
    )

analyze_statistical_power

analyze_statistical_power(dataset: Dataset, metric: str | None = None, alpha: float = 0.05, target_power: float = 0.8, target_effect_size: float = 0.5, paired: bool = False) -> PowerAnalysisResult

Run full a priori power planning, sensitivity (MDES) analysis, and design audit.

Source code in src/saes/stats/power.py
def analyze_statistical_power(
    dataset: Dataset,
    metric: str | None = None,
    alpha: float = 0.05,
    target_power: float = 0.80,
    target_effect_size: float = 0.50,
    paired: bool = False,
) -> PowerAnalysisResult:
    """Run full a priori power planning, sensitivity (MDES) analysis, and design audit."""
    if not dataset.metrics:
        raise StatisticalAnalysisError("Dataset contains no metrics for power analysis.")

    target_metric = metric if metric in dataset.metrics else dataset.metrics[0]

    standard_effects = [
        (0.20, "Small (d = 0.20)"),
        (0.50, "Medium (d = 0.50)"),
        (0.80, "Large (d = 0.80)"),
    ]
    if target_effect_size not in (0.20, 0.50, 0.80):
        standard_effects.append((target_effect_size, f"Custom (d = {target_effect_size:.2f})"))

    recommendations: list[SampleSizeRecommendation] = [
        estimate_required_sample_size(target_power=target_power, effect_size=d_val, alpha=alpha)
        for d_val, _ in standard_effects
    ]

    power_curves = generate_power_curves(alpha=alpha, custom_effect_size=target_effect_size, paired=paired)

    audit_items, overall_health = compute_post_hoc_power_audit(
        dataset=dataset,
        metric=target_metric,
        alpha=alpha,
        paired=paired,
        target_power=target_power,
    )
    sensitivity_items = compute_sensitivity_audit(
        dataset=dataset,
        metric=target_metric,
        alpha=alpha,
        target_power=target_power,
        paired=paired,
    )

    return PowerAnalysisResult(
        alpha=alpha,
        target_power=target_power,
        target_effect_size=target_effect_size,
        sample_size_recommendations=recommendations,
        power_curves=power_curves,
        post_hoc_audit=audit_items,
        sensitivity_audit=sensitivity_items,
        overall_power_health=overall_health,
    )

tost

tost(x1: ndarray, x2: ndarray, low_eqbound: float, high_eqbound: float | None = None, alpha: float = 0.05, paired: bool = False, equal_var: bool = False, group_1: str = 'Algorithm A', group_2: str = 'Algorithm B') -> TOSTResult

Run Two One-Sided Tests (TOST) for statistical equivalence (Schuirmann 1987; Lakens 2017).

Source code in src/saes/api.py
def tost(
    x1: np.ndarray,
    x2: np.ndarray,
    low_eqbound: float,
    high_eqbound: float | None = None,
    alpha: float = 0.05,
    paired: bool = False,
    equal_var: bool = False,
    group_1: str = "Algorithm A",
    group_2: str = "Algorithm B",
) -> TOSTResult:
    """Run Two One-Sided Tests (TOST) for statistical equivalence (Schuirmann 1987; Lakens 2017)."""
    return tost_equivalence_test(
        x1=x1,
        x2=x2,
        low_eqbound=low_eqbound,
        high_eqbound=high_eqbound,
        alpha=alpha,
        paired=paired,
        equal_var=equal_var,
        group_1=group_1,
        group_2=group_2,
    )

compute_minimum_detectable_effect

compute_minimum_detectable_effect(n: int, target_power: float = 0.8, alpha: float = 0.05, paired: bool = False) -> float

Compute the Minimum Detectable Effect Size (MDES, Cohen's d) for a fixed sample size n.

Solves calculate_statistical_power(n, d, alpha=alpha, paired=paired) = target_power via Brent root-finding. Provides a valid sensitivity analysis without the observed-power fallacy.

Source code in src/saes/stats/power.py
def compute_minimum_detectable_effect(
    n: int,
    target_power: float = 0.80,
    alpha: float = 0.05,
    paired: bool = False,
) -> float:
    """Compute the Minimum Detectable Effect Size (MDES, Cohen's d) for a fixed sample size n.

    Solves `calculate_statistical_power(n, d, alpha=alpha, paired=paired) = target_power`
    via Brent root-finding. Provides a valid sensitivity analysis without the observed-power fallacy.
    """
    if n < 2:
        raise StatisticalAnalysisError(f"Sample size n must be >= 2 for MDES calculation, got {n}.")
    if not (alpha < target_power < 1.0):
        raise StatisticalAnalysisError(
            f"target_power must satisfy alpha < target_power < 1.0 (got alpha={alpha}, target_power={target_power})."
        )

    def obj(d: float) -> float:
        return calculate_statistical_power(n=n, effect_size=d, alpha=alpha, paired=paired) - target_power

    hi = 1.0
    while obj(hi) < 0.0 and hi < 100.0:
        hi *= 2.0
    if obj(hi) < 0.0:
        return float(hi)
    return float(optimize.brentq(obj, 1e-6, hi, xtol=1e-6, maxiter=200))

generate_reproducibility_artifacts

generate_reproducibility_artifacts(dataset: Dataset, metric: str | None = None, alpha: float = 0.05, filename: str = 'dataset.csv', raw_csv: str | None = None) -> ReproducibilityResult

Generate complete reproducibility pack: Python script, Jupyter notebook, and FAIR manifest.

Source code in src/saes/reports/reproducibility.py
def generate_reproducibility_artifacts(
    dataset: Dataset,
    metric: str | None = None,
    alpha: float = 0.05,
    filename: str = "dataset.csv",
    raw_csv: str | None = None,
) -> ReproducibilityResult:
    """Generate complete reproducibility pack: Python script, Jupyter notebook, and FAIR manifest."""
    if not dataset.metrics:
        raise StatisticalAnalysisError("Dataset contains no metrics for reproducibility generation.")

    target_metric = metric if metric in dataset.metrics else dataset.metrics[0]
    manifest = generate_environment_manifest(dataset, raw_csv=raw_csv)

    py_script = generate_python_script(
        dataset=dataset,
        metric=target_metric,
        alpha=alpha,
        filename=filename,
        checksum=manifest.dataset_checksum_sha256,
    )

    jupyter_nb = generate_jupyter_notebook(
        dataset=dataset,
        metric=target_metric,
        alpha=alpha,
        filename=filename,
        manifest=manifest,
    )

    return ReproducibilityResult(
        python_script=py_script,
        jupyter_notebook_json=jupyter_nb,
        manifest=manifest,
    )

Statistical Namespace (saes.api.StatisticsNamespace)

Programmatic statistical test API namespace (saes.statistics.*).

ttest_ind staticmethod

ttest_ind(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Student's two-sample independent t-test.

Source code in src/saes/api.py
@staticmethod
def ttest_ind(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Student's two-sample independent t-test."""
    return IndependentTTest().run(groups, alpha=alpha)

ttest_welch staticmethod

ttest_welch(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Welch's two-sample independent t-test (unequal variances).

Source code in src/saes/api.py
@staticmethod
def ttest_welch(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Welch's two-sample independent t-test (unequal variances)."""
    return WelchTTest().run(groups, alpha=alpha)

ttest_rel staticmethod

ttest_rel(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Paired samples t-test.

Source code in src/saes/api.py
@staticmethod
def ttest_rel(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Paired samples t-test."""
    return PairedTTest().run(groups, alpha=alpha)

wilcoxon staticmethod

wilcoxon(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Wilcoxon Signed-Rank paired non-parametric test.

Source code in src/saes/api.py
@staticmethod
def wilcoxon(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Wilcoxon Signed-Rank paired non-parametric test."""
    return WilcoxonSignedRankTest().run(groups, alpha=alpha)

mann_whitney staticmethod

mann_whitney(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Mann-Whitney U (Wilcoxon Rank-Sum) independent non-parametric test.

Source code in src/saes/api.py
@staticmethod
def mann_whitney(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Mann-Whitney U (Wilcoxon Rank-Sum) independent non-parametric test."""
    return MannWhitneyUTest().run(groups, alpha=alpha)

brunner_munzel staticmethod

brunner_munzel(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Brunner-Munzel (2000) non-parametric Behrens-Fisher test for stochastic equality.

Source code in src/saes/api.py
@staticmethod
def brunner_munzel(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Brunner-Munzel (2000) non-parametric Behrens-Fisher test for stochastic equality."""
    return BrunnerMunzelTest().run(groups, alpha=alpha)

kruskal staticmethod

kruskal(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Kruskal-Wallis H multi-group non-parametric omnibus test.

Source code in src/saes/api.py
@staticmethod
def kruskal(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Kruskal-Wallis H multi-group non-parametric omnibus test."""
    return KruskalWallisTest().run(groups, alpha=alpha)

anova_oneway staticmethod

anova_oneway(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Fisher One-Way ANOVA.

Source code in src/saes/api.py
@staticmethod
def anova_oneway(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Fisher One-Way ANOVA."""
    return OneWayANOVA().run(groups, alpha=alpha)

anova_welch staticmethod

anova_welch(groups: dict[str, ndarray], alpha: float = 0.05) -> StatisticalResult

Welch's One-Way ANOVA.

Source code in src/saes/api.py
@staticmethod
def anova_welch(groups: dict[str, np.ndarray], alpha: float = 0.05) -> StatisticalResult:
    """Welch's One-Way ANOVA."""
    return WelchANOVA().run(groups, alpha=alpha)

vargha_delaney_a12 staticmethod

vargha_delaney_a12(x1: ndarray, x2: ndarray, maximize: bool = True) -> tuple[float, str]

Compute Vargha-Delaney A12 non-parametric effect size and magnitude.

Source code in src/saes/api.py
@staticmethod
def vargha_delaney_a12(x1: np.ndarray, x2: np.ndarray, maximize: bool = True) -> tuple[float, str]:
    """Compute Vargha-Delaney A12 non-parametric effect size and magnitude."""
    return compute_vargha_delaney_a12(x1, x2, maximize=maximize)

vargha_delaney_a12_ci staticmethod

vargha_delaney_a12_ci(x1: ndarray, x2: ndarray, maximize: bool = True, alpha: float = 0.05) -> tuple[float, str, tuple[float, float]]

Compute Vargha-Delaney A12 with Brunner-Munzel asymptotic confidence interval.

Source code in src/saes/api.py
@staticmethod
def vargha_delaney_a12_ci(
    x1: np.ndarray,
    x2: np.ndarray,
    maximize: bool = True,
    alpha: float = 0.05,
) -> tuple[float, str, tuple[float, float]]:
    """Compute Vargha-Delaney A12 with Brunner-Munzel asymptotic confidence interval."""
    return compute_vargha_delaney_a12_with_ci(x1, x2, maximize=maximize, alpha=alpha)

cliffs_delta staticmethod

cliffs_delta(x1: ndarray, x2: ndarray, maximize: bool = True) -> tuple[float, str]

Compute Cliff's delta non-parametric effect size and magnitude.

Source code in src/saes/api.py
@staticmethod
def cliffs_delta(x1: np.ndarray, x2: np.ndarray, maximize: bool = True) -> tuple[float, str]:
    """Compute Cliff's delta non-parametric effect size and magnitude."""
    return compute_cliffs_delta(x1, x2, maximize=maximize)

cliffs_delta_ci staticmethod

cliffs_delta_ci(x1: ndarray, x2: ndarray, maximize: bool = True, alpha: float = 0.05) -> tuple[float, str, tuple[float, float]]

Compute Cliff's delta with Brunner-Munzel range-preserving confidence interval.

Source code in src/saes/api.py
@staticmethod
def cliffs_delta_ci(
    x1: np.ndarray,
    x2: np.ndarray,
    maximize: bool = True,
    alpha: float = 0.05,
) -> tuple[float, str, tuple[float, float]]:
    """Compute Cliff's delta with Brunner-Munzel range-preserving confidence interval."""
    return compute_cliffs_delta_with_ci(x1, x2, maximize=maximize, alpha=alpha)

cohens_d_ci staticmethod

cohens_d_ci(d: float, n1: int, n2: int | None = None, alpha: float = 0.05, paired: bool = False, hedges_correction: bool = False) -> tuple[float, float]

Compute exact noncentral-t confidence interval for Cohen's d or Hedges' g.

Source code in src/saes/api.py
@staticmethod
def cohens_d_ci(
    d: float,
    n1: int,
    n2: int | None = None,
    alpha: float = 0.05,
    paired: bool = False,
    hedges_correction: bool = False,
) -> tuple[float, float]:
    """Compute exact noncentral-t confidence interval for Cohen's d or Hedges' g."""
    return cohens_d_ci(
        d=d,
        n1=n1,
        n2=n2,
        alpha=alpha,
        paired=paired,
        hedges_correction=hedges_correction,
    )

eta_squared_ci staticmethod

eta_squared_ci(f_stat: float, df_between: float, df_within: float, alpha: float = 0.05) -> tuple[float, float]

Compute exact noncentral-F confidence interval for ANOVA Eta-squared.

Source code in src/saes/api.py
@staticmethod
def eta_squared_ci(
    f_stat: float,
    df_between: float,
    df_within: float,
    alpha: float = 0.05,
) -> tuple[float, float]:
    """Compute exact noncentral-F confidence interval for ANOVA Eta-squared."""
    return eta_squared_ci(f_stat=f_stat, df_between=df_between, df_within=df_within, alpha=alpha)

effect_size_forest staticmethod

effect_size_forest(dataset: Dataset, metric: str, scope: str = 'single-instance', instance: str | None = None, reference_algorithm: str | None = None, alpha: float = 0.05, paired: bool = False, p_adjust: str = 'holm') -> EffectSizeForestResult

Compute pairwise standardized effect sizes (d, g, A12, Cliff's delta) with 95% CIs vs reference.

Source code in src/saes/api.py
@staticmethod
def effect_size_forest(
    dataset: Dataset,
    metric: str,
    scope: str = "single-instance",
    instance: str | None = None,
    reference_algorithm: str | None = None,
    alpha: float = 0.05,
    paired: bool = False,
    p_adjust: str = "holm",
) -> EffectSizeForestResult:
    """Compute pairwise standardized effect sizes (d, g, A12, Cliff's delta) with 95% CIs vs reference."""
    res = compute_effect_size_forest(
        df=dataset.df,
        metric=metric,
        scope=scope,
        instance=instance,
        reference_algorithm=reference_algorithm,
        alpha=alpha,
        paired=paired,
        p_adjust=p_adjust,
    )
    assert isinstance(res, EffectSizeForestResult)
    return res

adjust_pvalues staticmethod

adjust_pvalues(p_values: list[float], method: str = 'holm') -> list[float]

Adjust p-values for multiple comparisons (Holm, Bonferroni, Hochberg, Hommel, Finner, Rom, Li, FDR).

Source code in src/saes/api.py
@staticmethod
def adjust_pvalues(p_values: list[float], method: str = "holm") -> list[float]:
    """Adjust p-values for multiple comparisons (Holm, Bonferroni, Hochberg, Hommel, Finner, Rom, Li, FDR)."""
    return adjust_pvalues(p_values, method=method)

adjust_pvalues_shaffer staticmethod

adjust_pvalues_shaffer(p_matrix: ndarray) -> np.ndarray

Apply Shaffer's (1986) static multiple-comparison adjustment to a symmetric k x k p-value matrix.

Source code in src/saes/api.py
@staticmethod
def adjust_pvalues_shaffer(p_matrix: np.ndarray) -> np.ndarray:
    """Apply Shaffer's (1986) static multiple-comparison adjustment to a symmetric k x k p-value matrix."""
    return adjust_pvalues_shaffer(p_matrix)

adjust_pvalues_bergmann_hommel staticmethod

adjust_pvalues_bergmann_hommel(p_matrix: ndarray, max_exact_k: int = 9) -> tuple[np.ndarray, list[str]]

Apply exact Bergmann-Hommel (1988) exhaustive adjustment to a symmetric k x k p-value matrix.

Source code in src/saes/api.py
@staticmethod
def adjust_pvalues_bergmann_hommel(
    p_matrix: np.ndarray,
    max_exact_k: int = 9,
) -> tuple[np.ndarray, list[str]]:
    """Apply exact Bergmann-Hommel (1988) exhaustive adjustment to a symmetric k x k p-value matrix."""
    return adjust_pvalues_bergmann_hommel(p_matrix, max_exact_k=max_exact_k)

tukey_hsd staticmethod

tukey_hsd(groups: dict[str, ndarray], alpha: float = 0.05) -> PostHocResult

Tukey's Honestly Significant Difference (HSD) parametric all-pairs post-hoc test.

Source code in src/saes/api.py
@staticmethod
def tukey_hsd(groups: dict[str, np.ndarray], alpha: float = 0.05) -> PostHocResult:
    """Tukey's Honestly Significant Difference (HSD) parametric all-pairs post-hoc test."""
    return tukey_hsd(groups, alpha=alpha)

games_howell staticmethod

games_howell(groups: dict[str, ndarray], alpha: float = 0.05) -> PostHocResult

Games-Howell heteroscedastic all-pairs post-hoc test (after Welch's ANOVA).

Source code in src/saes/api.py
@staticmethod
def games_howell(groups: dict[str, np.ndarray], alpha: float = 0.05) -> PostHocResult:
    """Games-Howell heteroscedastic all-pairs post-hoc test (after Welch's ANOVA)."""
    return games_howell(groups, alpha=alpha)

dunnett staticmethod

dunnett(groups: dict[str, ndarray], control: str, alpha: float = 0.05) -> PostHocResult

Dunnett's many-to-one post-hoc comparison against a control group.

Source code in src/saes/api.py
@staticmethod
def dunnett(groups: dict[str, np.ndarray], control: str, alpha: float = 0.05) -> PostHocResult:
    """Dunnett's many-to-one post-hoc comparison against a control group."""
    return dunnett(groups, control=control, alpha=alpha)

dunn staticmethod

dunn(groups: dict[str, ndarray], alpha: float = 0.05, p_adjust: str = 'holm') -> PostHocResult

Dunn's (1964) non-parametric all-pairs post-hoc test (after Kruskal-Wallis).

Source code in src/saes/api.py
@staticmethod
def dunn(groups: dict[str, np.ndarray], alpha: float = 0.05, p_adjust: str = "holm") -> PostHocResult:
    """Dunn's (1964) non-parametric all-pairs post-hoc test (after Kruskal-Wallis)."""
    return dunn_test(groups, alpha=alpha, p_adjust=p_adjust)

conover_iman staticmethod

conover_iman(groups: dict[str, ndarray], alpha: float = 0.05, p_adjust: str = 'holm') -> PostHocResult

Conover-Iman (1979) non-parametric all-pairs post-hoc test (after Kruskal-Wallis).

Source code in src/saes/api.py
@staticmethod
def conover_iman(groups: dict[str, np.ndarray], alpha: float = 0.05, p_adjust: str = "holm") -> PostHocResult:
    """Conover-Iman (1979) non-parametric all-pairs post-hoc test (after Kruskal-Wallis)."""
    return conover_iman_test(groups, alpha=alpha, p_adjust=p_adjust)

table staticmethod

table(dataset: Dataset, metric: str | None = None, table_type: str = 'instance_algorithm', test_type: str = 'auto', posthoc_correction: str = 'holm', summary_stat: str = 'auto', reference_algorithm: str | None = None, scope: str = 'all-instances', selected_instance: str | None = None, algorithms_filter: list[str] | None = None, instances_filter: list[str] | None = None, alpha: float = 0.05, precision: int = 4, paired: bool = False) -> StatisticalTableResult

Generate a statistical benchmark table (instance_algorithm, pairwise_matrix, omnibus_posthoc).

Source code in src/saes/api.py
@staticmethod
def table(
    dataset: Dataset,
    metric: str | None = None,
    table_type: str = "instance_algorithm",
    test_type: str = "auto",
    posthoc_correction: str = "holm",
    summary_stat: str = "auto",
    reference_algorithm: str | None = None,
    scope: str = "all-instances",
    selected_instance: str | None = None,
    algorithms_filter: list[str] | None = None,
    instances_filter: list[str] | None = None,
    alpha: float = 0.05,
    precision: int = 4,
    paired: bool = False,
) -> StatisticalTableResult:
    """Generate a statistical benchmark table (instance_algorithm, pairwise_matrix, omnibus_posthoc)."""
    return generate_table(
        dataset=dataset,
        metric=metric,
        table_type=table_type,
        test_type=test_type,
        posthoc_correction=posthoc_correction,
        summary_stat=summary_stat,
        reference_algorithm=reference_algorithm,
        scope=scope,
        selected_instance=selected_instance,
        algorithms_filter=algorithms_filter,
        instances_filter=instances_filter,
        alpha=alpha,
        precision=precision,
        paired=paired,
    )

explore staticmethod

explore(dataset: Dataset, metrics: list[str] | None = None, algorithms: list[str] | None = None, instances: list[str] | None = None, alpha: float = 0.05) -> DataExplorationResult

Explore dataset distributions, reveal multi-metric pivots, and recommend statistical tests.

Source code in src/saes/api.py
@staticmethod
def explore(
    dataset: Dataset,
    metrics: list[str] | None = None,
    algorithms: list[str] | None = None,
    instances: list[str] | None = None,
    alpha: float = 0.05,
) -> DataExplorationResult:
    """Explore dataset distributions, reveal multi-metric pivots, and recommend statistical tests."""
    return explore(
        dataset=dataset,
        metrics=metrics,
        algorithms=algorithms,
        instances=instances,
        alpha=alpha,
    )

shapiro staticmethod

shapiro(groups: dict[str, ndarray], alpha: float = 0.05) -> list[AssumptionResult]

Check normality assumption via Shapiro-Wilk test.

Source code in src/saes/api.py
@staticmethod
def shapiro(groups: dict[str, np.ndarray], alpha: float = 0.05) -> list[AssumptionResult]:
    """Check normality assumption via Shapiro-Wilk test."""
    return NormalityChecker(alpha=alpha).check(groups)

lilliefors staticmethod

lilliefors(groups: dict[str, ndarray], alpha: float = 0.05) -> list[AssumptionResult]

Check normality assumption via Lilliefors-corrected Kolmogorov-Smirnov test.

Source code in src/saes/api.py
@staticmethod
def lilliefors(groups: dict[str, np.ndarray], alpha: float = 0.05) -> list[AssumptionResult]:
    """Check normality assumption via Lilliefors-corrected Kolmogorov-Smirnov test."""
    return LillieforsChecker(alpha=alpha).check(groups)

anderson staticmethod

anderson(groups: dict[str, ndarray], alpha: float = 0.05) -> list[AssumptionResult]

Check normality assumption via Anderson-Darling test (Stephens 1974).

Source code in src/saes/api.py
@staticmethod
def anderson(groups: dict[str, np.ndarray], alpha: float = 0.05) -> list[AssumptionResult]:
    """Check normality assumption via Anderson-Darling test (Stephens 1974)."""
    return AndersonDarlingChecker(alpha=alpha).check(groups)

levene staticmethod

levene(groups: dict[str, ndarray], alpha: float = 0.05) -> AssumptionResult

Check homogeneity of variance assumption via Levene's test.

Source code in src/saes/api.py
@staticmethod
def levene(groups: dict[str, np.ndarray], alpha: float = 0.05) -> AssumptionResult:
    """Check homogeneity of variance assumption via Levene's test."""
    return HomogeneityChecker(alpha=alpha).check(groups)

friedman_nemenyi staticmethod

friedman_nemenyi(dataset: Dataset, metric: str, alpha: float = 0.05, scope: str = 'all-instances', instance: str | None = None) -> CriticalDistanceResult

Friedman non-parametric rank test with Nemenyi post-hoc Critical Distance (CD).

Source code in src/saes/api.py
@staticmethod
def friedman_nemenyi(
    dataset: Dataset,
    metric: str,
    alpha: float = 0.05,
    scope: str = "all-instances",
    instance: str | None = None,
) -> CriticalDistanceResult:
    """Friedman non-parametric rank test with Nemenyi post-hoc Critical Distance (CD)."""
    return FriedmanNemenyiTest().run(df=dataset.df, metric=metric, alpha=alpha, scope=scope, instance=instance)

friedman_aligned_ranks staticmethod

friedman_aligned_ranks(dataset: Dataset, metric: str, alpha: float = 0.05, scope: str = 'all-instances', instance: str | None = None) -> BlockedOmnibusResult

Friedman Aligned-Ranks omnibus test across benchmark blocks (Hodges & Lehmann 1962; García et al. 2010).

Source code in src/saes/api.py
@staticmethod
def friedman_aligned_ranks(
    dataset: Dataset,
    metric: str,
    alpha: float = 0.05,
    scope: str = "all-instances",
    instance: str | None = None,
) -> BlockedOmnibusResult:
    """Friedman Aligned-Ranks omnibus test across benchmark blocks (Hodges & Lehmann 1962; García et al. 2010)."""
    return FriedmanAlignedRanksTest().run(
        df=dataset.df,
        metric=metric,
        alpha=alpha,
        scope=scope,
        instance=instance,
    )

quade staticmethod

quade(dataset: Dataset, metric: str, alpha: float = 0.05, scope: str = 'all-instances', instance: str | None = None) -> BlockedOmnibusResult

Quade weighted-block non-parametric omnibus test (Quade 1979; García et al. 2010).

Source code in src/saes/api.py
@staticmethod
def quade(
    dataset: Dataset,
    metric: str,
    alpha: float = 0.05,
    scope: str = "all-instances",
    instance: str | None = None,
) -> BlockedOmnibusResult:
    """Quade weighted-block non-parametric omnibus test (Quade 1979; García et al. 2010)."""
    return QuadeTest().run(df=dataset.df, metric=metric, alpha=alpha, scope=scope, instance=instance)

rm_anova staticmethod

rm_anova(dataset: Dataset, metric: str, alpha: float = 0.05, scope: str = 'all-instances', instance: str | None = None, greenhouse_geisser: bool = True) -> BlockedOmnibusResult

One-way Repeated-Measures ANOVA across matched blocks with Greenhouse-Geisser sphericity correction.

Source code in src/saes/api.py
@staticmethod
def rm_anova(
    dataset: Dataset,
    metric: str,
    alpha: float = 0.05,
    scope: str = "all-instances",
    instance: str | None = None,
    greenhouse_geisser: bool = True,
) -> BlockedOmnibusResult:
    """One-way Repeated-Measures ANOVA across matched blocks with Greenhouse-Geisser sphericity correction."""
    return RepeatedMeasuresANOVA().run(
        df=dataset.df,
        metric=metric,
        alpha=alpha,
        scope=scope,
        instance=instance,
        greenhouse_geisser=greenhouse_geisser,
    )

bayesian_ranking staticmethod

bayesian_ranking(dataset: Dataset, metric: str, scope: str = 'all-instances', instance: str | None = None, rope_percent: float = 1.0, rope: float | None = None, prior_strength: float = 1.0, num_samples: int = 1500, algo_a: str | None = None, algo_b: str | None = None, method: str = 'signed-rank') -> BayesianRankResult

Bayesian Signed-Rank / Sign-Test Simplex (ROPE) and Posterior Ranking test (Benavoli et al. 2017).

Source code in src/saes/api.py
@staticmethod
def bayesian_ranking(
    dataset: Dataset,
    metric: str,
    scope: str = "all-instances",
    instance: str | None = None,
    rope_percent: float = 1.0,
    rope: float | None = None,
    prior_strength: float = 1.0,
    num_samples: int = 1500,
    algo_a: str | None = None,
    algo_b: str | None = None,
    method: str = "signed-rank",
) -> BayesianRankResult:
    """Bayesian Signed-Rank / Sign-Test Simplex (ROPE) and Posterior Ranking test (Benavoli et al. 2017)."""
    return BayesianRankingTest().run(
        df=dataset.df,
        metric=metric,
        scope=scope,
        instance=instance,
        rope_percent=rope_percent,
        rope=rope,
        prior_strength=prior_strength,
        num_samples=num_samples,
        algo_a=algo_a,
        algo_b=algo_b,
        method=method,
    )

bayesian_sign staticmethod

bayesian_sign(dataset: Dataset, metric: str, scope: str = 'all-instances', instance: str | None = None, rope_percent: float = 1.0, rope: float | None = None, prior_strength: float = 1.0, num_samples: int = 1500, algo_a: str | None = None, algo_b: str | None = None) -> BayesianRankResult

Bayesian Sign Test Simplex (ROPE) (Benavoli et al. 2017).

Source code in src/saes/api.py
@staticmethod
def bayesian_sign(
    dataset: Dataset,
    metric: str,
    scope: str = "all-instances",
    instance: str | None = None,
    rope_percent: float = 1.0,
    rope: float | None = None,
    prior_strength: float = 1.0,
    num_samples: int = 1500,
    algo_a: str | None = None,
    algo_b: str | None = None,
) -> BayesianRankResult:
    """Bayesian Sign Test Simplex (ROPE) (Benavoli et al. 2017)."""
    return BayesianRankingTest().run(
        df=dataset.df,
        metric=metric,
        scope=scope,
        instance=instance,
        rope_percent=rope_percent,
        rope=rope,
        prior_strength=prior_strength,
        num_samples=num_samples,
        algo_a=algo_a,
        algo_b=algo_b,
        method="sign",
    )

bayesian_signed_rank staticmethod

bayesian_signed_rank(dataset: Dataset, metric: str, scope: str = 'all-instances', instance: str | None = None, rope_percent: float = 1.0, rope: float | None = None, prior_strength: float = 1.0, num_samples: int = 1500, algo_a: str | None = None, algo_b: str | None = None) -> BayesianRankResult

Bayesian Signed-Rank Test Simplex (ROPE) (Benavoli et al. 2017).

Source code in src/saes/api.py
@staticmethod
def bayesian_signed_rank(
    dataset: Dataset,
    metric: str,
    scope: str = "all-instances",
    instance: str | None = None,
    rope_percent: float = 1.0,
    rope: float | None = None,
    prior_strength: float = 1.0,
    num_samples: int = 1500,
    algo_a: str | None = None,
    algo_b: str | None = None,
) -> BayesianRankResult:
    """Bayesian Signed-Rank Test Simplex (ROPE) (Benavoli et al. 2017)."""
    return BayesianRankingTest().run(
        df=dataset.df,
        metric=metric,
        scope=scope,
        instance=instance,
        rope_percent=rope_percent,
        rope=rope,
        prior_strength=prior_strength,
        num_samples=num_samples,
        algo_a=algo_a,
        algo_b=algo_b,
        method="signed-rank",
    )

bayesian_correlated_ttest staticmethod

bayesian_correlated_ttest(x_a: ndarray, x_b: ndarray, algo_a: str = 'Algorithm A', algo_b: str = 'Algorithm B', rope: float = 0.01, rho: float | None = None, maximize: bool = True) -> BayesianCorrelatedTResult

Bayesian Correlated t-test with ROPE (Nadeau & Bengio 2003; Benavoli et al. 2017).

Source code in src/saes/api.py
@staticmethod
def bayesian_correlated_ttest(
    x_a: np.ndarray,
    x_b: np.ndarray,
    algo_a: str = "Algorithm A",
    algo_b: str = "Algorithm B",
    rope: float = 0.01,
    rho: float | None = None,
    maximize: bool = True,
) -> BayesianCorrelatedTResult:
    """Bayesian Correlated t-test with ROPE (Nadeau & Bengio 2003; Benavoli et al. 2017)."""
    return BayesianCorrelatedTTest().run(
        x_a=x_a,
        x_b=x_b,
        algo_a=algo_a,
        algo_b=algo_b,
        rope=rope,
        rho=rho,
        maximize=maximize,
    )

bayesian_plackett_luce staticmethod

bayesian_plackett_luce(dataset: Dataset, metric: str, scope: str = 'all-instances', instance: str | None = None, num_samples: int = 400, prior_alpha: float = 1.0, seed: int = 42) -> BayesianPlackettLuceResult

Bayesian Plackett-Luce multi-algorithm ranking model (Calvo et al. 2018).

Source code in src/saes/api.py
@staticmethod
def bayesian_plackett_luce(
    dataset: Dataset,
    metric: str,
    scope: str = "all-instances",
    instance: str | None = None,
    num_samples: int = 400,
    prior_alpha: float = 1.0,
    seed: int = 42,
) -> BayesianPlackettLuceResult:
    """Bayesian Plackett-Luce multi-algorithm ranking model (Calvo et al. 2018)."""
    algorithms, matrix, maximize, *_ = _extract_block_matrix(
        df=dataset.df,
        metric=metric,
        scope=scope,
        instance=instance,
    )
    return BayesianPlackettLuceTest().run(
        matrix=matrix,
        algorithms=algorithms,
        metric=metric,
        maximize=maximize,
        num_samples=num_samples,
        prior_alpha=prior_alpha,
        seed=seed,
    )

minimum_detectable_effect staticmethod

minimum_detectable_effect(n: int, target_power: float = 0.8, alpha: float = 0.05, paired: bool = False) -> float

Compute Minimum Detectable Effect Size (MDES, Cohen's d) for a fixed sample size n.

Source code in src/saes/api.py
@staticmethod
def minimum_detectable_effect(
    n: int,
    target_power: float = 0.80,
    alpha: float = 0.05,
    paired: bool = False,
) -> float:
    """Compute Minimum Detectable Effect Size (MDES, Cohen's d) for a fixed sample size n."""
    return compute_minimum_detectable_effect(n=n, target_power=target_power, alpha=alpha, paired=paired)

tost staticmethod

tost(x1: ndarray, x2: ndarray, low_eqbound: float, high_eqbound: float | None = None, alpha: float = 0.05, paired: bool = False, equal_var: bool = False, group_1: str = 'Algorithm A', group_2: str = 'Algorithm B') -> TOSTResult

Two One-Sided Tests (TOST) procedure for statistical equivalence (Schuirmann 1987; Lakens 2017).

Source code in src/saes/api.py
@staticmethod
def tost(
    x1: np.ndarray,
    x2: np.ndarray,
    low_eqbound: float,
    high_eqbound: float | None = None,
    alpha: float = 0.05,
    paired: bool = False,
    equal_var: bool = False,
    group_1: str = "Algorithm A",
    group_2: str = "Algorithm B",
) -> TOSTResult:
    """Two One-Sided Tests (TOST) procedure for statistical equivalence (Schuirmann 1987; Lakens 2017)."""
    return tost_equivalence_test(
        x1=x1,
        x2=x2,
        low_eqbound=low_eqbound,
        high_eqbound=high_eqbound,
        alpha=alpha,
        paired=paired,
        equal_var=equal_var,
        group_1=group_1,
        group_2=group_2,
    )

Key Domain Result Models (saes.domain.models)

Domain data models, canonical benchmark records, and immutable result objects for SAES.

StatisticalResult

Bases: BaseModel

Immutable structured result of a statistical analysis test.

summary

summary() -> str

Return a concise human-readable statistical summary.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return a concise human-readable statistical summary."""
    lines = [
        f"Test: {self.test_name}",
        f"Statistic: {self.statistic:.4f} | p-value: {self.p_value:.4e} | alpha: {self.alpha}",
        f"Significant: {self.is_significant}",
    ]
    if self.degrees_of_freedom is not None:
        lines.append(f"Degrees of freedom: {self.degrees_of_freedom}")
    if self.effect_size is not None:
        es = self.effect_size
        ci_txt = (
            f", 95% CI [{es.ci_lower:.4f}, {es.ci_upper:.4f}]"
            if es.ci_lower is not None and es.ci_upper is not None
            else ""
        )
        lines.append(f"Effect size ({es.name}): {es.value:.4f} ({es.magnitude}{ci_txt})")
    if self.confidence_interval is not None:
        lines.append(
            f"Confidence interval: [{self.confidence_interval[0]:.4f}, {self.confidence_interval[1]:.4f}]"
        )
    if self.warnings:
        lines.append(f"Warnings ({len(self.warnings)}): " + "; ".join(self.warnings))
    return "\n".join(lines)

to_dataframe

to_dataframe() -> pd.DataFrame

Convert test result into a single-row tidy pandas DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Convert test result into a single-row tidy pandas DataFrame."""
    return pd.DataFrame(
        [
            {
                "test_name": self.test_name,
                "statistic": self.statistic,
                "p_value": self.p_value,
                "degrees_of_freedom": self.degrees_of_freedom,
                "alpha": self.alpha,
                "is_significant": self.is_significant,
                "effect_size_name": self.effect_size.name if self.effect_size else None,
                "effect_size_value": self.effect_size.value if self.effect_size else None,
                "effect_size_ci_lower": self.effect_size.ci_lower if self.effect_size else None,
                "effect_size_ci_upper": self.effect_size.ci_upper if self.effect_size else None,
                "effect_size_magnitude": self.effect_size.magnitude if self.effect_size else None,
            }
        ]
    )

PostHocResult

Bases: BaseModel

Structured result of a parametric or non-parametric post-hoc multiple-comparisons procedure.

to_dataframe

to_dataframe() -> pd.DataFrame

Return all pairwise post-hoc comparisons as a tidy pandas DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return all pairwise post-hoc comparisons as a tidy pandas DataFrame."""
    return pd.DataFrame([c.model_dump() for c in self.comparisons])

summary

summary() -> str

Return formatted text summary of post-hoc comparisons.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return formatted text summary of post-hoc comparisons."""
    header = f"Post-hoc test: {self.method} (adjustment={self.p_adjust}, alpha={self.alpha})"
    sig_count = sum(1 for c in self.comparisons if c.is_significant)
    return f"{header}\nTotal comparisons: {len(self.comparisons)} | Significant: {sig_count}"

TOSTResult

Bases: BaseModel

Result of a Two One-Sided Tests (TOST) equivalence procedure (Schuirmann 1987; Lakens 2017).

summary

summary() -> str

Return concise text summary of the TOST equivalence test.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of the TOST equivalence test."""
    status = "Equivalent" if self.is_equivalent else "Equivalence not established"
    return (
        f"{self.test_name}: {self.group_1} vs {self.group_2} | "
        f"diff={self.mean_diff:.4f}, bounds=[{self.low_eqbound:.4f}, {self.high_eqbound:.4f}], "
        f"p_TOST={self.p_value:.4e}, {(1 - 2 * self.alpha) * 100:.0f}% CI=[{self.ci_lower:.4f}, "
        f"{self.ci_upper:.4f}] -> {status}"
    )

BlockedOmnibusResult

Bases: BaseModel

Result of a multi-instance blocked omnibus test (Friedman Aligned-Ranks, Quade, RM-ANOVA).

to_dataframe

to_dataframe() -> pd.DataFrame

Return algorithm ranking summary as a tidy DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return algorithm ranking summary as a tidy DataFrame."""
    return pd.DataFrame([r.model_dump() for r in self.ranks])

summary

summary() -> str

Return concise text summary of the blocked omnibus test.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of the blocked omnibus test."""
    return (
        f"{self.test_name} (metric={self.metric}, k={self.k}, N={self.n_blocks}): "
        f"stat={self.statistic:.4f}, df={self.degrees_of_freedom}, p={self.p_value:.4e}, "
        f"significant={self.is_significant}"
    )

CriticalDistanceResult

Bases: BaseModel

Result of Friedman omnibus test, Iman-Davenport F, and Nemenyi Critical Distance (CD).

to_dataframe

to_dataframe() -> pd.DataFrame

Return average algorithm ranks as a tidy pandas DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return average algorithm ranks as a tidy pandas DataFrame."""
    return pd.DataFrame([r.model_dump() for r in self.ranks])

summary

summary() -> str

Return concise text summary of Friedman + Nemenyi results.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of Friedman + Nemenyi results."""
    return (
        f"Friedman-Nemenyi ({self.metric}, k={self.k}, N={self.n_blocks}, alpha={self.alpha}): "
        f"chi2={self.friedman_stat:.4f} (p={self.friedman_p_value:.4e}), "
        f"Iman-Davenport F={self.iman_davenport_f:.4f} (p={self.iman_davenport_p_value:.4e}), "
        f"CD={self.cd:.4f}"
    )

BayesianRankResult

Bases: BaseModel

Result of Bayesian Non-Parametric Signed-Rank / Sign-Test Simplex (ROPE) & Posterior Ranking test.

to_dataframe

to_dataframe() -> pd.DataFrame

Return posterior algorithm rank summary as a tidy pandas DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return posterior algorithm rank summary as a tidy pandas DataFrame."""
    return pd.DataFrame(
        [
            {
                "algorithm": it.algorithm,
                "mean_rank": it.mean_rank,
                "median_rank": it.median_rank,
                "ci_lower": it.ci_lower,
                "ci_upper": it.ci_upper,
                "prob_best": it.prob_best,
                "prob_better_than_ref": it.prob_better_than_ref,
                "prob_rope_with_ref": it.prob_rope_with_ref,
            }
            for it in self.items
        ]
    )

summary

summary() -> str

Return concise text summary of Bayesian Simplex ROPE results.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of Bayesian Simplex ROPE results."""
    return (
        f"Bayesian {self.bayesian_method} ({self.algo_a} vs {self.algo_b}, N={self.n_blocks}): "
        f"P({self.algo_a})={self.p_left:.3f}, P(ROPE)={self.p_rope:.3f}, P({self.algo_b})={self.p_right:.3f}"
    )

BayesianPlackettLuceResult

Bases: BaseModel

Result of a Bayesian Plackett-Luce multi-algorithm ranking model (Calvo et al. 2018).

to_dataframe

to_dataframe() -> pd.DataFrame

Return Plackett-Luce posterior items as a tidy DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return Plackett-Luce posterior items as a tidy DataFrame."""
    return pd.DataFrame([item.model_dump() for item in self.items])

summary

summary() -> str

Return concise text summary of Bayesian Plackett-Luce posterior rankings.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of Bayesian Plackett-Luce posterior rankings."""
    lines = [f"Bayesian Plackett-Luce Ranking (metric={self.metric}, k={self.k}, N={self.n_blocks}):"]
    for it in self.items:
        lines.append(
            f"  {it.algorithm}: P(best)={it.prob_best:.3f}, E[rank]={it.expected_rank:.2f} "
            f"[{it.rank_ci_lower:.2f}, {it.rank_ci_upper:.2f}]"
        )
    return "\n".join(lines)

BayesianCorrelatedTResult

Bases: BaseModel

Result of the Bayesian Correlated t-test (Nadeau & Bengio 2003; Benavoli et al. 2017).

summary

summary() -> str

Return concise text summary of the Bayesian correlated t-test.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of the Bayesian correlated t-test."""
    return (
        f"Bayesian Correlated t-test ({self.algo_a} vs {self.algo_b}, n={self.n_observations}, "
        f"rho={self.rho:.3f}, ROPE=[{self.rope_low}, {self.rope_high}]): "
        f"P({self.algo_a})={self.p_left:.4f}, P(ROPE)={self.p_rope:.4f}, P({self.algo_b})={self.p_right:.4f}"
    )

EffectSizeForestResult

Bases: BaseModel

Structured forest-plot comparison of standardized effect sizes with confidence intervals.

to_dataframe

to_dataframe() -> pd.DataFrame

Return all pairwise effect-size estimates and CIs as a tidy DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return all pairwise effect-size estimates and CIs as a tidy DataFrame."""
    return pd.DataFrame([it.model_dump() for it in self.items])

summary

summary() -> str

Return concise text summary of pairwise effect sizes vs reference.

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return concise text summary of pairwise effect sizes vs reference."""
    lines = [
        f"Effect-Size Forest ({self.metric}, ref={self.reference_algorithm}, "
        f"scope={self.scope}, alpha={self.alpha}):"
    ]
    for it in self.items:
        lines.append(
            f"  {it.algorithm} vs {it.reference}: g={it.hedges_g:+.3f} "
            f"[{it.hedges_g_ci_lower:+.3f}, {it.hedges_g_ci_upper:+.3f}], "
            f"A12={it.a12:.3f} [{it.a12_ci_lower:.3f}, {it.a12_ci_upper:.3f}], "
            f"p_adj={it.p_adjusted:.4g}"
        )
    return "\n".join(lines)

PowerAnalysisResult

Bases: BaseModel

Complete statistical power analysis, sensitivity (MDES), and experimental sample size planning.

summary

summary() -> str

Return a concise human-readable summary of power planning and sensitivity (MDES).

Source code in src/saes/domain/models.py
def summary(self) -> str:
    """Return a concise human-readable summary of power planning and sensitivity (MDES)."""
    lines = [
        f"Power Analysis (alpha={self.alpha}, target_power={self.target_power:.0%}, "
        f"health={self.overall_power_health}):"
    ]
    for rec in self.sample_size_recommendations:
        lines.append(
            f"  {rec.effect_size_label}: N_ind={rec.recommended_n_independent}, "
            f"N_paired={rec.recommended_n_paired}, N_nonparam={rec.recommended_n_nonparametric}"
        )
    if self.sensitivity_audit:
        from statistics import median

        mdes_vals = [it.mdes_cohens_d for it in self.sensitivity_audit]
        lines.append(
            f"  Sensitivity (MDES): {len(mdes_vals)} cells, "
            f"median MDES d = {float(median(mdes_vals)):.3f}"
        )
    return "\n".join(lines)

to_dataframe

to_dataframe() -> pd.DataFrame

Return a priori sample size recommendations as a tidy pandas DataFrame.

Source code in src/saes/domain/models.py
def to_dataframe(self) -> pd.DataFrame:
    """Return a priori sample size recommendations as a tidy pandas DataFrame."""
    return pd.DataFrame([r.model_dump() for r in self.sample_size_recommendations])

DataExplorationResult

Bases: BaseModel

Complete response for dataset exploration, multi-metric reveal, normality profiling, and test recommendations.