ctf4science.eval_module#

Evaluation Module for CTF models, provides evaluation metrics and routines for CTF datasets.

This module handles evaluation of CTF models against a hidden test set. It also assesses model stability by running models multiple times with different random seeds.

Functions

compute_log_psd(array, k, modes)

Compute the natural log of the averaged PSD over the last k time steps.

compute_psd(array, k, modes)

Compute the averaged power spectral density over the last k time steps for the given modes.

evaluate(dataset_name, pair_id, prediction)

Evaluate the prediction using specified metrics; ground truth is loaded internally.

evaluate_custom(dataset_name, pair_id, ...)

Evaluate the prediction against a provided truth array using specified metrics.

evaluate_kaggle_csv(csv_path, dataset_name)

Evaluate the predictions from a Kaggle CSV file.

extract_metrics_in_order(dataset_name, ...)

Extract metric values from batch results in the order defined by the dataset config.

long_time_forecast_dynamical(truth, ...)

Compute the long-time forecast score for dynamical systems (histogram-based).

long_time_forecast_spatio_temporal(truth, ...)

Compute the long-time forecast score for spatio-temporal systems (spectral).

reconstruction(truth, prediction)

Compute the reconstruction score (relative L2 over full trajectory, as percentage).

save_results(dataset_name, method_name, ...)

Save configuration, predictions, and optional evaluation results for a run.

short_time_forecast(truth, prediction, k)

Compute the short-time forecast score (relative L2 over first k steps, as percentage).