Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Ucbepic Docetl ParetoFrontier Analysis

From Leeroopedia


Knowledge Sources
Domains Optimization, Decision_Making
Last Updated 2026-02-08 01:40 GMT

Overview

Concrete tool for tracking and visualizing the Pareto frontier of optimized pipeline variants provided by the MOAR module.

Description

The ParetoFrontier class maintains a collection of pipeline plans with their accuracy scores and costs, constructs the Pareto frontier, calculates hypervolume indicators, and generates visualization plots. It integrates with the MCTS backpropagation phase to update action rewards based on frontier changes.

Usage

ParetoFrontier is managed internally by MOARSearch during optimization. After optimization completes, review the generated plots in save_dir/graph/ and use get_all_plans_summary() to programmatically inspect results. Run the selected optimized pipeline YAML with docetl run.

Code Reference

Source Location

  • Repository: docetl
  • File: docetl/moar/ParetoFrontier.py
  • Lines: L21-325

Signature

class ParetoFrontier:
    def __init__(
        self,
        action_rewards: Dict[str, float],
        action_cost_changes: Dict[str, float],
        action_accuracy_changes: Dict[str, float],
        dataset_name: str,
        evaluate_func: Callable[[str], Dict[str, Any]],
        console=None,
    ):
        """Initialize Pareto frontier tracking."""

    def add_plan_f1(self, node: Node, accuracy: float) -> Tuple[Dict[Node, int], bool]:
        """Add plan with pre-evaluated accuracy. Returns affected nodes and frontier update flag."""

    def update_pareto_frontier_HV(self, new_node) -> Tuple[Dict[Node, int], bool]:
        """Update frontier and calculate hypervolume indicator."""

    def get_all_plans_summary(self) -> List[Dict[str, Any]]:
        """Get summary of all plans with metrics."""

    def plot_plans(self, save_path=None, plan_num=None, yaml_file=None):
        """Plot cost vs accuracy scatter with frontier highlighted."""

Import

from docetl.moar.ParetoFrontier import ParetoFrontier

I/O Contract

Inputs

Name Type Required Description
node Node Yes Pipeline variant to add to frontier
accuracy float Yes Evaluated accuracy score
action_rewards Dict[str, float] Yes Reference to MCTS action reward tracking

Outputs

Name Type Description
frontier_plans List[Node] Non-dominated plans on the Pareto frontier
plots PNG files Cost vs accuracy visualization plots
get_all_plans_summary() List[Dict] Plan details with accuracy, cost, frontier status

Usage Examples

# After optimization, run the best optimized pipeline
docetl run moar_results/plan_5.yaml
# Programmatically inspect frontier
for summary in frontier.get_all_plans_summary():
    if summary["is_frontier"]:
        node = summary["node"]
        print(f"Plan {node.id}: cost=${node.cost:.2f}, acc={summary['accuracy']:.3f}")

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment