End-to-end reproducible pipeline
Download the notebook (executed for this page) · source
Run the actual standalone CSV-to-report pipeline using the toy configuration. The configuration is selected in this kernel before any loader import, and all outputs resolve to notebooks/outputs/toy. The production config.toml remains unchanged.
from pathlib import Path
import os, sys
ROOT = next(p for p in [Path.cwd(), *Path.cwd().parents] if (p / 'pixi.toml').exists())
os.environ['TFOPT_CONFIG'] = str(ROOT / 'notebooks/data/toy.toml')
os.environ.setdefault('MPLBACKEND', 'Agg')
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
import tfopt
import numpy as np
import pandas as pd
from notebooks.tutorial import build_problem, optimize, OUTPUT
p = build_problem()
import subprocess
completed=subprocess.run([sys.executable,'-m','tfopt.local','--conf',str(ROOT/'notebooks/data/toy.toml')],cwd=ROOT,check=True,capture_output=True,text=True)
print(completed.stdout[-1500:])
result_dir=OUTPUT/'toy'
for filename in ['tfopt_results.xlsx','multistart_summary.csv','multistart_params.npz','report.html','diagnostics.json']:
assert (result_dir/filename).is_file(),filename
display(pd.read_excel(result_dir/'tfopt_results.xlsx',sheet_name='Optimization Results'))
| Metric | Value | |
|---|---|---|
| 0 | Objective Value | 0.0 |
| 1 | SSE | 0.0 |
| 2 | MSE | 0.0 |
| 3 | RMSE | 0.0 |
| 4 | MAE | 0.0 |
| 5 | MAPE | 0.000001 |
| 6 | R^2 | 1.0 |
| 7 | Prediction transform | clip |
| 8 | Method | lbfgsb |
| 9 | Targets with a negative prediction | 0 |
Interpretation
Check both fit and feasibility. For biological data, identifiability, scaling and regulatory coverage need domain review. Results and figures belong only in notebooks/outputs/.