File size: 1,510 Bytes
32ab3d8
ed2fa57
 
 
 
32ab3d8
1eda1cf
32ab3d8
 
 
 
ed2fa57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1eda1cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: Transformer Oil Temperature Forecaster
emoji: 
colorFrom: red
colorTo: blue
sdk: gradio
sdk_version: 6.12.0
app_file: app.py
pinned: false
---

# ⚡ Transformer Oil Temperature Forecaster

> **ARIMAX · Anomaly Detection · Time Series Analysis**

Upload ETT-style transformer CSV data and get:

| Feature | Details |
|---|---|
| **Model** | ARIMAX — auto-selects best `(p, d, q)` via AIC grid search |
| **Endog** | `OT` — oil temperature |
| **Exog** | `HUFL, HULL, MUFL, MULL, LUFL, LULL` — load features |
| **Stationarity** | ADF test; auto-applies 1st differencing if needed |
| **Anomaly Detection** | Residual-based, threshold = mean ± 2.5σ |
| **Evaluation** | MAE + RMSE on 20% hold-out set |

---

## 📂 Expected CSV Format

```
date,HUFL,HULL,MUFL,MULL,LUFL,LULL,OT
2016-07-01 00:00:00,5.827,2.009,1.599,0.462,4.203,1.340,30.531
...
```

The ETT (Electricity Transformer Temperature) dataset works out of the box.  
Download it from: https://github.com/zhouhaoyi/ETDataset

---

## 🚀 Running Locally

```bash
pip install -r requirements.txt
python app.py
```

---

## 📐 Architecture

```
CSV Upload


load_data()          ← parse datetime index, ffill missing


check_stationarity() ← ADF test → d value


train_arimax()       ← grid search (p,q) on 80% train split

    ├──► forecast()          ← out-of-sample N steps

    └──► detect_anomalies()  ← residual threshold flagging
```