UC-AutoMaiL 0.4.1a2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uc_automail-0.4.1a2/LICENSE +25 -0
- uc_automail-0.4.1a2/MANIFEST.in +2 -0
- uc_automail-0.4.1a2/PKG-INFO +146 -0
- uc_automail-0.4.1a2/PyPI/README.pypi.md +101 -0
- uc_automail-0.4.1a2/README.md +232 -0
- uc_automail-0.4.1a2/pyproject.toml +52 -0
- uc_automail-0.4.1a2/setup.cfg +4 -0
- uc_automail-0.4.1a2/src/UC_AutoMaiL.egg-info/PKG-INFO +146 -0
- uc_automail-0.4.1a2/src/UC_AutoMaiL.egg-info/SOURCES.txt +97 -0
- uc_automail-0.4.1a2/src/UC_AutoMaiL.egg-info/dependency_links.txt +1 -0
- uc_automail-0.4.1a2/src/UC_AutoMaiL.egg-info/entry_points.txt +3 -0
- uc_automail-0.4.1a2/src/UC_AutoMaiL.egg-info/requires.txt +42 -0
- uc_automail-0.4.1a2/src/UC_AutoMaiL.egg-info/top_level.txt +2 -0
- uc_automail-0.4.1a2/src/diy_automl/__init__.py +90 -0
- uc_automail-0.4.1a2/src/diy_automl/__main__.py +2 -0
- uc_automail-0.4.1a2/src/diy_automl/_graph_network.py +50 -0
- uc_automail-0.4.1a2/src/diy_automl/annealing.py +116 -0
- uc_automail-0.4.1a2/src/diy_automl/annealing_validation.py +113 -0
- uc_automail-0.4.1a2/src/diy_automl/annealing_workflow.py +275 -0
- uc_automail-0.4.1a2/src/diy_automl/bp_charts.py +130 -0
- uc_automail-0.4.1a2/src/diy_automl/bp_evaluation.py +260 -0
- uc_automail-0.4.1a2/src/diy_automl/bp_neural.py +83 -0
- uc_automail-0.4.1a2/src/diy_automl/bp_preview.py +714 -0
- uc_automail-0.4.1a2/src/diy_automl/bp_results.py +122 -0
- uc_automail-0.4.1a2/src/diy_automl/calendar_comparison.py +89 -0
- uc_automail-0.4.1a2/src/diy_automl/chronological_selection.py +51 -0
- uc_automail-0.4.1a2/src/diy_automl/cli.py +304 -0
- uc_automail-0.4.1a2/src/diy_automl/clustering.py +56 -0
- uc_automail-0.4.1a2/src/diy_automl/clustering_repeat_workflow.py +22 -0
- uc_automail-0.4.1a2/src/diy_automl/clustering_repeated.py +58 -0
- uc_automail-0.4.1a2/src/diy_automl/clustering_subsample.py +104 -0
- uc_automail-0.4.1a2/src/diy_automl/clustering_subsample_workflow.py +152 -0
- uc_automail-0.4.1a2/src/diy_automl/data.py +103 -0
- uc_automail-0.4.1a2/src/diy_automl/data_audit.py +263 -0
- uc_automail-0.4.1a2/src/diy_automl/data_audit_validation.py +115 -0
- uc_automail-0.4.1a2/src/diy_automl/data_conversion.py +212 -0
- uc_automail-0.4.1a2/src/diy_automl/data_extract.py +298 -0
- uc_automail-0.4.1a2/src/diy_automl/data_extract_validation.py +74 -0
- uc_automail-0.4.1a2/src/diy_automl/data_profile.py +317 -0
- uc_automail-0.4.1a2/src/diy_automl/deep_learning.py +65 -0
- uc_automail-0.4.1a2/src/diy_automl/deep_learning_repeat_workflow.py +114 -0
- uc_automail-0.4.1a2/src/diy_automl/dl_backend_comparison.py +216 -0
- uc_automail-0.4.1a2/src/diy_automl/dl_backend_worker.py +102 -0
- uc_automail-0.4.1a2/src/diy_automl/dl_contract.py +98 -0
- uc_automail-0.4.1a2/src/diy_automl/dl_repeat_validation.py +118 -0
- uc_automail-0.4.1a2/src/diy_automl/ekf_benchmark.py +246 -0
- uc_automail-0.4.1a2/src/diy_automl/excel_report.py +150 -0
- uc_automail-0.4.1a2/src/diy_automl/excel_report_validation.py +95 -0
- uc_automail-0.4.1a2/src/diy_automl/extended_kalman.py +139 -0
- uc_automail-0.4.1a2/src/diy_automl/graph_classification.py +226 -0
- uc_automail-0.4.1a2/src/diy_automl/grouped_selection.py +33 -0
- uc_automail-0.4.1a2/src/diy_automl/kalman.py +101 -0
- uc_automail-0.4.1a2/src/diy_automl/kalman_diagnostics.py +159 -0
- uc_automail-0.4.1a2/src/diy_automl/kalman_validation.py +32 -0
- uc_automail-0.4.1a2/src/diy_automl/kalman_workflow.py +182 -0
- uc_automail-0.4.1a2/src/diy_automl/kinematic_fit.py +103 -0
- uc_automail-0.4.1a2/src/diy_automl/local_level.py +37 -0
- uc_automail-0.4.1a2/src/diy_automl/local_level_check.py +73 -0
- uc_automail-0.4.1a2/src/diy_automl/longitudinal_feedback.py +275 -0
- uc_automail-0.4.1a2/src/diy_automl/metric_uncertainty.py +129 -0
- uc_automail-0.4.1a2/src/diy_automl/particle_filter.py +136 -0
- uc_automail-0.4.1a2/src/diy_automl/physics/__init__.py +23 -0
- uc_automail-0.4.1a2/src/diy_automl/physics/coordinates.py +102 -0
- uc_automail-0.4.1a2/src/diy_automl/physics/gnss.py +91 -0
- uc_automail-0.4.1a2/src/diy_automl/plotting.py +34 -0
- uc_automail-0.4.1a2/src/diy_automl/pytorch_backend.py +111 -0
- uc_automail-0.4.1a2/src/diy_automl/report_figures.py +314 -0
- uc_automail-0.4.1a2/src/diy_automl/reporting.py +71 -0
- uc_automail-0.4.1a2/src/diy_automl/run_progress.py +82 -0
- uc_automail-0.4.1a2/src/diy_automl/selection.py +65 -0
- uc_automail-0.4.1a2/src/diy_automl/selection_workflow.py +146 -0
- uc_automail-0.4.1a2/src/diy_automl/series_backtest.py +123 -0
- uc_automail-0.4.1a2/src/diy_automl/series_backtest_workflow.py +235 -0
- uc_automail-0.4.1a2/src/diy_automl/series_forecast.py +235 -0
- uc_automail-0.4.1a2/src/diy_automl/series_forecast_workflow.py +155 -0
- uc_automail-0.4.1a2/src/diy_automl/series_horizon_policy.py +71 -0
- uc_automail-0.4.1a2/src/diy_automl/series_horizons.py +145 -0
- uc_automail-0.4.1a2/src/diy_automl/series_horizons_workflow.py +137 -0
- uc_automail-0.4.1a2/src/diy_automl/series_lags.py +49 -0
- uc_automail-0.4.1a2/src/diy_automl/sl_compute.py +45 -0
- uc_automail-0.4.1a2/src/diy_automl/sl_ranking.py +319 -0
- uc_automail-0.4.1a2/src/diy_automl/sl_ranking_validation.py +87 -0
- uc_automail-0.4.1a2/src/diy_automl/sl_uncertainty_audit.py +225 -0
- uc_automail-0.4.1a2/src/diy_automl/sl_uncertainty_audit_validation.py +85 -0
- uc_automail-0.4.1a2/src/diy_automl/state_space.py +71 -0
- uc_automail-0.4.1a2/src/diy_automl/supervised.py +86 -0
- uc_automail-0.4.1a2/src/diy_automl/tensorflow_backend.py +73 -0
- uc_automail-0.4.1a2/src/diy_automl/tuning.py +137 -0
- uc_automail-0.4.1a2/src/diy_automl/tuning_validation.py +124 -0
- uc_automail-0.4.1a2/src/diy_automl/tuning_workflow.py +109 -0
- uc_automail-0.4.1a2/src/diy_automl/ul_subsample_validation.py +168 -0
- uc_automail-0.4.1a2/src/diy_automl/uncertainty_validation.py +78 -0
- uc_automail-0.4.1a2/src/diy_automl/uncertainty_workflow.py +239 -0
- uc_automail-0.4.1a2/src/diy_automl/unscented_kalman.py +76 -0
- uc_automail-0.4.1a2/src/diy_automl/validation.py +222 -0
- uc_automail-0.4.1a2/src/diy_automl/workflow.py +76 -0
- uc_automail-0.4.1a2/src/uc_automail/__init__.py +19 -0
- uc_automail-0.4.1a2/src/uc_automail/__main__.py +5 -0
- uc_automail-0.4.1a2/src/uc_automail/physics/__init__.py +13 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
This license applies to the project-authored Python code under src/diy_automl/
|
|
2
|
+
and src/uc_automail/, and the project-authored packaging files distributed
|
|
3
|
+
with UC_AutoMaiL.
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 okamasaya and DIY AutoML contributors
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: UC_AutoMaiL
|
|
3
|
+
Version: 0.4.1a2
|
|
4
|
+
Summary: Compare machine learning models and report uncertainty in their evaluation
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/okamasaya/DIY_AutoML
|
|
7
|
+
Project-URL: Documentation, https://github.com/okamasaya/DIY_AutoML/blob/main/README.en.md
|
|
8
|
+
Project-URL: Issues, https://github.com/okamasaya/DIY_AutoML/issues
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Requires-Python: >=3.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: numpy>=2
|
|
17
|
+
Requires-Dist: pandas>=2.2
|
|
18
|
+
Requires-Dist: scipy>=1.14
|
|
19
|
+
Requires-Dist: scikit-learn>=1.6
|
|
20
|
+
Requires-Dist: threadpoolctl>=3.2
|
|
21
|
+
Requires-Dist: openpyxl>=3.1
|
|
22
|
+
Requires-Dist: matplotlib>=3.9
|
|
23
|
+
Provides-Extra: dl
|
|
24
|
+
Requires-Dist: tensorflow-cpu==2.20.0; sys_platform != "darwin" and extra == "dl"
|
|
25
|
+
Requires-Dist: tensorflow==2.20.0; sys_platform == "darwin" and extra == "dl"
|
|
26
|
+
Requires-Dist: keras==3.15.1; extra == "dl"
|
|
27
|
+
Provides-Extra: dl-torch
|
|
28
|
+
Requires-Dist: torch==2.14.0; extra == "dl-torch"
|
|
29
|
+
Provides-Extra: dl-both
|
|
30
|
+
Requires-Dist: tensorflow-cpu==2.20.0; sys_platform != "darwin" and extra == "dl-both"
|
|
31
|
+
Requires-Dist: tensorflow==2.20.0; sys_platform == "darwin" and extra == "dl-both"
|
|
32
|
+
Requires-Dist: keras==3.15.1; extra == "dl-both"
|
|
33
|
+
Requires-Dist: torch==2.14.0; extra == "dl-both"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest; extra == "dev"
|
|
36
|
+
Requires-Dist: build; extra == "dev"
|
|
37
|
+
Provides-Extra: notebook
|
|
38
|
+
Requires-Dist: ipykernel>=6; extra == "notebook"
|
|
39
|
+
Requires-Dist: nbclient>=0.10; extra == "notebook"
|
|
40
|
+
Requires-Dist: nbformat>=5; extra == "notebook"
|
|
41
|
+
Provides-Extra: storage
|
|
42
|
+
Requires-Dist: duckdb<2,>=1.4; extra == "storage"
|
|
43
|
+
Requires-Dist: pyarrow>=18; extra == "storage"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# UC_AutoMaiL
|
|
47
|
+
|
|
48
|
+
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.
|
|
49
|
+
|
|
50
|
+
## Try the alpha
|
|
51
|
+
|
|
52
|
+
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)
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
python -m pip --isolated install --index-url https://pypi.org/simple/ ./uc_automail-0.4.1a2-py3-none-any.whl
|
|
56
|
+
python -m pip check
|
|
57
|
+
uc-automail --version
|
|
58
|
+
uc-automail --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Import the public Python API as `uc_automail`.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import uc_automail as uc_al
|
|
65
|
+
|
|
66
|
+
print(uc_al.__version__)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
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`.
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
uc-automail audit-data --csv iris.csv --target target --output runs/iris-audit
|
|
73
|
+
uc-automail select --csv iris.csv --target target --progress both --output runs/iris-select
|
|
74
|
+
uc-automail report --run runs/iris-select --charts detail --output runs/iris-report
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
|
|
81
|
+
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.
|
|
82
|
+
|
|
83
|
+
## Backtest a time series
|
|
84
|
+
|
|
85
|
+
Compare several forecast steps over chronological holdouts. This example uses a synthetic series with a four-observation cycle.
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
import numpy as np
|
|
89
|
+
import pandas as pd
|
|
90
|
+
import uc_automail as uc_al
|
|
91
|
+
|
|
92
|
+
values = np.tile([10., 20., 30., 40.], 40)
|
|
93
|
+
pd.DataFrame({"step": np.arange(len(values)), "value": values}).to_csv("series.csv", index=False)
|
|
94
|
+
output = uc_al.backtest_horizons_csv(
|
|
95
|
+
"series.csv", "runs/series-demo",
|
|
96
|
+
time_column="step", value_column="value",
|
|
97
|
+
horizons=(1, 3, 5), window_rows=24, windows=3,
|
|
98
|
+
models=("seasonal", "kalman"), season_length=4,
|
|
99
|
+
interval_method="adaptive", selection_tolerance=0.02,
|
|
100
|
+
)
|
|
101
|
+
print(output / "report.xlsx")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`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)
|
|
105
|
+
|
|
106
|
+
## State estimation and coordinates
|
|
107
|
+
|
|
108
|
+
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.
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
import uc_automail as uc_al
|
|
112
|
+
|
|
113
|
+
settings = dict(
|
|
114
|
+
initial_mean=[0.0], initial_covariance=[[1.0]],
|
|
115
|
+
transition=lambda state, step, control: state + control,
|
|
116
|
+
transition_jacobian=lambda state, step, control: [[1.0]],
|
|
117
|
+
measurement=lambda state, step: state,
|
|
118
|
+
measurement_jacobian=lambda state, step: [[1.0]],
|
|
119
|
+
process_covariance=[[0.01]], observation_covariance=[[0.1]],
|
|
120
|
+
)
|
|
121
|
+
observations = [[1.1], [2.0], [float("nan")], [3.9]]
|
|
122
|
+
tracker = uc_al.ExtendedKalmanFilter(**settings)
|
|
123
|
+
for observation in observations:
|
|
124
|
+
estimate = tracker.step(observation, control=1.0)
|
|
125
|
+
print(estimate["filtered"])
|
|
126
|
+
|
|
127
|
+
batch = uc_al.extended_kalman_filter(observations, controls=[1.0] * len(observations), **settings)
|
|
128
|
+
diagnostics = uc_al.filter_diagnostics(batch, observations, max_lag=2)
|
|
129
|
+
print(diagnostics["autocorrelation_pairs"], diagnostics["ljung_box_status"])
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`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)
|
|
133
|
+
|
|
134
|
+
`uc_automail.physics` provides geodetic, ECEF, and ENU coordinate transforms and a weighted least-squares pseudorange solver.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from uc_automail import physics
|
|
138
|
+
|
|
139
|
+
reference = [36.1, 140.08, 45.0] # latitude and longitude in degrees, ellipsoidal height in meters
|
|
140
|
+
ecef_m = physics.geodetic_to_ecef(reference, ellipsoid=physics.GRS80)
|
|
141
|
+
print(physics.ecef_to_geodetic(ecef_m, ellipsoid=physics.GRS80))
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
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)
|
|
145
|
+
|
|
146
|
+
[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)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# UC_AutoMaiL
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Try the alpha
|
|
6
|
+
|
|
7
|
+
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)
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
python -m pip --isolated install --index-url https://pypi.org/simple/ ./uc_automail-0.4.1a2-py3-none-any.whl
|
|
11
|
+
python -m pip check
|
|
12
|
+
uc-automail --version
|
|
13
|
+
uc-automail --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Import the public Python API as `uc_automail`.
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
import uc_automail as uc_al
|
|
20
|
+
|
|
21
|
+
print(uc_al.__version__)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
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`.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
uc-automail audit-data --csv iris.csv --target target --output runs/iris-audit
|
|
28
|
+
uc-automail select --csv iris.csv --target target --progress both --output runs/iris-select
|
|
29
|
+
uc-automail report --run runs/iris-select --charts detail --output runs/iris-report
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
## Backtest a time series
|
|
39
|
+
|
|
40
|
+
Compare several forecast steps over chronological holdouts. This example uses a synthetic series with a four-observation cycle.
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import numpy as np
|
|
44
|
+
import pandas as pd
|
|
45
|
+
import uc_automail as uc_al
|
|
46
|
+
|
|
47
|
+
values = np.tile([10., 20., 30., 40.], 40)
|
|
48
|
+
pd.DataFrame({"step": np.arange(len(values)), "value": values}).to_csv("series.csv", index=False)
|
|
49
|
+
output = uc_al.backtest_horizons_csv(
|
|
50
|
+
"series.csv", "runs/series-demo",
|
|
51
|
+
time_column="step", value_column="value",
|
|
52
|
+
horizons=(1, 3, 5), window_rows=24, windows=3,
|
|
53
|
+
models=("seasonal", "kalman"), season_length=4,
|
|
54
|
+
interval_method="adaptive", selection_tolerance=0.02,
|
|
55
|
+
)
|
|
56
|
+
print(output / "report.xlsx")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`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)
|
|
60
|
+
|
|
61
|
+
## State estimation and coordinates
|
|
62
|
+
|
|
63
|
+
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.
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
import uc_automail as uc_al
|
|
67
|
+
|
|
68
|
+
settings = dict(
|
|
69
|
+
initial_mean=[0.0], initial_covariance=[[1.0]],
|
|
70
|
+
transition=lambda state, step, control: state + control,
|
|
71
|
+
transition_jacobian=lambda state, step, control: [[1.0]],
|
|
72
|
+
measurement=lambda state, step: state,
|
|
73
|
+
measurement_jacobian=lambda state, step: [[1.0]],
|
|
74
|
+
process_covariance=[[0.01]], observation_covariance=[[0.1]],
|
|
75
|
+
)
|
|
76
|
+
observations = [[1.1], [2.0], [float("nan")], [3.9]]
|
|
77
|
+
tracker = uc_al.ExtendedKalmanFilter(**settings)
|
|
78
|
+
for observation in observations:
|
|
79
|
+
estimate = tracker.step(observation, control=1.0)
|
|
80
|
+
print(estimate["filtered"])
|
|
81
|
+
|
|
82
|
+
batch = uc_al.extended_kalman_filter(observations, controls=[1.0] * len(observations), **settings)
|
|
83
|
+
diagnostics = uc_al.filter_diagnostics(batch, observations, max_lag=2)
|
|
84
|
+
print(diagnostics["autocorrelation_pairs"], diagnostics["ljung_box_status"])
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`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)
|
|
88
|
+
|
|
89
|
+
`uc_automail.physics` provides geodetic, ECEF, and ENU coordinate transforms and a weighted least-squares pseudorange solver.
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from uc_automail import physics
|
|
93
|
+
|
|
94
|
+
reference = [36.1, 140.08, 45.0] # latitude and longitude in degrees, ellipsoidal height in meters
|
|
95
|
+
ecef_m = physics.geodetic_to_ecef(reference, ellipsoid=physics.GRS80)
|
|
96
|
+
print(physics.ecef_to_geodetic(ecef_m, ellipsoid=physics.GRS80))
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
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)
|
|
100
|
+
|
|
101
|
+
[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)
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# UC_AutoMaiL
|
|
2
|
+
|
|
3
|
+
[English overview](README.en.md)
|
|
4
|
+
|
|
5
|
+
UC_AutoMaiL(旧DIY AutoML)は、機械学習モデルを比較し、評価値の不確かさを調べるPythonパッケージです。名前の `UC` は開発の出発点である不確かさ(Uncertainty)に由来します。配布名とCLIは `uc-automail` です。 [α版の試用手順](PyPI/TRIAL.md)
|
|
6
|
+
|
|
7
|
+
旧クラウド環境の0.4.0a1ソースは未取得です。このリポジトリは元資料ZIPと引継ぎ仕様から新たに実装しました。初回再実装は **0.4.0a1.post1**、DL反復は **0.4.0a2**、UL部分抽出は **0.4.0a3**、SL設定探索は **0.4.0a4**、図付きExcelは **0.4.0a5**、評価値の誤差評価は **0.4.0a6**、DLバックエンド追加の準備は **0.4.0a7**、分類・状態推定・GCNを収めた配布試用版は **0.4.0a8** です。旧実装とのAPI・数値・manifest互換性は保証していません。schema番号2/3/4は引継ぎの用途区分を採用したもので、旧validatorとの互換を意味しません。過去の96 passedは今回の検証結果ではありません。
|
|
8
|
+
|
|
9
|
+
Python 3.12、数値特徴量・欠損なし・分類ラベル付きCSVが対象です。ULも外部診断のためtarget列が必要です。元資料は `originals/` に変更せず保存しています。
|
|
10
|
+
|
|
11
|
+
Pythonパッケージの自作コードと配布用ファイルはMITライセンスです。同梱サンプルの出典・利用条件はデータごとの記録を参照してください。 [ライセンスと適用範囲](LICENSE) · [サンプルデータの出典と利用条件](data/reference/README.md)
|
|
12
|
+
|
|
13
|
+
主目的は、MLの結果に誤差評価を含め、データ量・品質・学習の不安定さについて議論できる材料を残すことです。現状は固定モデルに条件付きのtest区間と一部の反復を実装しています。データ量に対する学習曲線、再学習・選定をやり直す変動、グループ/時間の評価は今後で、区間幅だけから量不足や品質不良を自動判定する機能ではありません。目的と優先順は `docs/UNCERTAINTY_DESIGN.md` に記録しています。
|
|
14
|
+
|
|
15
|
+
0.4.0a6の`uncertainty`は保存済みSL/DLの4指標とクラス別指標へbootstrap SE・percentile区間を付け、図付きExcelを別出力します。クラス件数固定/通常の2方式を選べます。元の学習結果は変更せず、学習・選定のやり直しや系統誤差まで評価した意味ではありません。使い方は[評価値の誤差評価](docs/METRIC_UNCERTAINTY_GUIDE.md)です。
|
|
16
|
+
|
|
17
|
+
定量化した指標を用途に合うモデル選定へつなぎ、DS以外にも拾えた件数・見逃し・誤案内と限界を説明できる構成を目指します。費用・確率校正・閾値の最適化と、一般利用者への伝わり方の検証は未実施です。
|
|
18
|
+
|
|
19
|
+
学習前に `audit-data` で欠損・重複・クラス件数と評価条件を点検できます。`select` とBP画面では、顧客などのグループで分ける評価と、過去で学習して後の期間で評価する日付順の分割を選べます。 [点検と評価の手順](docs/DATA_AUDIT.md) · [ロードマップ](docs/ROADMAP.md)
|
|
20
|
+
|
|
21
|
+
開発作業の再開・引継ぎは、[最新の状態と引継ぎ方針](docs/HANDOFF.md)を入口にしてください。
|
|
22
|
+
|
|
23
|
+
## Full Paper
|
|
24
|
+
|
|
25
|
+
2026年11月19日・技術論文の改訂稿。データ点検からDS・BP向け出力までの運用フロー、分類評価の実装と実験、再実行の手順をまとめました。 [PDF](docs/papers/DIY_AutoML_Full_Paper_20261119/DIY_AutoML_Full_Paper_20261119.pdf) · [TeXプロジェクト](docs/papers/DIY_AutoML_Full_Paper_20261119/README.md) · [復元用ZIP](docs/papers/DIY_AutoML_Full_Paper_20261119/DIY_AutoML_Full_Paper_20261119_TeX.zip)
|
|
26
|
+
|
|
27
|
+
## 技術短報
|
|
28
|
+
|
|
29
|
+
- 2026年11月9日・試読版。評価基盤の方法と、ホテル予約、カフェ券、再購入の3例を収録。 [試読版PDF](docs/letters/DIY_AutoML_Letter_20261109.pdf)
|
|
30
|
+
- 2026年11月19日・改稿案。グループ分割、日付順評価、曜日・時間帯の多数決との比較を追加。 [改稿案PDF](docs/letters/DIY_AutoML_Letter_20261119_review.pdf)
|
|
31
|
+
|
|
32
|
+
## セットアップ
|
|
33
|
+
|
|
34
|
+
TestPyPIの公開版は **0.4.1a0** です。配布候補 **0.4.1a2** は、EKFの1ステップ処理と制御入力、複数ステップ先の時系列評価、予測区間の更新とモデル選定の許容差を収録しています。Pythonでは `import uc_automail as uc_al` で使えます。 [変更点と配布物](PyPI/candidates/0.4.1a2/RELEASE_NOTES.md) · [試用手順とノートブック](PyPI/TRIAL.md)
|
|
35
|
+
|
|
36
|
+
開発版ではニューラルネットワークの学習にTensorFlowまたはPyTorchを選べます。従来の既定はTensorFlowです。両方を同じ条件で実行する `compare-dl-backends` も用意しています。 [選び方と比較手順](docs/DL_BACKENDS.md)
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
python3.12 -m venv .venv
|
|
40
|
+
.venv/bin/python -m pip install -r requirements-local.lock.txt
|
|
41
|
+
.venv/bin/python -m pip install --no-deps -e .
|
|
42
|
+
.venv/bin/python -m pip check
|
|
43
|
+
.venv/bin/python -m pytest -q
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
ロックは今回のPython 3.12/Linux CPU環境のものです。コアのみの場合は `pip install -e .` で導入できます。DLの追加依存はTensorFlowが `.[dl]`、PyTorchが `.[dl-torch]`、比較用に両方入れる場合は `.[dl-both]` です。
|
|
47
|
+
|
|
48
|
+
## 実行
|
|
49
|
+
|
|
50
|
+
初めて使うCSVは、先に `audit-data` で点検できます。学習なしで、確認すべき項目をExcelとJSONに保存します。
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
.\.venv\Scripts\python.exe -X utf8 -m diy_automl audit-data --csv data/reference/raisin.csv --target target --row-unit "レーズン1粒" --output runs/raisin-data-audit
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
元CSVを保管し、繰り返し使う中継データには `--convert parquet` で作る圧縮Parquetを優先します。DBファイルが必要なときは `--convert duckdb` を指定できます。 [変換と直接読み出しの手順](docs/DATA_AUDIT.md#parquetとduckdbへの変換)
|
|
57
|
+
|
|
58
|
+
`extract-data` で中継ファイルから列・条件・件数を指定し、学習用CSVを作れます。ビジネス向けの点検・圧縮には、日本語の要約を出す `prepare-bp --compress` を使えます。 [抽出の手順](docs/DATA_AUDIT.md#学習用csvを抽出する) · [ビジネス向けの手順](docs/DATA_AUDIT.md#ビジネス向けの点検と圧縮)
|
|
59
|
+
|
|
60
|
+
Windowsでは `bp-preview` でCSVの点検、使う列の抽出と再点検、主要5モデルのCPU比較まで実行できます。保留テストの正解・誤分類とラベル別の見逃し・誤検知を画面で確認し、モデル比較表と評価区間をExcelで開けます。 [画面の起動と使い方](docs/DATA_AUDIT.md#データ点検の画面を使う)
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
.venv/bin/python -m diy_automl run --csv data/reference/wine.csv --target target --output runs/wine
|
|
64
|
+
.venv/bin/python -m diy_automl select --csv data/reference/wine.csv --target target --output runs/wine-select
|
|
65
|
+
.venv/bin/python -m diy_automl repeat-ul --csv data/reference/wine.csv --target target --seeds 42 43 44 --output runs/wine-repeat
|
|
66
|
+
.venv/bin/python scripts/validate_selection_run.py runs/wine-select
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
出力フォルダは新規のみ使用し、既存出力を上書きしません。Excel、配列NPZ、入力・ソース・出力ハッシュ付きmanifestを保存します。失敗時はmanifestをfailedにします。UL反復では完了・失敗・未実行を記録し、部分結果も保存します。
|
|
70
|
+
|
|
71
|
+
`run` は探索的比較です。SL5モデル、UL54候補、DL単一MLPを実行します。`--methods sl ul` でDLを省略できます。SLはtestをモデル選定に使いません。モデル選定が目的なら `select` を使用してください。
|
|
72
|
+
|
|
73
|
+
`select` は学習側の共通層化5foldのmacro F1平均で選定し、選定した1モデルだけtest評価します。数値同率はatol=1e-12、rtol=0で残し、候補順を採用します。testスコア・時間では解消しません。層化paired percentile bootstrapは正解クラス別件数を固定した1,000反復、95%、seed=43が既定です。固定済みモデル・観測クラス件数に条件付きであり、学習・選定の変動を含みません。ゼロ幅も未知の不確かさゼロを意味しません。
|
|
74
|
+
|
|
75
|
+
### 木の深さを設定する
|
|
76
|
+
|
|
77
|
+
`--tree-max-depth` は決定木とランダムフォレストの各木の深さに、指定した正の整数を上限として適用します。指定値はExcelの `Summary` と `manifest.json` に保存されます。深さ3でRaisinを比較する例です。
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
.\.venv\Scripts\python.exe -X utf8 -m diy_automl select --csv data/reference/raisin.csv --target target --tree-max-depth 3 --output runs/raisin-depth-3
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`run --methods sl`、`select`、`rank-sl`、`tune` で指定できます。`annealing-check` では `--model "Decision Tree"` または `--model "Random Forest"` と組み合わせます。Python APIの引数は `tree_max_depth=3` です。`tune` で指定すると木の深さを固定し、ほかの設定を比較します。 [探索範囲の詳細](docs/SL_TUNING_GUIDE.md#宣言した探索範囲と順序)
|
|
84
|
+
|
|
85
|
+
手法別に指定するには `--decision-tree-max-depth` と `--random-forest-max-depth` を使います。共通の上限と併用した場合は、各モデルの個別指定が優先されます。次の例は決定木だけに上限3を指定します。
|
|
86
|
+
|
|
87
|
+
```powershell
|
|
88
|
+
.\.venv\Scripts\python.exe -X utf8 -m diy_automl select --csv data/reference/raisin.csv --target target --decision-tree-max-depth 3 --output runs/raisin-decision-tree-3
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Pythonでは `tree_max_depths={"Decision Tree": 3, "Random Forest": 5}` のように渡します。`annealing-check` の個別指定は `--model` で選んだ手法に適用します。使用した個別指定は `Summary` とmanifestから確認できます。
|
|
92
|
+
|
|
93
|
+
### 教師あり学習のCPU並列度を指定する
|
|
94
|
+
|
|
95
|
+
DS向けCLIとPython APIでは、対応するBLAS/OpenMPのスレッド上限と、ランダムフォレストの並列数を個別に設定できます。たとえば `select` に `--cpu-threads 2 --forest-jobs 2` を渡します。Pythonでは `cpu_threads=2, forest_jobs=2` を指定します。設定は `Summary` とmanifestに記録します。
|
|
96
|
+
|
|
97
|
+
`--cpu-threads` は教師あり学習・予測中のネイティブスレッドプールの上限です。`--forest-jobs -1` はjoblibが認識する全CPUを使います。二つは異なる層の並列設定なので、CPUやメモリに合わせて調整します。`run` の教師あり学習、`select`、`rank-sl`、`tune`、`annealing-check` に対応します。`annealing-check` で並列数を指定する場合は `--model "Random Forest"` を選びます。 [scikit-learnの並列処理の説明](https://scikit-learn.org/stable/computing/parallelism.html) · [BP画面のCPU設定](docs/DATA_AUDIT.md#画面からのモデル比較)
|
|
98
|
+
|
|
99
|
+
`select` と `tune` の `--progress both` は、進捗を標準エラー出力に表示し、`progress.jsonl` と評価Excelの `Progress` シートにも残します。 [表示と保存の設定](docs/SL_TUNING_GUIDE.md#select-と-tune-の途中経過を残す)
|
|
100
|
+
|
|
101
|
+
DLはtrainだけでscalerをfitします。`--split-seed` と `--training-seed` を独立に指定でき、省略時は両方とも `--seed`(42)を使います。分割は概ね64/16/20、MLP32-16-8、100epoch、batch16です。test最高のseedを選ぶ入口はありません。
|
|
102
|
+
|
|
103
|
+
ULは固定データ最大5,000行、KMeans n_init=auto、GMM n_init=1/full、階層4linkage、k=2..10です。UL反復のTarget ARIとAssignment ARIは別の量です。45 seed対を独立標本としたSEM/CIや自動選定は行いません。fold SD、点ごとのSilhouette SD/SE、seed SD、test区間も区別します。
|
|
104
|
+
|
|
105
|
+
`notebooks/Local_Comparison.ipynb` は共通関数を呼ぶ5シートと図5枚のローカル入口です。図付きExcelは共通のreport関数で別ファイルへ出力します。Notebookのscikit-learn由来の3データセットは開発用です。SL/DLとULを総合順位にしません。
|
|
106
|
+
|
|
107
|
+
小麦の品種分類(Seeds)とレーズンの品種分類(Raisin)も、数値7列のCSVで試せます。 [データの出典・ライセンスとCPU実行例](data/reference/README.md)
|
|
108
|
+
|
|
109
|
+
復旧範囲と検証結果は `docs/RESET_HANDOFF.md` と `docs/VALIDATION_UL_REPEAT.md` を参照してください。2026年11月8日(日本時間)、利用者の依頼により再実装した成果物を **main** へ反映しました。通常の取得・参照先はmainです。`recovery/reimplemented-0.4.0a1-post1` は移行前の履歴を保管するブランチとして残しています。
|
|
110
|
+
|
|
111
|
+
Notebookを使う場合は、必要に応じて `.venv/bin/python -m pip install ipykernel` を追加し、エディタでこの.venvをカーネルに指定してください。0.4.0a5では専用カーネルで全コードセルを実行し、100epochのDLを含む数値出力・外部PNG5枚・8枚を埋め込んだExcel生成まで確認しました。手順はdocs/NOTEBOOK_GUIDE.md、任意のNotebook実行ツールのロックはrequirements-notebook.lock.txtです。
|
|
112
|
+
|
|
113
|
+
Gitからの再開手順と、ローカルコミット・pushの確認方法は `docs/COMMIT_GUIDE.md` に記載しています。
|
|
114
|
+
|
|
115
|
+
## 教師あり5モデルの繰り返し比較
|
|
116
|
+
|
|
117
|
+
`rank-sl` は、固定の5モデルを学習側の共通層化5分割で繰り返し比較します。既定は5反復、主指標はmacro F1です。モデルのseedを固定し、各反復のfold平均、全反復の平均による点順位、順位の範囲、1位になった反復数を記録します。1位タイは該当モデルをすべて数えます。foldや反復のスコアには依存があるため、反復間のSDは分割に対する変動の記述に使います。
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
.\.venv\Scripts\python.exe -m diy_automl rank-sl --csv data/reference/wine.csv --target target --output runs/wine-ranking
|
|
121
|
+
.\.venv\Scripts\python.exe scripts/validate_sl_ranking.py runs/wine-ranking
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
出力は `report.xlsx`(先頭の `CV_Ranking` に順位表)、分割と全候補のfold外予測を記録した `arrays.npz`、設定とハッシュを記録した `manifest.json` です。最初に約20%を最終テストとして確保し、CVで選んだ1モデルだけを評価します。混同行列は `Test_Confusion`、クラス別のPrecision・Recall・F1と件数は `Test_By_Class` で確認できます。Python APIは `diy_automl.rank_sl_csv` です。
|
|
125
|
+
|
|
126
|
+
`--comparison-fraction 0.25` を付けると、最終テストを除いた残りの25%を比較用に確保します。比較用の同じ行に対する各モデルとCV首位の差を、正解クラス別件数を固定したpaired bootstrapで評価し、順位表と `Comparison_Differences` に記録します。差の区間が0を含む場合は優劣を保留します。区間は独立した評価行、学習済みモデル、観測クラス件数を前提とし、モデルごとの比較として読みます。最終テストの対象はCVの結果で決めます。
|
|
127
|
+
|
|
128
|
+
同じ分割をAutoGluonで再評価する場合は、[AutoGluonとのクロスチェック手順](experiments/autogluon_sl_crosscheck/README.md)を参照してください。
|
|
129
|
+
|
|
130
|
+
順位付け時に、選定モデルの統計区間と浮動小数点の丸めの点検も同じExcelに出力します。`--shift "FEATURE=OFFSET"` を指定すると、運用時の校正ずれを仮定した予測感度も計算します。保存済みの順位で別のずれを試す手順は[不確かさの点検手順](docs/SL_UNCERTAINTY_AUDIT.md)にあります。
|
|
131
|
+
|
|
132
|
+
## カルマンフィルタによる時系列の予測と推定
|
|
133
|
+
|
|
134
|
+
開発版の `forecast-series` で、1状態のカルマン、直近値、自己回帰、季節ナイーブなどを同じ時系列分割で比較できます。保留区間の誤差と、未観測の次の1点の予測・区間をExcelに保存します。 [1系列の予測とモデル比較](docs/SERIES_FORECAST.md)
|
|
135
|
+
|
|
136
|
+
状態推定には専用の `kalman-track` を指定します。数値の時刻順に並ぶ1系列から、1ステップ先の予測と観測後の状態推定を計算します。観測誤差と過程ノイズを指定でき、観測が欠けた時刻も予測を続けます。フィルタの実装は、専用コマンドや対応するPython APIを指定したときに読み込みます。
|
|
137
|
+
|
|
138
|
+
レポートには、力学モデルのみ・直近観測・カルマンフィルタの比較と、予測区間に値が入った割合を記録します。真値を渡せる模擬データでは、観測ノイズを含む次の測定値と、背後にある状態を別々に採点できます。 [模擬軌道での実行手順と結果](docs/UNCERTAINTY_DESIGN.md#カルマンフィルタで数値の時系列を点検する)
|
|
139
|
+
|
|
140
|
+
`--pilot-rows` と `--min-rmse-gain` を指定すると、先頭区間で直近観測より改善した場合だけカルマンフィルタを続けます。`--compact-report` はExcelを集計表に絞り、行別の結果はNPZに保存します。 [判定の条件と処理時間](docs/UNCERTAINTY_DESIGN.md#先頭区間でフィルタを続けるか決める)
|
|
141
|
+
|
|
142
|
+
`ekf-benchmark` は、拡張カルマンフィルタを2つの小規模な非線形モデルで検証します。真値からの誤差、95%区間の被覆率、区間幅を保存するので、UKFや粒子フィルタを同じ系列で比較する際の基準にできます。 [理論例と実行手順](docs/UNCERTAINTY_DESIGN.md#拡張カルマンフィルタの理論ベンチマーク)
|
|
143
|
+
|
|
144
|
+
`ukf-benchmark` は、同じ系列でEKFとアンセンテッドカルマンフィルタ(UKF)を比較します。`Metrics` と `Timing` に誤差・被覆率・区間幅とフィルタの処理時間を保存します。 [EKFとUKFの比較手順](docs/UNCERTAINTY_DESIGN.md#アンセンテッドカルマンフィルタの理論比較)
|
|
145
|
+
|
|
146
|
+
`particle-benchmark` は、同じ系列にブートストラップ粒子フィルタを加えます。粒子数を変えて、予測誤差・分位点の区間・処理時間を比較できます。UCI Bike Sharingの日次データで次の日の観測値を予測する再現例もあります。 [粒子フィルタの検証手順](docs/UNCERTAINTY_DESIGN.md#粒子フィルタの理論比較とuci再現)
|
|
147
|
+
|
|
148
|
+
Pythonでは `diy_automl.kalman_track_csv` を使えます。力学モデルと観測モデルを指定する多変量の状態推定には、`extended_kalman_filter`、`unscented_kalman_filter`、`bootstrap_particle_filter` を同じパッケージから呼び出せます。 [ボイジャーを題材にした状態推定例](docs/UNCERTAINTY_DESIGN.md#ボイジャーを題材にした合成追跡データ)
|
|
149
|
+
|
|
150
|
+
開発版のDS向けAPIは、`uc_automail.LongitudinalScenario` と `uc_automail.simulate_longitudinal_feedback` で前走車の減速や測距誤差を含む仮想走行を比較できます。 [自動運転の検証まとめと実行例](docs/VEHICLE_EVALUATION.md)
|
|
151
|
+
|
|
152
|
+
## グラフニューラルネットワークによるノード分類
|
|
153
|
+
|
|
154
|
+
`gnn-compare` は、Cora形式の既知グラフで2層GCNとロジスティック回帰を比較します。学習・選定・保留のノードを共通にし、macro F1、学習時間、ノード別の予測を保存します。Pythonでは `diy_automl.classify_graph_nodes` を使えます。 [Coraの実行手順と比較結果](docs/GRAPH_CLASSIFICATION.md)
|
|
155
|
+
|
|
156
|
+
## Annealing check
|
|
157
|
+
|
|
158
|
+
`annealing-check` は固定した分類器で、CPUのSimulated Annealingと同予算のランダム探索を比較する任意の特徴量選択です。選定は学習側の共通層化5分割で行い、各手法で選んだ列と全列モデルを保留テストで比較します。Pythonからは `diy_automl.annealing_check_csv` を呼べます。
|
|
159
|
+
|
|
160
|
+
```powershell
|
|
161
|
+
.\.venv\Scripts\python.exe -X utf8 -m diy_automl annealing-check --csv data/reference/iris.csv --target target --budget 8 --exhaustive --output runs/annealing-iris
|
|
162
|
+
.\.venv\Scripts\python.exe -X utf8 scripts/validate_annealing_check.py runs/annealing-iris
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`report.xlsx` の `Selection` に探索スコア・学習回数・時間、`Selected_Features` に列名、`Test_Differences` に同じテスト行を再標本化した性能差の区間が入ります。探索履歴、誤差評価の読み方、IrisとWineの検証結果は[Annealing checkの記録](docs/ANNEALING_CHECK.md)にあります。
|
|
166
|
+
|
|
167
|
+
## 評価値の誤差評価(0.4.0a6)
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
.venv/bin/python -m diy_automl uncertainty --run runs/wine-select --output runs/wine-uncertainty
|
|
171
|
+
.venv/bin/python scripts/validate_uncertainty_run.py runs/wine-uncertainty
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`report.xlsx`のMetric_UncertaintyにAccuracy・macro Precision/Recall/F1の点推定、bootstrap標準誤差、95%区間を、Class_Uncertaintyにクラス別結果を出します。Intervalsに図を埋め込み、全反復と再標本化indexも保存します。標準誤差はbootstrap指標の標本SDで、反復数の平方根では割りません。既定はクラス別件数固定の1,000反復・seed 43です。`--resampling ordinary`でクラス件数も動かせます。
|
|
175
|
+
|
|
176
|
+
`run`のSL/DL、行単位分割の`select`、`tune`、`repeat-dl`に対応し、モデルやseedの順序を保ちます。ULには既存の安定性評価を使用します。行の独立性・代表性は別途確認が必要です。詳細は[ガイド](docs/METRIC_UNCERTAINTY_GUIDE.md)、検証結果は[0.4.0a6の記録](docs/VALIDATION_METRIC_UNCERTAINTY.md)にまとめています。
|
|
177
|
+
|
|
178
|
+
## DLの学習seed反復(0.4.0a2)
|
|
179
|
+
|
|
180
|
+
固定した分割とtrain-only scalerを共有し、全学習seedの指標・履歴・予測・重みを保存する `repeat-dl`(schema 5)を追加しました。初期化とshuffleの感度を記述し、test最高のseedは選びません。
|
|
181
|
+
|
|
182
|
+
```sh
|
|
183
|
+
.venv/bin/python -m diy_automl repeat-dl --csv data/reference/wine.csv --target target --training-seeds 42 43 44 --output runs/wine-repeat-dl
|
|
184
|
+
.venv/bin/python scripts/validate_dl_repeat.py runs/wine-repeat-dl
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
詳細は `docs/DL_REPEAT_GUIDE.md`、今回の検証は `docs/VALIDATION_DL_REPEAT.md` を参照してください。初回再実装の検証記録は上書きせず保持しています。
|
|
188
|
+
|
|
189
|
+
## ULの部分抽出による安定性(0.4.0a3)
|
|
190
|
+
|
|
191
|
+
`subsample-ul`(schema 6)は80%の行を非復元抽出し、各部分集合だけで標準化と学習をやり直します。抽出seedとモデルseedを分離し、全データ参照とのARI、反復間の共通行だけのARI、元行index・scaler・全割当を保存します。少ない共通行や単一クラスタの比較は状態を明示して未採点とします。自動選定やSEM/CIはありません。
|
|
192
|
+
|
|
193
|
+
```sh
|
|
194
|
+
.venv/bin/python -m diy_automl subsample-ul --csv data/reference/wine.csv --target target --sample-seeds 42 43 44 --output runs/wine-subsample
|
|
195
|
+
.venv/bin/python scripts/validate_ul_subsample.py runs/wine-subsample
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
新入口の上限は2,000行・100特徴量・参照を含む2,000候補fitです。詳細は `docs/UL_SUBSAMPLE_GUIDE.md`、検証結果は `docs/VALIDATION_UL_SUBSAMPLE.md` を参照してください。旧run/repeat-ulの動作と上限は維持しています。
|
|
199
|
+
|
|
200
|
+
## SLの設定探索と紹介記事(0.4.0a4)
|
|
201
|
+
|
|
202
|
+
`tune`(schema 7)は既定で27設定を学習側の共通5foldで比較し、選定した1設定だけを再学習・test評価します。各foldのtrain-only scaler、同率時の候補順、条件付きbootstrapを使います。詳細は `docs/SL_TUNING_GUIDE.md`、検証結果は `docs/VALIDATION_SL_TUNING.md` に記載しています。
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
.venv/bin/python -m diy_automl tune --csv data/reference/wine.csv --target target --output runs/wine-tune
|
|
206
|
+
.venv/bin/python scripts/validate_tuning_run.py runs/wine-tune
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
TensorFlowを導入せずSL/ULを試す場合は、`requirements-core.lock.txt` を導入してから `pip install --no-deps -e .` を実行できます。DLを含む全テストは従来の `requirements-local.lock.txt` を使用してください。
|
|
210
|
+
|
|
211
|
+
Zenn用の紹介原稿は `articles/`、選定フロー図は `images/diy-automl/selection-flow.png` に保存しています。2026年11月12日に利用者から公開先の共有があり、以下のリンクからZenn掲載記事を読めます。Git原稿の `published: false` は変更しておらず、掲載版と編集中の原稿は区別します。操作と過去の確認範囲は `docs/ZENN_GUIDE.md` を参照してください。
|
|
212
|
+
|
|
213
|
+
誤差評価を共通の軸に、[親記事](https://zenn.dev/okamasaya/articles/diy-automl-evaluation-framework)、[ビジネス向けの平易な説明と3テーマの実験](https://zenn.dev/okamasaya/articles/diy-automl-business-three-experiments)、[DS向けの推定条件・数式・保存結果](https://zenn.dev/okamasaya/articles/diy-automl-ds-uncertainty)の3本に分けています。統計的な不確かさ、学習の変動、数値計算誤差、系統的な偏りを区別し、現在の実装範囲と今後の設計を明示しています。
|
|
214
|
+
|
|
215
|
+
## 図付きExcel(0.4.0a5)
|
|
216
|
+
|
|
217
|
+
保存済みのrun/select/tune/反復結果から、モデルを再学習せずに図付きExcelを作れます。元の数値Excelと学習manifestはそのまま残し、画像・描画入力・配置・版を別に記録します。
|
|
218
|
+
|
|
219
|
+
`report --charts detail` は、分類の `select`・`tune` に各foldのスコアを、`tune` に学習時間の図を追加します。図の量は `none`、`summary`、`detail` から選べます。 [図付きExcelガイド](docs/EXCEL_REPORT_GUIDE.md#図の量を選ぶ)
|
|
220
|
+
|
|
221
|
+
```sh
|
|
222
|
+
.venv/bin/python -m diy_automl report --run runs/wine-tune --output runs/wine-tune-illustrated
|
|
223
|
+
.venv/bin/python scripts/validate_excel_report.py runs/wine-tune-illustrated
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
利用者が開くファイルは `report_with_figures.xlsx` です。操作と表示方針は `docs/EXCEL_REPORT_GUIDE.md`、検証は `docs/VALIDATION_EXCEL_REPORT.md` にあります。DS向けNotebook/CLIと、将来のビジネス向けアプリ・子記事をどう分けるかは `docs/AUDIENCE_PLAN.md` に記録しています。親記事は0.4.0a5へ更新し、モデルの新しさと改善幅の関係を参考文献付きで追記しました。追加モデル・データの検証、特に計算負荷の高い実験は `docs/MODEL_VALIDATION_TODO.md` の後続作業です。
|
|
227
|
+
|
|
228
|
+
海外の企業・大学・ビジネススクールが公開する業務データの候補は `docs/BUSINESS_DATASETS.md` に整理しました。実データ・架空教材・利用条件と、現行AutoMLで必要な準備を区別した調査で、これらのデータで学習を実行した記録ではありません。
|
|
229
|
+
|
|
230
|
+
初見で親しみやすい2テーマと、分析を深掘りする1テーマの検討内容は `docs/BUSINESS_SAMPLE_CANDIDATES.md` にあります。ホテル予約・飲食クーポン・再購入を扱います。
|
|
231
|
+
|
|
232
|
+
その後、利用者の承認を受け、ホテル2,000行・カフェ券2,000行・再購入1,743顧客を既存SLでQuick & dirtyに実行しました。実測と一般的な見方の比較は `docs/BUSINESS_QUICK_RESULTS.md`、保存結果は `validation/business-quick-20261108/`、再実行は `experiments/business_quick_20261108/README.md` です。親記事に要約を追記し、ビジネス向けの実験解説下書きも追加しました。追加モデルや一般的なカテゴリ/欠損処理、画面アプリは追加していません。
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "UC_AutoMaiL"
|
|
7
|
+
version = "0.4.1a2"
|
|
8
|
+
description = "Compare machine learning models and report uncertainty in their evaluation"
|
|
9
|
+
readme = "PyPI/README.pypi.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
dependencies = ["numpy>=2", "pandas>=2.2", "scipy>=1.14", "scikit-learn>=1.6", "threadpoolctl>=3.2", "openpyxl>=3.1", "matplotlib>=3.9"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Repository = "https://github.com/okamasaya/DIY_AutoML"
|
|
23
|
+
Documentation = "https://github.com/okamasaya/DIY_AutoML/blob/main/README.en.md"
|
|
24
|
+
Issues = "https://github.com/okamasaya/DIY_AutoML/issues"
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
dl = [
|
|
28
|
+
"tensorflow-cpu==2.20.0; sys_platform != 'darwin'",
|
|
29
|
+
"tensorflow==2.20.0; sys_platform == 'darwin'",
|
|
30
|
+
"keras==3.15.1",
|
|
31
|
+
]
|
|
32
|
+
dl-torch = ["torch==2.14.0"]
|
|
33
|
+
dl-both = [
|
|
34
|
+
"tensorflow-cpu==2.20.0; sys_platform != 'darwin'",
|
|
35
|
+
"tensorflow==2.20.0; sys_platform == 'darwin'",
|
|
36
|
+
"keras==3.15.1",
|
|
37
|
+
"torch==2.14.0",
|
|
38
|
+
]
|
|
39
|
+
dev = ["pytest", "build"]
|
|
40
|
+
notebook = ["ipykernel>=6", "nbclient>=0.10", "nbformat>=5"]
|
|
41
|
+
storage = ["duckdb>=1.4,<2", "pyarrow>=18"]
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
uc-automail = "diy_automl.cli:main"
|
|
45
|
+
diy-automl = "diy_automl.cli:main"
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = ["src"]
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
pythonpath = ["src"]
|
|
52
|
+
testpaths = ["tests"]
|