File size: 4,228 Bytes
976b948
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---

title: Neuro Orion - NYC Taxi Traffic Time Series Anomaly Detection
emoji: 🐨
colorFrom: indigo
colorTo: yellow
sdk: streamlit
sdk_version: "1.41.1"
app_file: src/app.py
pinned: true
---


[![Sync to Hugging Face hub](https://github.com/gdtan02/NeuroOrion_Time_Series_Anomaly_Detection/actions/workflows/main.yml/badge.svg)](https://github.com/gdtan02/NeuroOrion_Time_Series_Anomaly_Detection/actions/workflows/main.yml)

# NYC Taxi Traffic - Time Series Anomaly Detection

## Project Overview

This project is developed for WID3011 Deep Learning Assignment.

SDG 8: Sustainable Cities & Communities:

This problem examines an anomaly detection challenge using the NYC Taxi Traffic dataset, available on Kaggle 
([https://www.kaggle.com/datasets/julienjta/nyc-taxi-traffic]) and provided by the NYC Taxi and Limousine 
Commission. The dataset presents a univariate time series of total taxi passenger counts from July 2014 to January 
2015, aggregated every 30 minutes. It includes five notable anomalies, occurring during the NYC Marathon, 
Thanksgiving, Christmas, New Year’s Day, and a snowstorm. 

The task involves implementing a complete anomaly detection pipeline: analyzing the NYC Taxi Traffic dataset, 
developing a Long Short Term Memory (LSTM) model to detect outliers and anomaly.

**Group Name:**
Neuro Orion

**Group Members:**
1. Poo Wei Chien
2. Tan Guo Dong
3. Tan Zhi Jian
4. Sanjivan A/L Balajawahar
5. Marvin Chin Yi Kai


---
## Acknowledgements

We acknowledge the contributors to the following resources:
- All the members of Neuro Orion for their contributions to the project.
- NYC Taxi Traffic dataset provided by NYC Taxi and Limousine Commission.
- Open-source tools and frameworks like TensorFlow, PyTorch, and Jupyter Notebook.

---

## Installation Guide

Follow these steps to set up the project locally:

### 1. Clone the repository to your local machine:

Run the following command in your terminal:

```bash

git clone https://github.com/gdtan02/NeuroOrion_Time_Series_Anomaly_Detection.git

cd nyc-taxi-anomaly-detection

```

### 2. Set up a Python Virtual Environment (Optional):

You can use `venv` or `conda` to create and activate a virtual environment to manage dependencies.

Using `venv`: 

For Windows user, run the following command:
```commandline

python -m venv venv

venv\Scripts\activate

```

For MacOS/Linux user, run the following command:
```commandline

python3 -m venv venv

source venv/bin/activate

```

Using `conda`:
```commandline

conda create --name nyc-taxi-env python=3.8 -y

conda activate nyc-taxi-env

```

### 3. Install dependencies:

Install all the required dependencies listed in `requirements.txt` file using `pip`: 
```commandline

pip install -r requirements.txt

```

### 4. Install Jupyter Notebook (Optional):

If Jupyter Notebook is not already installed, you can install it using `pip`:

```commandline

pip install notebook

```

Alternatively, if you are using `conda`, you can install Jupyter Notebook using the following command:

```commandline

conda install -c conda-forge notebook

```

### 5: Start Jupyter Notebook
Launch Jupyter Notebook to execute the project code:

```commandline

jupyter notebook

```
A browser window should open, displaying the Jupyter Notebook interface. 
If it does not open automatically, copy and paste the link shown in the terminal into your web browser.

You are now ready to run the project code in the Jupyter Notebook.

---

## Development Setup

### 1: Code Formatting
We use Black for code formatting. To set up:

1. Install black and pre-commit:
```bash

pip install black pre-commit

```

2. Run pre-commit hooks:
```bash

pre-commit install

```

3. Run Black manually:
```bash

black .

```

4. Configure VS Code (optional):
```json

{

    "python.formatting.provider": "black",

    "editor.formatOnSave": true

}

```

Refer to the [Black documentation](https://black.readthedocs.io/en/stable/) for more information. Reference from the article [here](https://dev.to/emmo00/how-to-setup-black-and-pre-commit-in-python-for-auto-text-formatting-on-commit-4kka)

---