https://melissalau-zonify-model.hf.space| Method | Endpoint | Fungsi |
|---|---|---|
| GET | / | Status server |
| POST | /api/zonasi/predict | Prediksi pelanggaran zonasi |
| GET | /api/zonasi/analytics | Data statistik dashboard |
| GET | /api/zonasi/model-metadata | Info & metrik model |
/api/zonasi/predict1{
2 "latitude": -6.2363,
3 "longitude": 106.8568,
4 "competitor_density": 5,
5 "jarak_kompetitor": 162.63,
6 "head_to_head": 0,
7 "cluster_macro": 4,
8 "cluster_hotspot": -1,
9 "is_hotspot": 1
10}| Field | Tipe | Keterangan |
|---|---|---|
latitude | float | Koordinat lintang lokasi |
longitude | float | Koordinat bujur lokasi |
competitor_density | float | Jumlah kompetitor dalam radius 500m |
jarak_kompetitor | float | Jarak ke kompetitor terdekat (meter) |
head_to_head | float | Flag kompetitor brand sama (0/1) |
cluster_macro | float | ID cluster makro HDBSCAN |
cluster_hotspot | float | Probabilitas cluster HDBSCAN |
is_hotspot | int | Flag area hotspot (0/1) |
1{
2 "status": "success",
3 "data": {
4 "input_received": { ... },
5 "prediction": {
6 "probability": 0.7231,
7 "confidence_percentage": 72.31,
8 "is_violation": true,
9 "verdict": "⚠️ PELANGGARAN"
10 },
11 "indicator_breakdown": {
12 "kepadatan_kompetitor_500m": {
13 "nilai": 5,
14 "status": "Tinggi",
15 "is_safe": false
16 },
17 "jarak_kompetitor_terdekat": {
18 "nilai": 162.63,
19 "status": "Terlalu Dekat (< 500m)",
20 "is_safe": false
21 },
22 "hotspot_persaingan": {
23 "nilai": 1,
24 "status": "Ya",
25 "is_safe": false
26 }
27 },
28 "ai_recommendation": "Lokasi ini berisiko tinggi..."
29 }
30}/api/zonasi/analytics1{
2 "status": "success",
3 "data": {
4 "summary_cards": {
5 "total_checks": 510,
6 "total_violations": 146,
7 "total_compliant": 364,
8 "accuracy_rate_current": "78.2%"
9 },
10 "charts": {
11 "compliance_distribution": [ ... ],
12 "cluster_analysis": [ ... ]
13 }
14 }
15}/api/zonasi/model-metadata1{
2 "status": "success",
3 "data": {
4 "model_name": "Zonify Attention-Based Classifier",
5 "version": "3.0.0",
6 "framework": "TensorFlow 2.x (Keras)",
7 "training_metrics": {
8 "metrics_evaluated": [
9 { "metric": "Accuracy", "value": 0.7744 },
10 { "metric": "ROC-AUC Score", "value": 0.8655 },
11 { "metric": "F1-Score (Violation)", "value": 0.5455 },
12 { "metric": "Recall (Violation)", "value": 0.90 }
13 ]
14 }
15 }
16}| Value | |
|---|---|
| Arsitektur | TensorFlow Functional API + Custom Layer |
| Custom Layer | SpatialDensityEmbedding |
| Custom Loss | zonasi_custom_loss (VIOLATION_WEIGHT=6.0) |
| Accuracy | 77.44% |
| AUC-ROC | 0.8655 |
| F1 Score | 0.5455 |
| Recall (Violation) | 0.90 |
| Threshold | 0.41 |
| Dataset | Jakarta Selatan (662 data points) |
jarak_pasar_meter dihapus dari versi final karena teridentifikasi sebagai target leakage (korelasi 0.57). Model final mengandalkan purely spatial features sehingga dapat menggeneralisasi ke kondisi yang lebih kompleks.