Upload README.md
Browse files
SPC-UQ/Cubic_Regression/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Toy Example: SPC-UQ on Cubic Regression
|
| 2 |
+
|
| 3 |
+
This directory provides an implementation of several uncertainty quantification (UQ) methods on a synthetic cubic regression problem.
|
| 4 |
+
|
| 5 |
+
The task is defined by
|
| 6 |
+
|
| 7 |
+
y = x³ + ε(x) - E[ε(x)]
|
| 8 |
+
|
| 9 |
+
- Training set: 2,000 samples
|
| 10 |
+
- Test set: 1,000 samples
|
| 11 |
+
- In-distribution data: x ∈ [-4, 4]
|
| 12 |
+
- Out-of-distribution data: x ∈ [-6, -4) ∪ (4, 6]
|
| 13 |
+
|
| 14 |
+
## Running `run_cubic_tests.py`
|
| 15 |
+
|
| 16 |
+
`run_cubic_tests.py` trains and evaluates different UQ models, and visualizes results.
|
| 17 |
+
|
| 18 |
+
### Basic usage
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
python run_cubic_tests.py --num-epochs 5000 --data-noise log --UQ-model SPCregression
|
| 22 |
+
```
|
| 23 |
+
The benchmarks are lightweight and can run on **CPU-only devices**.
|
| 24 |
+
|
| 25 |
+
### Arguments
|
| 26 |
+
|
| 27 |
+
- `--num-epochs`: Number of training epochs (default: 5000).
|
| 28 |
+
- `--data-noise {norm, tri, log}`: Type of noise added to the data. `norm` is Gaussian, `tri` is a mixture distribution, and `log` is log-normal (default).
|
| 29 |
+
- `--UQ-model {SPCregression, DeepEnsemble, EDLRegressor, EDLQuantileRegressor, QROC, ConformalRegressor}`: UQ model to run.
|
| 30 |
+
|
| 31 |
+
After execution, the script prints RMSE, PICP and related metrics, and produces plots of prediction intervals and uncertainty.
|