# 📊 Evaluation Metric

This competition uses a **Hardcore Clinical Score** designed to rigorously test your model's ability to detect rare signals. It penalizes "lazy" predictions (predicting nothing) and rewards precision in risk estimation.

The final score ranges from **0.0 to 1.0**, where higher is better.

---

## 🏆 Final Score Formula

$$Score = 0.4 \times F1_{Severity}^{(Macro)} + 0.3 \times F1_{SideEffects}^{(Micro)} + 0.3 \times S_{PRR}$$

$$S_{PRR} = \frac{1}{1 + \text{RMSE}_{masked}}$$

$$RMSE_{masked} = \sqrt{\frac{1}{N_{pos}}\sum_{i \in Mask}(y_{true}^{(i)} - y_{pred}^{(i)})^2}$$

**Where:**

$$ \textbf{Mask} : \{ i \mid y_{true}^{(i)} > 0 \} $$

$$ N_{pos} : \text{Count of items in the Mask} $$

$$ (y_{true} - y_{pred})^2 : \text{Squared Error (only for Mask)} $$

$$ \sum : \text{Sum of these errors} $$

$$ \frac{1}{N} : \text{Average (Mean)} $$

$$ \sqrt{\dots} : \text{Square Root} $$

---

## Detailed Breakdown

### 1. Severity Classification (40%)

* **Metric:** **Macro F1-Score**.
* **Description:** Multi-class classification of the clinical severity level (`Minor`, `Moderate`, `Major`).
* **Why:** We treat all severity levels as equally important. Detecting a rare "Contraindication" is just as critical as detecting a common "Moderate" case. The Macro average ensures the minority classes are not drowned out.

### 2. Side Effect Prediction (30%)

* **Metric:** **Micro F1-Score** (Global).
* **Description:** Binary multi-label classification for the 50 side effects.
* **Why Micro F1?**
* Unlike Jaccard or Accuracy, **Micro F1 does not reward predicting "Nothing".**
* You only gain points by **actively detecting** real side effects (True Positives).



### 3. PRR Regression (30%)

* **Metric:** **Inverse RMSE on Masked Data**.
* **Formula:**


* **Description:** We calculate the Root Mean Squared Error (RMSE) between your predicted PRR and the true PRR.
* **The "Masked" Rule:** The error is calculated **ONLY** for pairs where a side effect actually exists in the ground truth (True PRR > 0). You are not penalized for predicting PRR values on empty rows, nor are you rewarded for predicting 0s correctly.
* **Why Inverse RMSE?**
* It is a "Hardcore" metric. Large errors are penalized heavily by the square term in RMSE.
* A perfect model gets 1.0. A model with high error will see its score drop rapidly towards 0.

# 📝 Submission Format

You must submit a CSV file containing a header and the predictions for all test rows. The file format should look like this:

```csv
Pair_ID,Severity,Target_Binary_Abdominal_pain,Target_Binary_Anaemia,...,Target_PRR_Abdominal_pain,...
Test_1,Moderate,1,0,...,2.5,...
Test_2,Major,0,1,...,1.8,...
Test_3,Minor,0,0,...,0.0,...

```

### Column Definitions

* **`Pair_ID`**: Must match the Test Set IDs exactly.
* **`Severity`**: String value (`Major`, `Moderate`, `Minor`, `Contraindication`).
* **`Target_Binary_...`**: Integer (`0` or `1`).
* **`Target_PRR_...`**: Float value (typically `0.0` to `10.0`).