mioXpektron.baseline.baseline_eval

Classes

BaselineMethodEvaluator([files, methods, ...])

Evaluate baseline algorithms on ToF‑SIMS files supplied as paths or globs.

class mioXpektron.baseline.baseline_eval.BaselineMethodEvaluator(files=<factory>, methods=None, param_grid=None, use_small_param_preset=False, auto_scale_window_size=True, eval_clip_negative=False, topk_for_snr=5, raw_noise_quantile=0.2, flat_windows=None, metrics_for_composite=('rfzn', 'nar', 'snr', 'bbi', 'br', 'nbc'), n_jobs=-1)[source]

Bases: object

Evaluate baseline algorithms on ToF‑SIMS files supplied as paths or globs.

Parameters:
files: List[str | Path]
methods: List[str] | None = None
param_grid: Dict[str, List[Dict]] | None = None
use_small_param_preset: bool = False
auto_scale_window_size: bool = True
eval_clip_negative: bool = False
topk_for_snr: int = 5
raw_noise_quantile: float = 0.2
flat_windows: List[Tuple[float, float]] | None = None
metrics_for_composite: Tuple[str, ...] = ('rfzn', 'nar', 'snr', 'bbi', 'br', 'nbc')
n_jobs: int = -1
labels: List[str]
specs: List[Tuple[str, Dict]]
evaluate(noise_quantile=None, n_jobs=None)[source]
Parameters:
  • noise_quantile (float | None)

  • n_jobs (int | None)

warning_log()[source]
Return type:

DataFrame

plot(out_dir='baseline_selection_output')[source]
Parameters:

out_dir (str | Path)

Return type:

List[Path]

preview_overlay(file, methods=None, max_methods=5, save_to='baseline_selection_output', show_errors=True)[source]

Plot raw, baseline and corrected overlays for a few methods on a single file.

Parameters:
  • file (str or Path) – Path to a single spectrum file (not a list!)

  • methods (list of str, optional) – Method names to plot. If None, uses top methods from evaluation.

  • max_methods (int) – Maximum number of methods to plot (default: 5)

  • save_to (str or Path, optional) – Directory to save plots. Set to None to skip saving.

  • show_errors (bool) – If True (default), print errors when methods fail instead of silently ignoring them.