Validation metrics and plots for machine learning models, with a focus on earth observation and climate science.
Project description
aule
aule provides validation metrics and plots for machine learning model outputs, with a focus on earth observation and climate science use cases (gridded fields, ensembles, multi-temporal data).
Named after Aulë, the Vala of craft in Tolkien's mythology — the one who forges and evaluates the work of his own hands.
Supported input shapes
Every function accepts numpy arrays in one of four shapes:
(batch, H, W, C)(batch, H, W, C, T)(H, W, C)(H, W, C, T)
When an array is 4D, pass data_format="bhwc" (default) or data_format="hwct"
to disambiguate, since the two shapes cannot be told apart from shape alone.
Installation
pip install aule
# with cartopy support for geographic basemaps
pip install aule[geo]
Quick example
import numpy as np
from aule.metrics import rmse, mae, pearson_r, ssim
from aule.plots import plot_field_comparison, plot_scatter
gt = np.random.rand(64, 64, 1)
pred = gt + np.random.normal(0, 0.1, gt.shape)
print(rmse(gt, pred))
print(pearson_r(gt, pred))
fig, axes = plot_field_comparison(gt, pred)
fig, ax = plot_scatter(gt, pred, save_path="scatter.png")
What's included
Metrics are organized by family in aule.metrics, all importable directly from aule.metrics:
- core:
rmse,mse,mae,bias,pearson_r,ssim,psnr,r2_score,mape,smape,nse,kge,max_error,explained_variance - spectral:
spectral_error,gradient_error,psd_radial_error,spectral_angle_mapper - climate:
seasonal_error,percentile_error,pixelwise_temporal_correlation,trend_error,extreme_event_duration_error,autocorrelation_error - ensemble:
ensemble_spread,crps,rank_histogram,brier_score,spread_skill_ratio,crps_skill_score - earth_observation:
normalized_difference_index,index_error,change_detection_error - classification:
iou,dice,precision_recall_f1,confusion_matrix_metrics,cohen_kappa(binary or multi-class, viaaverage/num_classes) - uncertainty:
picp,pit_histogram
Plots are organized similarly in aule.plots:
- core:
plot_scatter,plot_qq,plot_histogram_comparison,plot_error_histogram - spatial:
plot_field_comparison,plot_bias_map,plot_correlation_map(optional cartopy basemap vialat/lon) - climate:
plot_temporal_trend,plot_temporal_scatter - ensemble:
plot_ensemble_spread_map,plot_rank_histogram - diagnostics:
plot_taylor_diagram,plot_boxplot_comparison,plot_violin_comparison,plot_time_series,plot_error_map - classification:
plot_confusion_matrix,plot_reliability_diagram
Object-oriented usage
Every metric and plot is also available as a method on the aule class,
which binds y_true/y_pred (and optionally data_format/ignore_nan)
once. New functions added to aule.metrics or aule.plots are picked up
automatically, no extra wiring needed.
from aule import aule
v = aule(gt, pred)
print(v.rmse())
print(v.pearson_r())
fig, ax = v.plot_scatter(save_path="scatter.png")
Notebooks
The notebooks/ folder contains worked examples for every metric and plot
family, each runnable end-to-end:
01_core_metrics.ipynb02_spectral_and_earth_observation_metrics.ipynb03_climate_metrics.ipynb04_ensemble_and_uncertainty_metrics.ipynb05_classification_metrics.ipynb06_plots.ipynb07_aule_class.ipynb
Documentation
The documentation is produced using pdoc.
python build_doc.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aule-0.0.3.tar.gz.
File metadata
- Download URL: aule-0.0.3.tar.gz
- Upload date:
- Size: 42.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c2be91f5ccfe4f131add9003df07d912e31184f985364079b8163b6d61cf932
|
|
| MD5 |
05c7cbcd20cc021c86ed4108f7450998
|
|
| BLAKE2b-256 |
c97a19ef84fc6063c4e95979f7bae9934d324b031e46bc95e37bf0905f3d6c9a
|
File details
Details for the file aule-0.0.3-py3-none-any.whl.
File metadata
- Download URL: aule-0.0.3-py3-none-any.whl
- Upload date:
- Size: 47.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acbb4b6fbe59c9adc0bc24840d58b227bb1350180e789efabb4e7bd6c0181937
|
|
| MD5 |
b83f6a75d625fd1538e2f571a4d59f38
|
|
| BLAKE2b-256 |
99fd057f551de15bb0557dad9959087d6c95ac16f9d80f7f71c5d1bff2c88487
|