# SmartCargo – Optimising Deliveries in Romania

*English translation by SOTA – AI Community of the Romanian original, published with the permission of Asociația Nitro. Organisers who would like this translation removed can email team@sota-ai.org.*

The transport company "**SmartCargo România**" needs intelligent solutions to improve its estimates of delivery durations. You are the team's new data science specialist, and your mission is to build accurate models that predict delivery times between cities in Romania.

## 🎯 Your main goal

You must analyse historical data on trips between cities and understand how factors such as distance, time of day, weather, traffic or driver experience influence the actual duration of a delivery.

Your goal is to build a Machine Learning model capable of predicting the estimated time for new trips.

---

## 📦 The transport data

Each row in the files `train_data.csv` and `test_data.csv` represents a delivery between two cities in Romania.

**Each delivery contains the following details:**

| Column                         | Description                                                                               |
|--------------------------------|-------------------------------------------------------------------------------------------|
| `ID`                           | Unique identifier of the trip                                                             |
| `City A`                       | The departure city (as text)                                                              |
| `City B`                       | The destination city (as text)                                                            |
| `Distance`                     | The real distance between the cities (in kilometres)                                      |
| `Time of Day`                  | The time of day at which a trip departs, expressed in minutes since midnight (0 - 1439)   |
| `Weather`                      | The weather during the trip (`Clear`, `Rain`, `Snow`, `Fog`)                              |
| `Traffic`                      | The traffic level on a numerical scale (0.0 - 1000.0); the maximum means the most congested |
| `Road Quality`                 | The road quality on a numerical scale (1 - 1000); the maximum means the highest quality   |
| `Driver Experience`            | The driver's level of experience (1 - 40 years)                                           |
| `deliver_time`                 | Only in `train_data.csv`: the actual delivery time in minutes                             |

---

## 🎯 Your mission

The operations manager has given you the following two essential tasks for improving the operations of "SmartCargo".

**The Prediction Dataset** (`test_data.csv`) contains samples with the same features as the training set, but without the `predicted_time` column.

Your model will generate predictions for these samples.

## Subtasks

- **Task 1 (20p)**: The Bârlad situation: an important client from Bârlad has reported frequent delays on trips in **foggy** conditions. The manager wants to find out how many trips depart from **Bârlad** in **foggy** weather (`Fog`) in the prediction dataset. Find and report the number of these trips.
- **Task 2: Estimating the times for unknown trips**: The manager has a list of new trips for which the travel times are not known. You must use the historical data (from the training set) to train prediction models and then estimate the delivery times for all the trips in the prediction dataset.


## Output format

A csv file `output.csv` that includes the following 3 columns:
- `subtaskID` - the number of the subtask (1, 2)
- `datapointID` - which refers to the `ID` column in `test_data.csv`
- `answer` - the answer corresponding to the datapoint for the respective subtask

**Note:** For subtask 1, which requires a single answer for the whole dataset, output a single row whose `datapointID` is 1.

Submit a single csv containing the answers for all the subtasks you have solved. To see an example, download the file `sample_output.csv` (Note: although it is in the correct format, it scores 0 points when submitted).

## Score

The scores for the subtasks will be computed as follows:
- Subtask 1: an integer answer; you receive 20 points only if it is correct.
- Subtask 2: depending on the performance of your model, using the MAE (Mean Absolute Error) metric on the test dataset. You can find the exact way the score is computed from the MAE in the Starter Kit.
