UAT 456 Artificial Intelligence, Machine Learning and Computer Vision for UAS
Worksheet 8 Regression, regularisation and time-series forecasting
Objective
Apply ridge and lasso to correlated features, report the valid range of the model, and evaluate a time series with walk-forward against persistence
Equipment and materials
- Computer with Python, numpy, pandas, scikit-learn and matplotlib
- The example code at /downloads/uat-456/
- The department's real flight or PLC logs (if available), with person-identifying columns removed
Safety
- Desk work, no flying; keep any real data that identifies a person within the group
Steps
- Run Example 1 with 3, 5, 10 and 20 training packs and compare the SD of the cycles coefficient for OLS and ridge
- Add one more feature correlated with cycles and see how the OLS SD changes and how much ridge helps
- Run Example 2 with a finer alpha grid and choose a value with reasons from the flatness of the CV curve
- Run Example 3 with the training edge at cycles 200 and 350 and record RMSE by band
- Write a short model note stating the training range and the cycle range not to use
- Run Example 4 adding lag48 and removing day, and compare walk-forward and shuffled-fold MAE
Record of results
| Training packs | OLS SD | Ridge SD | OLS RMSE | Ridge RMSE |
|---|---|---|---|---|
| Training edge (cycles) | Model | 310-350 | 360-400 | 410-450 |
|---|---|---|---|---|
| Feature set | Model | Walk-forward MAE | Shuffled-fold MAE | Skill against persistence |
|---|---|---|---|---|
Questions
Why does the coefficient SD fall as training data grows, and why must the coefficients of correlated features not be read as engineering explanations?
From the finer alpha CV curve, which value did you choose, and why is the lowest point in a flat range not the only right choice?
When the training edge passes the ageing knee (for example 350 cycles), how does the random forest change, and what must the model note state?
What is your skill against persistence, and why is the shuffled-fold MAE too good?
Check before you hand in
What to hand in
- Graph of coefficient SD by number of packs
- RMSE-by-band table
- Short model note
- Table of walk-forward and shuffled-fold MAE and the skill against persistence