Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: ContactTracingClustering
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
|
@@ -12,9 +12,75 @@ short_description: Interactive GPS contact tracing with DBSCAN and Streamlit
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: ContactTracingClustering
|
| 3 |
+
emoji: πΊοΈπ§
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
|
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# π GPS Contact Tracing with DBSCAN
|
| 16 |
|
| 17 |
+
## π§ Overview
|
| 18 |
+
This project demonstrates how **clustering techniques** can be used for **GPS-based contact tracing**.
|
| 19 |
+
A **DBSCAN clustering model** is applied to spatial location data to identify potential contact groups and to classify isolated points as noise.
|
| 20 |
|
| 21 |
+
The application is implemented using **Streamlit** and allows users to upload their own GPS data for interactive exploration.
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## π Methodology
|
| 26 |
+
- **Task type:** Unsupervised Learning (Clustering)
|
| 27 |
+
- **Baseline model:** KMeans (used for comparison)
|
| 28 |
+
- **Main model:** DBSCAN
|
| 29 |
+
- **Distance metric:** Haversine (GPS-based distance)
|
| 30 |
+
- **Noise detection:** Supported (`-1` label)
|
| 31 |
+
|
| 32 |
+
DBSCAN was selected as the main model because it does not require a predefined number of clusters and can identify noise, which is essential for realistic contact tracing.
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## π Input Data
|
| 37 |
+
The uploaded CSV file must contain the following columns:
|
| 38 |
+
|
| 39 |
+
latitude
|
| 40 |
+
longitude
|
| 41 |
+
|
| 42 |
+
yaml
|
| 43 |
+
Code kopieren
|
| 44 |
+
|
| 45 |
+
Each row represents a GPS location point.
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## π Streamlit Application
|
| 50 |
+
The Streamlit app:
|
| 51 |
+
- Loads a **pre-configured DBSCAN model**
|
| 52 |
+
- Applies the model to uploaded GPS data
|
| 53 |
+
- Detects potential contact clusters
|
| 54 |
+
- Visualizes clusters and noise points
|
| 55 |
+
- Displays cluster distribution and noise ratio
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## π Output
|
| 60 |
+
- Cluster labels (`-1` indicates noise)
|
| 61 |
+
- Cluster size distribution
|
| 62 |
+
- Proportion of noise points
|
| 63 |
+
- Scatter plot of GPS contact clusters
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## π οΈ Technologies Used
|
| 68 |
+
- Python
|
| 69 |
+
- Streamlit
|
| 70 |
+
- scikit-learn
|
| 71 |
+
- pandas
|
| 72 |
+
- numpy
|
| 73 |
+
- matplotlib
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
## π Notes
|
| 78 |
+
- DBSCAN does not use prediction in the traditional sense.
|
| 79 |
+
- Clusters are computed dynamically using fixed, pre-selected parameters.
|
| 80 |
+
- The focus is on spatial proximity rather than forcing all points into clusters.
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
+
|
| 84 |
+
## β
Conclusion
|
| 85 |
+
This project shows that **DBSCAN is well suited for GPS-based contact tracing**, as it identifies meaningful close-contact groups while ignoring isolated locations.
|
| 86 |
+
The Streamlit interface makes the clustering results easy to explore and understand.
|