jeyanthiii commited on
Commit
74cb207
·
verified ·
1 Parent(s): 0117ebf

Rewrite dataset card: full column docs, fault census, decision math

Browse files
Files changed (1) hide show
  1. README.md +111 -22
README.md CHANGED
@@ -7,42 +7,121 @@ tags:
7
  - medallion-architecture
8
  - databricks
9
  - data-quality
 
10
  size_categories:
11
  - 100K<n<1M
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
- # EV Fleet Sensor Data — Medallion Case Study
15
 
16
- Raw source CSVs for a **Databricks medallion architecture** case study:
17
- from a messy EV sensor stream to decision-grade insights (battery health, DTC risk,
18
- charger siting, clean-charging windows).
19
 
20
- ## The three feeds (three owners)
 
 
 
21
 
22
- | File | What it is | Rows | Role |
23
- |---|---|---|---|
24
- | `1_car_telemetry_2024.csv` | Hourly EV telemetry for 2024 — SOC, SOH, temps, torque, tire pressure, DTC codes | ~35K | **Messy stream** (planted faults: duplicates, kPa-vs-PSI units, out-of-bounds, missing) |
25
- | `2_charging_sessions.csv` | Charging sessions: district, duration, energy | 484 | Charger-siting question |
26
- | `3_grid_carbon_hourly.csv` | Hourly grid carbon intensity (gCO₂/kWh) | 168 | Clean-charging-window question |
27
 
28
- ## The clean archive (answer key)
29
 
30
- | File | Vehicle profile | Rows |
 
 
31
  |---|---|---|
32
- | `archive_2020_2024_rare_user.csv` | Renault Zoe · rare user | ~43K |
33
- | `archive_2020_2024_daily_user.csv` | Hyundai Ioniq 5 · daily user | ~44K |
34
- | `archive_2020_2024_moderate_user.csv` | VW ID.4 · moderate user | ~44K |
35
- | `archive_2020_2024_heavy_user.csv` | Ford F-150 Lightning · heavy user | ~44K |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
- Clean 2020–2024 hourly sensor archive (~175K rows total). The 2024 messy stream is
38
- **derived from this archive** (faults planted with seed 7) — archive = ground truth,
39
- stream = the question. They intentionally overlap in 2024 so every fault is verifiable.
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  ## Example decisions this data supports
42
 
43
- - **Risk score** = `soh_decay_pct_per_year × 20 + dtc_rate_pct × 10` (thresholds 60/30)
44
- - Service EV-102 first (risk 54.1); site the next charger in the Industrial district
45
- (43,311 gCO₂/vehicle-day, 86 sessions); shift charging to ~12:00 (~319 vs ~911 gCO₂/kWh).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ## Usage
48
 
@@ -55,3 +134,13 @@ path = hf_hub_download(repo_id="jeyanthiii/sample_ev_data_csv",
55
  repo_type="dataset")
56
  df = pd.read_csv(path)
