Metadata-Version: 2.4
Name: UC_AutoMaiL
Version: 0.4.1a2
Summary: Compare machine learning models and report uncertainty in their evaluation
License-Expression: MIT
Project-URL: Repository, https://github.com/okamasaya/DIY_AutoML
Project-URL: Documentation, https://github.com/okamasaya/DIY_AutoML/blob/main/README.en.md
Project-URL: Issues, https://github.com/okamasaya/DIY_AutoML/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2
Requires-Dist: pandas>=2.2
Requires-Dist: scipy>=1.14
Requires-Dist: scikit-learn>=1.6
Requires-Dist: threadpoolctl>=3.2
Requires-Dist: openpyxl>=3.1
Requires-Dist: matplotlib>=3.9
Provides-Extra: dl
Requires-Dist: tensorflow-cpu==2.20.0; sys_platform != "darwin" and extra == "dl"
Requires-Dist: tensorflow==2.20.0; sys_platform == "darwin" and extra == "dl"
Requires-Dist: keras==3.15.1; extra == "dl"
Provides-Extra: dl-torch
Requires-Dist: torch==2.14.0; extra == "dl-torch"
Provides-Extra: dl-both
Requires-Dist: tensorflow-cpu==2.20.0; sys_platform != "darwin" and extra == "dl-both"
Requires-Dist: tensorflow==2.20.0; sys_platform == "darwin" and extra == "dl-both"
Requires-Dist: keras==3.15.1; extra == "dl-both"
Requires-Dist: torch==2.14.0; extra == "dl-both"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Provides-Extra: notebook
Requires-Dist: ipykernel>=6; extra == "notebook"
Requires-Dist: nbclient>=0.10; extra == "notebook"
Requires-Dist: nbformat>=5; extra == "notebook"
Provides-Extra: storage
Requires-Dist: duckdb<2,>=1.4; extra == "storage"
Requires-Dist: pyarrow>=18; extra == "storage"
Dynamic: license-file

# UC_AutoMaiL

UC_AutoMaiL is a Python package for comparing machine learning models and evaluating the uncertainty of their scores. It started as DIY AutoML. It saves data checks, evaluation splits, model selection, predictions, held-out scores, and their uncertainty in files you can inspect after a run.

## Try the alpha

