weijuinlee commited on
Commit
efce4fa
·
verified ·
1 Parent(s): 59f2c41

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,3 +1,80 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: scikit-learn
4
+ tags:
5
+ - flood-risk
6
+ - tabular-classification
7
+ - environmental-risk
8
+ - singapore
9
+ - lightgbm
10
+ pipeline_tag: tabular-classification
11
+ ---
12
+
13
+ # weijuinlee/coastal-risk-ai
14
+
15
+ `coastal-risk-ai` predicts whether a flood alert will occur in the next 60 minutes for a location using rainfall, wind speed, tide level, and location metadata.
16
+
17
+ ## Model Summary
18
+
19
+ - Task: binary classification
20
+ - Target: `flood_event_next_60m`
21
+ - Forecast horizon: 60 minutes
22
+ - Model type: lightgbm
23
+
24
+ ## Risk Output
25
+
26
+ - Probability: `0.0` to `1.0`
27
+ - Risk labels:
28
+ - `low` for probability < 0.35
29
+ - `medium` for probability >= 0.35 and < 0.7
30
+ - `high` for probability >= 0.7
31
+
32
+ ## Evaluation
33
+
34
+ Validation:
35
+ - PR-AUC: 0.5146026360944063
36
+ - ROC-AUC: 0.6092489137181875
37
+ - F1: 0.5399534522885958
38
+
39
+ Test:
40
+ - PR-AUC: 0.5376358213531683
41
+ - ROC-AUC: 0.6483611055375994
42
+ - F1: 0.6011466011466011
43
+ - Precision: 0.5628834355828221
44
+ - Recall: 0.6449912126537786
45
+
46
+ ## Expected Input Schema
47
+
48
+ - `location_id`
49
+ - `rainfall_mm`
50
+ - `wind_speed`
51
+ - `tide_level_m`
52
+ - `flood_prone_flag`
53
+ - `hour_of_day`
54
+ - `day_of_week` optional
55
+ - `month` optional
56
+
57
+ ## Training Data
58
+
59
+ This artifact was trained from the normalized coastal risk schema used in the repository:
60
+
61
+ - `timestamp`
62
+ - `location_id`
63
+ - `latitude`
64
+ - `longitude`
65
+ - `rainfall_mm`
66
+ - `wind_speed`
67
+ - `tide_level_m`
68
+ - `flood_alert`
69
+ - `flood_prone_flag`
70
+
71
+ The bundled sample dataset is synthetic and intended for pipeline validation and demo use.
72
+
73
+ ## Files
74
+
75
+ - `model.joblib`: trained model artifact
76
+ - `features.json`: ordered model feature list
77
+ - `metrics.json`: train and evaluation metrics
78
+ - `config.json`: pipeline configuration used for training
79
+ - `sample_inference_single.json`: example inference payload
80
+ - `sample_inference_batch.csv`: example batch inference payload
config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "paths": {
3
+ "project_root": "/Users/leeweijuin/Development/coastal-risk-ai",
4
+ "raw_data_dir": "/Users/leeweijuin/Development/coastal-risk-ai/data/raw",
5
+ "processed_data_dir": "/Users/leeweijuin/Development/coastal-risk-ai/data/processed",
6
+ "artifacts_dir": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts",
7
+ "model_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/model.joblib",
8
+ "features_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/features.json",
9
+ "metrics_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/metrics.json",
10
+ "evaluation_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/evaluation.json",
11
+ "dataset_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/raw/sample_environment_data.csv"
12
+ },
13
+ "features": {
14
+ "forecast_horizon_minutes": 60,
15
+ "rolling_windows_minutes": [
16
+ 15,
17
+ 30,
18
+ 60,
19
+ 180
20
+ ],
21
+ "high_tide_threshold_m": 2.8
22
+ },
23
+ "model": {
24
+ "model_type": "lightgbm",
25
+ "random_seed": 42,
26
+ "decision_threshold": 0.5,
27
+ "test_size": 0.15,
28
+ "val_size": 0.15
29
+ },
30
+ "risk": {
31
+ "medium_threshold": 0.35,
32
+ "high_threshold": 0.7
33
+ }
34
+ }
features.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "rainfall_current",
3
+ "rainfall_15min_sum",
4
+ "rainfall_30min_sum",
5
+ "rainfall_60min_sum",
6
+ "rainfall_180min_sum",
7
+ "rainfall_60min_max",
8
+ "rainfall_trend",
9
+ "wind_current",
10
+ "wind_30min_mean",
11
+ "wind_60min_max",
12
+ "tide_current",
13
+ "tide_60min_mean",
14
+ "tide_trend",
15
+ "high_tide_flag",
16
+ "hour_of_day",
17
+ "day_of_week",
18
+ "month",
19
+ "location_code",
20
+ "flood_prone_flag"
21
+ ]
metrics.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "target": "flood_event_next_60m",
3
+ "model_type": "lightgbm",
4
+ "class_weight_scale": 1.29498861047836,
5
+ "validation": {
6
+ "pr_auc": 0.5146026360944063,
7
+ "roc_auc": 0.6092489137181875,
8
+ "f1": 0.5399534522885958,
9
+ "precision": 0.4627659574468085,
10
+ "recall": 0.6480446927374302,
11
+ "confusion_matrix": [
12
+ [
13
+ 358,
14
+ 404
15
+ ],
16
+ [
17
+ 189,
18
+ 348
19
+ ]
20
+ ]
21
+ },
22
+ "test": {
23
+ "pr_auc": 0.5376358213531683,
24
+ "roc_auc": 0.6483611055375994,
25
+ "f1": 0.6011466011466011,
26
+ "precision": 0.5628834355828221,
27
+ "recall": 0.6449912126537786,
28
+ "confusion_matrix": [
29
+ [
30
+ 442,
31
+ 285
32
+ ],
33
+ [
34
+ 202,
35
+ 367
36
+ ]
37
+ ]
38
+ },
39
+ "split_sizes": {
40
+ "train": 6045,
41
+ "validation": 1299,
42
+ "test": 1296
43
+ },
44
+ "split_time_ranges": {
45
+ "train": [
46
+ "2025-01-01 00:00:00+00:00",
47
+ "2025-01-07 23:50:00+00:00"
48
+ ],
49
+ "validation": [
50
+ "2025-01-07 23:55:00+00:00",
51
+ "2025-01-09 11:55:00+00:00"
52
+ ],
53
+ "test": [
54
+ "2025-01-09 12:00:00+00:00",
55
+ "2025-01-10 23:55:00+00:00"
56
+ ]
57
+ },
58
+ "config": {
59
+ "paths": {
60
+ "project_root": "/Users/leeweijuin/Development/coastal-risk-ai",
61
+ "raw_data_dir": "/Users/leeweijuin/Development/coastal-risk-ai/data/raw",
62
+ "processed_data_dir": "/Users/leeweijuin/Development/coastal-risk-ai/data/processed",
63
+ "artifacts_dir": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts",
64
+ "model_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/model.joblib",
65
+ "features_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/features.json",
66
+ "metrics_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/metrics.json",
67
+ "evaluation_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/artifacts/evaluation.json",
68
+ "dataset_path": "/Users/leeweijuin/Development/coastal-risk-ai/data/raw/sample_environment_data.csv"
69
+ },
70
+ "features": {
71
+ "forecast_horizon_minutes": 60,
72
+ "rolling_windows_minutes": [
73
+ 15,
74
+ 30,
75
+ 60,
76
+ 180
77
+ ],
78
+ "high_tide_threshold_m": 2.8
79
+ },
80
+ "model": {
81
+ "model_type": "lightgbm",
82
+ "random_seed": 42,
83
+ "decision_threshold": 0.5,
84
+ "test_size": 0.15,
85
+ "val_size": 0.15
86
+ },
87
+ "risk": {
88
+ "medium_threshold": 0.35,
89
+ "high_threshold": 0.7
90
+ }
91
+ }
92
+ }
model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4135bfb53e3e41bb363ee40dc83a2c2a27d5b7bfe7832432851606c2c4556166
3
+ size 679712
sample_inference_batch.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ location_id,rainfall_mm,wind_speed,tide_level_m,flood_prone_flag,hour_of_day,day_of_week,month
2
+ SG-001,22.0,13.0,2.95,1,18,2,1
3
+ SG-002,2.5,6.5,1.7,0,11,2,1
sample_inference_single.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "location_id": "SG-001",
3
+ "rainfall_mm": 22.0,
4
+ "wind_speed": 13.0,
5
+ "tide_level_m": 2.95,
6
+ "flood_prone_flag": 1,
7
+ "hour_of_day": 18,
8
+ "day_of_week": 2,
9
+ "month": 1
10
+ }