57
  ```
 
 
 
 
 
 
 
 
 
 
 
7
  - medallion-architecture
8
  - databricks
9
  - data-quality
10
+ - olap
11
  size_categories:
12
  - 100K<n<1M
13
+ configs:
14
+ - config_name: messy_stream_2024
15
+ data_files: 1_car_telemetry_2024.csv
16
+ - config_name: charging_sessions
17
+ data_files: 2_charging_sessions.csv
18
+ - config_name: grid_carbon
19
+ data_files: 3_grid_carbon_hourly.csv
20
+ - config_name: archive_rare_user
21
+ data_files: archive_2020_2024_rare_user.csv
22
+ - config_name: archive_daily_user
23
+ data_files: archive_2020_2024_daily_user.csv
24
+ - config_name: archive_moderate_user
25
+ data_files: archive_2020_2024_moderate_user.csv
26
+ - config_name: archive_heavy_user
27
+ data_files: archive_2020_2024_heavy_user.csv
28
  ---
29
 
30
+ # ⚡ EV Fleet Sensor Data — Databricks Medallion Case Study
31
 
32
+ Raw source CSVs for an end-to-end **Databricks medallion architecture** (Bronze → Silver → Gold) case study:
33
+ a deliberately messy EV sensor stream is cleaned, quality-gated, and distilled into decision-grade insights —
34
+ battery health ranking, DTC risk, charger siting, and a clean-charging window.
35
 
36
+ - **Question data:** `1_car_telemetry_2024.csv` — 35,363 rows of 2024 telemetry with **planted faults**
37
+ - **Answer key:** the four `archive_2020_2024_*.csv` files — a clean ~175K-row sensor archive (2020–2024)
38
+ - The messy 2024 stream was **derived from the archive** (faults planted, seed = 7), so every fault is verifiable.
39
+ The two sources intentionally overlap in 2024 (stream = question, archive = ground truth).
40
 
41
+ ## Dataset Structure
 
 
 
 
42
 
43
+ ### 🔴 Feed 1 — Car telemetry (the messy stream)
44
 
45
+ **`1_car_telemetry_2024.csv`** — hourly readings, 4 vehicles, calendar year 2024.
46
+
47
+ | Column | Type | Description |
48
  |---|---|---|
49
+ | `timestamp` | datetime | Hour of reading |
50
+ | `vehicle_id` | string | `EV-101` … `EV-104` |
51
+ | `user_profile` | string | `rare_user` / `daily_user` / `moderate_user` / `heavy_user` |
52
+ | `district` | string | Home district: University, Downtown, Harbor, Industrial |
53
+ | `SOC` | float | State of charge, % |
54
+ | `SOH` | float | State of health (battery), % |
55
+ | `Charging_Cycles` | int | Lifetime charge cycles |
56
+ | `charging_now` | int | 0/1 — currently charging |
57
+ | `Battery_Temp` | float | Battery temperature, °C |
58
+ | `Motor_RPM` | int | Motor speed |
59
+ | `Motor_Torque` | float | Motor torque, Nm |
60
+ | `Motor_Temp` | float | Motor temperature, °C |
61
+ | `Brake_Pad_Wear` | float | Brake pad wear, % |
62
+ | `Charging_Voltage` | float | Charging voltage, V |
63
+ | `Tire_Pressure` | float | Tire pressure — ⚠️ planted unit faults (kPa vs PSI) |
64
+ | `DTC` | int | 1 = diagnostic trouble code active |
65
+ | `grid_carbon_g_per_kwh` | float | Grid carbon intensity at that hour |
66
+
67
+ **Planted fault census:** exact duplicates (419, to be dropped), kPa→PSI unit errors (fix),
68
+ out-of-bounds values (fix + flag), missing readings (flag). Silver-layer policy:
69
+ *only duplicates die — the row always survives; the faulty value is nulled.*
70
+
71
+ ### 🔌 Feed 2 — Charging sessions
72
+
73
+ **`2_charging_sessions.csv`** — 484 completed sessions.
74
+
75
+ | Column | Description |
76
+ |---|---|
77
+ | `session_id`, `station_id` | Identifiers |
78
+ | `district` | Where the session happened (drives charger-siting analysis) |
79
+ | `start_time`, `end_time` | Session window |
80
+ | `energy_kwh_source_analog`, `power_kw_analog` | Energy delivered / power draw |
81
+ | `soc_start_pct`, `soc_end_pct` | Battery % before → after |
82
+ | `battery_kwh`, `vehicle_model` | Vehicle pack size and model |
83
+ | `station_temp_c` | Station temperature |
84
+ | `status` | Session status |
85
+
86
+ ### ⚡ Feed 3 — Grid carbon intensity
87
 
88
+ **`3_grid_carbon_hourly.csv`** — 168 rows (7 days × 24 h): `date`, `hour`, `carbon_g_per_kwh`.
89
+ Midnight peaks near ~911 gCO₂/kWh; midday (~12:00) drops to ~319.
90
+
91
+ ### 🟢 The clean archive (ground truth)
92
+
93
+ Four files, one per user profile, each with **43,800 rows** (24 h × 365 d × 5 yrs, 2020–2024):
94
+
95
+ `archive_2020_2024_{rare,daily,moderate,heavy}_user.csv` — same sensor columns as the stream
96
+ (leading index column, no timestamps/district).
97
+
98
+ | File | Vehicle | Profile |
99
+ |---|---|---|
100
+ | `archive_2020_2024_rare_user.csv` | Renault Zoe (52 kWh) | EV-101 |
101
+ | `archive_2020_2024_daily_user.csv` | Hyundai Ioniq 5 (77 kWh) | EV-103 |
102
+ | `archive_2020_2024_moderate_user.csv` | VW ID.4 (82 kWh) | EV-102 |
103
+ | `archive_2020_2024_heavy_user.csv` | Ford F-150 Lightning (131 kWh) | EV-104 |
104
 
105
  ## Example decisions this data supports
106
 
107
+ Transparent, verifiable arithmetic (no black-box model):
108
+
109
+ 1. **Risk score** = `soh_decay_pct_per_year × 20 + dtc_rate_pct × 10`, thresholds 60 (act) / 30 (watch)
110
+ → EV-102 scores **54.1** (decay 1.958 %/yr + 654 DTC events) → service first
111
+ 2. **Charger siting** = `total_co2_g ÷ vehicle_days`
112
+ → Industrial district worst at **43,311 gCO₂/vehicle-day** across 86 sessions → site the next charger there
113
+ 3. **Charging window** = cleanest vs dirtiest hour
114
+ → shift charging to **~12:00**: ~319 vs ~911 gCO₂/kWh (2.86× cleaner, ~592 g saved per kWh shifted)
115
+
116
+ ## How it was used
117
+
118
+ The files are ingested as-is into a Databricks Free Edition lakehouse:
119
+
120
+ ```
121
+ Bronze (raw, immutable) → Silver (cleaned, quality gate: 35,363 − 419 dupes = 34,944 rows)
122
+ → Gold (6 decision tables: soh_trend, dtc_risk_rank, co2_per_vehicle_day,
123
+ grid_carbon_by_district_hour, fleet_worry_list, final_decision)
124
+ ```
125
 
126
  ## Usage
127
 
 
134
  repo_type="dataset")
135
  df = pd.read_csv(path)
136
  ```
137
+
138
+ ## Notes
139
+
140
+ - Faults are **synthetic and intentional** (teaching/demo dataset); the archive is the reference truth.
141
+ - 2024 rows exist in both stream and archive **by design** — that overlap is what makes the quality gate provable.
142
+ - Local backup of this folder is kept at `~/Documents/work/temp/cl_demo/data/`.
143
+
144
+ ## License
145
+
146
+ [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) — free to use with attribution.