# V16.8 — Machine Learning & Edge AI

Open `index.html` → Machine Learning & Edge AI, or Studios → Machine Learning & Edge AI. Use START_LOCAL_SERVER.cmd for consistent origin storage; no WSL reinstall or external account required. Backup prior notebook/progress before changing browser origin. Eight supplementary experiments use separate self-reported completion, leaving existing core curriculum unchanged.

## Experiments
- M01 — Sensor data preparation & leakage: train-only imputation vs deliberately invalid all-data fitting.
- M02 — Regression for sensor calibration: OLS y = w x + b; compare a training-mean predictor.
- M03 — Fault classification & decision thresholds: Standardization fitted only on training; 300 full-batch gradient steps.
- M04 — Unsupervised anomaly scoring: Absolute z-score from known-normal training subset.
- M05 — Time-series forecasting & causal windows: Trailing moving average; no future observations in input window.
- M06 — TinyML & INT8 arithmetic: Symmetric signed INT8 [-127,127], int32 dot product and float rescaling.
- M07 — Edge vs cloud inference budget: Configured latency and payload budget; deterministic analytical model.
- M08 — Model drift & lifecycle monitoring: Standardized change of mean plus frozen held-out classifier.

## Actual local execution
From the extracted portal root in Linux/WSL or Raspberry Pi Linux:

```
python3 verification/ml168_practical.py all
python3 verification/ml168_practical.py dataset --output sensor-fixture.csv
python3 verification/ml168_practical.py infer --temperature 28 --vibration 2
python3 verification/runner.py --profile edge-ai --output edge-ai-evidence.json
```
Python uses only the standard library. The verification profile checks JS against the independent Python reference, Python tests, and host C++ if g++ is available. Use new output filenames. Select Edge AI (CLI only) in Verification Center and import profile JSON. The generated dataset is 120 rows: two train devices, one held-out device. The threshold UI is for exploration, not final tuning; real experiments need a separate validation set and independently collected test data. Normal-only fitting uses known normal training records. The forecasting task permits previously observed test values, not future values. Neither labels nor sensor readings are from physical devices.

## Embedded target
```
g++ -std=c++11 -O2 verification/ml168/ml168_host.cpp -o /tmp/psut-ml168-host
/tmp/psut-ml168-host
```
The optional ESP32 Arduino sketch is `verification/ml168/esp32_serial/esp32_serial.ino` with local header. Serial at 115200; no sensor or network needed. It uses fixed weights and simple quantized dot-product inference, not a fully integer LiteRT model. Actual MCU compilation/flashing and Raspberry Pi latency remain unverified. M07 is a configured latency/traffic model; CLI timing is only an actual host single-call observation, not an end-to-end benchmark.

## Evidence and roles
JSON/CSV record browser model evidence; notebook exports retain the supplementary lab ID within an attachment and map to a related core lab for existing import compatibility. Instructor edition adds reference and assessment notes; both editions include reference verification code so students can independently reproduce computations. Neither local completion nor these public teaching checks is a protected grade. No new LMS server or institutional authentication in this milestone.

## References
- https://scikit-learn.org/stable/common_pitfalls.html
- https://developers.google.com/edge/litert/conversion/tensorflow/quantization/post_training_quantization

## Roadmap
- V16.8 — Machine Learning & Edge AI: Implemented
- V16.9 — Advanced Cybersecurity Range: Next milestone
- V17.0 — Intelligent Project Builder: Planned
- V17.1 — University Learning Management: Planned
- V17.2 — Platform Consolidation: Planned
