Skip to content

Commit 3880101

Browse files
committed
feat: tire prediction training pipeline — dataset generator + model training script
- scripts/generate_training_data.py: 721K records, 50 vehicles, 6 months - Realistic patterns: seasonal temp, altitude, load variation - Injected anomalies: slow leaks (8%), punctures (4%), valve failures (3%), overinflation (2%) - Per-tire long format with delta_pressure/delta_temp features - Output: Parquet partitioned by month - scripts/train_model.py: SageMaker RCF training + deployment - Trains on normal data only (unsupervised anomaly detection) - Normalizes features, saves stats to SSM - Deploys real-time endpoint - Evaluates precision/recall/F1 on labeled test set - Saves anomaly threshold to SSM - data/.gitignore: generated data excluded from git Usage: python3 scripts/generate_training_data.py python3 scripts/train_model.py --region us-east-2 --role-arn <arn> --bucket <bucket> --deploy
1 parent 6de496e commit 3880101

12 files changed

+553
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated training data (regenerate with: python3 scripts/generate_training_data.py)
2+
data/training/*.parquet
3+
data/training/anomaly_summary.csv
4+
data/training/normalization_stats.json
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
vehicle_id,tire_id,label,start,end,min_pressure,records
2+
VEH-0001,FR,slow_leak,2025-02-27 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,2444
3+
VEH-0002,RL,slow_leak,2025-03-14 06:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,2180
4+
VEH-0004,FR,overinflation,2025-06-04 06:00:00+00:00,2025-06-29 15:30:00+00:00,39.13,530
5+
VEH-0005,FL,valve_failure,2025-05-26 06:30:00+00:00,2025-06-29 17:00:00+00:00,23.85,276
6+
VEH-0010,RL,puncture,2025-05-18 06:00:00+00:00,2025-06-29 17:30:00+00:00,4.54,862
7+
VEH-0012,RR,slow_leak,2025-02-02 06:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,2946
8+
VEH-0013,FL,slow_leak,2025-04-13 07:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,1566
9+
VEH-0013,RR,valve_failure,2025-04-22 09:30:00+00:00,2025-06-29 15:30:00+00:00,23.63,568
10+
VEH-0014,FL,slow_leak,2025-03-18 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,2098
11+
VEH-0014,RL,valve_failure,2025-03-01 06:00:00+00:00,2025-06-29 17:30:00+00:00,24.31,1004
12+
VEH-0015,FL,overinflation,2025-05-14 06:00:00+00:00,2025-06-29 17:30:00+00:00,32.88,934
13+
VEH-0015,RL,valve_failure,2025-04-06 06:30:00+00:00,2025-06-29 17:30:00+00:00,21.68,704
14+
VEH-0017,FL,slow_leak,2025-04-30 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,1226
15+
VEH-0017,FR,valve_failure,2025-04-23 06:00:00+00:00,2025-06-29 17:00:00+00:00,25.21,544
16+
VEH-0020,RL,slow_leak,2025-05-11 08:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,968
17+
VEH-0021,FR,puncture,2025-05-14 06:00:00+00:00,2025-06-29 16:30:00+00:00,5.0,914
18+
VEH-0021,RL,slow_leak,2025-02-20 06:00:00+00:00,2025-06-29 16:30:00+00:00,4.5,2560
19+
VEH-0022,FL,puncture,2025-06-13 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,326
20+
VEH-0027,FL,valve_failure,2025-05-07 07:00:00+00:00,2025-06-29 17:30:00+00:00,25.53,421
21+
VEH-0028,RL,overinflation,2025-03-13 06:00:00+00:00,2025-06-29 17:30:00+00:00,33.47,2230
22+
VEH-0029,FR,puncture,2025-05-18 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,832
23+
VEH-0031,FR,valve_failure,2025-03-14 06:30:00+00:00,2025-06-29 17:30:00+00:00,23.33,898
24+
VEH-0031,RR,valve_failure,2025-05-20 09:00:00+00:00,2025-06-29 16:30:00+00:00,26.56,357
25+
VEH-0032,FR,slow_leak,2025-04-15 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,1524
26+
VEH-0034,FL,slow_leak,2025-03-15 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,2124
27+
VEH-0035,RR,slow_leak,2025-03-22 06:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,2002
28+
VEH-0036,RL,valve_failure,2025-03-17 08:00:00+00:00,2025-06-29 16:30:00+00:00,24.04,872
29+
VEH-0037,FR,puncture,2025-04-19 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,1458
30+
VEH-0038,FL,overinflation,2025-04-29 07:00:00+00:00,2025-06-29 17:30:00+00:00,34.58,1260
31+
VEH-0041,FL,slow_leak,2025-03-22 06:00:00+00:00,2025-06-29 17:30:00+00:00,5.0,2000
32+
VEH-0041,RR,puncture,2025-03-25 07:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,1938
33+
VEH-0045,RR,slow_leak,2025-04-10 06:00:00+00:00,2025-06-29 16:30:00+00:00,4.5,1640
34+
VEH-0046,RL,slow_leak,2025-05-15 06:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,908
35+
VEH-0047,RL,overinflation,2025-06-01 07:00:00+00:00,2025-06-29 17:30:00+00:00,36.13,596
36+
VEH-0049,RR,slow_leak,2025-02-08 06:00:00+00:00,2025-06-29 17:30:00+00:00,4.5,2848
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"pressure": {
3+
"mean": 30.88852404717213,
4+
"std": 1.8324599353329474
5+
},
6+
"temperature": {
7+
"mean": 20.919671962708275,
8+
"std": 10.237115307841487
9+
},
10+
"delta_pressure": {
11+
"mean": 0.020647134177260235,
12+
"std": 0.5609033623462641
13+
},
14+
"delta_temp": {
15+
"mean": 0.006680203301574875,
16+
"std": 5.666365829320597
17+
}
18+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)