# Evaluation Metric
The evaluation metric for this competition is *Mean Squared Error (MSE)* of 
**Time\_To\_Death**

The time to death is defined as the number of years to death after the first diagnosis of type 2 diabetes or hypertension or hyperlipidaemia. If there is no death since the first diagnosis, then time to death is 0. For the train set, the death year (if any) can be found in *patientdemo\_phase2\_train.csv* under the column **Death\_Date**. For the test set, this column has been taken out.

Special Case 1: If the time to death is the same year as the diagnosis, then time to death is 1.
Special Case 2: If there is no first diagnosis, then time to death is 0.

- Example 1: If the patient develops type II diabetes on 9 Jan 2019, and dies in 2019, then number of years to death is 1
- Example 2: If the patient develops hypertension on 13 Jan 2019, and dies in 2020, then number of years to death is 2020 - 2019 = 1
- Example 3: If the patient develops hypertension on 19 Jan 2017, and dies in 2020, then number of years to death is 2020 - 2017 = 3
- Example 4: If the patient develops hyperlipidaemia on 23 Feb 2016, but does not die within the timeframe of the dataset, then number of years to death is 0.
- Example 5: If the patient has no first diagnosis of type 2 diabetes or hypertension or hyperlipidaemia in all his visits, then number of years to death is 0.

# Submission Format
For every **Patient\_No** in *submission.csv*, output the corresponding **Time\_To\_Death**

*submission.csv* contains 474 rows, and two columns (**Patient\_No**, **Time\_To\_Death**).
The first row is the header row, and there will be subsequently 473 rows of unique **Patient No**. 
Note that *submission.csv* only contains a subset of **Patient No** which appears in the entire test dataset.

# Extra: Training Set Time to Death (To check for Training Purposes)
The time to death from time of first diagnosis can be calculated from the training dataset directly itself. However, to assist you to verify if you have calculated correctly, we also provide *train\_time\_to\_death.csv*, which contains a header row followed by 2677 rows of unique **Patient No** and their corresponding **Time\_To\_Death** from the training dataset.