Use Python 3.12 or later and activate a fresh virtual environment. Place the `0.4.1a2` wheel in your working directory and install it with dependencies from PyPI. [Wheel, release notes, and TestPyPI instructions](https://github.com/okamasaya/DIY_AutoML/blob/main/PyPI/README.md)

```sh
python -m pip --isolated install --index-url https://pypi.org/simple/ ./uc_automail-0.4.1a2-py3-none-any.whl
python -m pip check
uc-automail --version
uc-automail --help
```

Import the public Python API as `uc_automail`.

```python
import uc_automail as uc_al

print(uc_al.__version__)
```

To try classification, download the [Iris sample CSV](https://raw.githubusercontent.com/okamasaya/DIY_AutoML/main/data/reference/iris.csv) and save it as `iris.csv`.

```sh
uc-automail audit-data --csv iris.csv --target target --output runs/iris-audit
uc-automail select --csv iris.csv --target target --progress both --output runs/iris-select
uc-automail report --run runs/iris-select --charts detail --output runs/iris-report
```

Open `runs/iris-report/report_with_figures.xlsx` for the comparison, held-out scores, and charts of cross-validation scores and progress. The `Progress` sheet and `progress.jsonl` retain events from model selection. `arrays.npz` stores the splits and predictions, and `manifest.json` records the settings and file hashes. Choose new output paths when repeating commands.

For supervised classification, `select` accepts per-model tree depth limits such as `--decision-tree-max-depth 3` and CPU controls such as `--cpu-threads 2 --forest-jobs 2`. To prepare a smaller dataset, `extract-data --source iris.csv --recipe columns.json --output runs/iris-extract` reads an ordered `columns` array and an optional `format` from JSON. CSV is the default. Install `uc-automail[storage]` for Parquet and DuckDB input or output.

The base install includes tabular evaluation, Excel reports, state estimation, and graph node classification. The `storage` extra adds Parquet and DuckDB support. Use the `dl` extra for TensorFlow, `dl-torch` for PyTorch, or `dl-both` to compare them with `uc-automail compare-dl-backends`. The Japanese Windows preview uses Tcl/Tk and a desktop display.

## Backtest a time series

Compare several forecast steps over chronological holdouts. This example uses a synthetic series with a four-observation cycle.

```python
import numpy as np
import pandas as pd
import uc_automail as uc_al

values = np.tile([10., 20., 30., 40.], 40)
pd.DataFrame({"step": np.arange(len(values)), "value": values}).to_csv("series.csv", index=False)
output = uc_al.backtest_horizons_csv(
    "series.csv", "runs/series-demo",
    time_column="step", value_column="value",
    horizons=(1, 3, 5), window_rows=24, windows=3,
    models=("seasonal", "kalman"), season_length=4,
    interval_method="adaptive", selection_tolerance=0.02,
)
print(output / "report.xlsx")
```

`Aggregate` reports RMSE, empirical coverage, and mean interval width by forecast step. With `interval_method="adaptive"`, `Interval_Evidence` records the completed forecast paths used for calibration. `selection_tolerance=0.02` adds the `Selection_Band` sheet with a 2% relative RMSE tolerance, the retained candidates, and the selected model. Coverage changed in both directions in the release benchmarks. [Time-series reference and evaluation results](https://github.com/okamasaya/DIY_AutoML/blob/main/docs/SERIES_FORECAST.md)

## State estimation and coordinates

For streaming observations, construct an EKF once and pass one observation vector at a time. This example uses a one-dimensional state and a known increment at each step.

```python
import uc_automail as uc_al

settings = dict(
    initial_mean=[0.0], initial_covariance=[[1.0]],
    transition=lambda state, step, control: state + control,
    transition_jacobian=lambda state, step, control: [[1.0]],
    measurement=lambda state, step: state,
    measurement_jacobian=lambda state, step: [[1.0]],
    process_covariance=[[0.01]], observation_covariance=[[0.1]],
)
observations = [[1.1], [2.0], [float("nan")], [3.9]]
tracker = uc_al.ExtendedKalmanFilter(**settings)
for observation in observations:
    estimate = tracker.step(observation, control=1.0)
    print(estimate["filtered"])

batch = uc_al.extended_kalman_filter(observations, controls=[1.0] * len(observations), **settings)
diagnostics = uc_al.filter_diagnostics(batch, observations, max_lag=2)
print(diagnostics["autocorrelation_pairs"], diagnostics["ljung_box_status"])
```

`filter_diagnostics` accepts either EKF or UKF batch output. It reports the normalized innovation, NIS, autocorrelations and a per-channel Ljung–Box status. The white-noise reference band and the lags outside it are given for complete channels with varying innovations. When the true state is available, `uc_al.evaluate_filter_consistency(truth, result)` returns pull summaries and NEES. Reported covariance reflects the transition and measurement models and the supplied noise covariances. [State-estimation guide](https://github.com/okamasaya/DIY_AutoML/blob/main/docs/UNCERTAINTY_DESIGN.md)

`uc_automail.physics` provides geodetic, ECEF, and ENU coordinate transforms and a weighted least-squares pseudorange solver.

```python
from uc_automail import physics

reference = [36.1, 140.08, 45.0]  # latitude and longitude in degrees, ellipsoidal height in meters
ecef_m = physics.geodetic_to_ecef(reference, ellipsoid=physics.GRS80)
print(physics.ecef_to_geodetic(ecef_m, ellipsoid=physics.GRS80))
```

Existing DIY AutoML examples can still use the `diy_automl` import and the `diy-automl` command. The UC_AutoMaiL Python package is available under the MIT License. [License and scope](https://github.com/okamasaya/DIY_AutoML/blob/main/LICENSE)

[English documentation](https://github.com/okamasaya/DIY_AutoML/blob/main/README.en.md) · [Iris walkthrough](https://dev.to/masaya_oka/audit-an-iris-csv-before-ranking-five-classifiers-457) · [Forecasting examples](https://dev.to/masaya_oka/when-should-you-keep-a-kalman-filter-three-forecasting-checks-a64) · [Report an issue](https://github.com/okamasaya/DIY_AutoML/issues)
