# Data Reduction Optimisation

*English translation by SOTA – AI Community of the Georgian original. Organisers who would like this translation removed can email sota.ai.community@gmail.com.*

*Source: Georgian AI League I, a practice contest of the Georgian Artificial Intelligence Association (GAIA) on the Nitro AI judge, 18 January 2026, task 3: [original statement](https://judge.nitro-ai.org/competitions/gaia/ai-league-i/3/view). The judge lists the task as "Data Reduction Optimisation"; the statement itself is headed as below.*

## The Truck APS Failure Data Optimisation Challenge

## Problem Description

Astamakha is a hard-working person who has been tasked with analysing failures of the APS (Air Pressure System) of trucks. Astamakha's bosses have required the system to have an F1 score of at least 0.92. Astamakha's friend Giorgi, who loves difficulties very much, proposed the following challenge: "Come on, let's reach F1 >= 0.92 with as little data as possible!"

Astamakha would not be Astamakha without accepting such a challenge, and so the challenge was accepted, but Astamakha first decided to have a snack. Unfortunately, on returning, Astamakha discovered that a cat had walked across the keyboard, and as a result many gaps had been introduced into the data!

**Your job is to help Astamakha complete the assignment and the challenge using the minimum amount of data.**

## Task

Training data (`train_data.csv`) is given. You must select a subset of **rows** and **columns/features** that:

1. reaches an **F1 score >= 0.92** on both the public and the private test sets. (It does not matter by how much you exceed it; the main thing is to clear the threshold.)
2. uses the **minimum amount of data** (fewer rows and columns = better score).

## Given Data
`train_data.csv` - data of shape `(2870, 195)`, where 194 are variables and the last one is class - the label


```python
import pandas as pd

train_data = pd.read_csv("train_data.csv")
```

## Submission Format

Create a JSON file with the following structure:

```json
{
  "rows": [0, 1, 5, 10, ...],
  "columns": [91, 124, 181, ...]
}
```

* **rows**: a list of row indices (counting starts from 0) from `train.csv` that should be used.
* **columns**: a list of column indices (counting starts from 0) or column names (**except 'class'**).

## Scoring System
Based on the JSON file you submit, we will build a subset of the original training data and train a model on it using exactly this code

```python
Pipeline([
    ("imputer", SimpleImputer(strategy="median")),
    ("clf", DecisionTreeClassifier(
        random_state=42,
        class_weight="balanced",
        max_depth=None,
        min_samples_leaf=1,
    )),
])
```
**Note**: the model's `seed` is fixed at 42. You cannot change it.

## Score Calculation

### F1 Threshold (Pass/Fail)

Your submission must satisfy the following condition:

```
F1_Test >= 0.92
```

If the F1 threshold **is not met**, your score will be **0**.

### Compression Score

If the F1 threshold is cleared, your score is calculated as follows:
$$score = 0.5 \cdot \frac{\log(r / r_{now})}{\log(r)} + 0.5 \cdot \frac{\log(c / c_{now})}{\log(c)}$$


where:

* `r` = the total number of rows in the original training data (2870)
* `r_now` = the number of rows in your selection
* `c` = the total number of feature columns (194)
* `c_now` = the number of columns in your selection

**The higher the score, the better!** The score rewards using fewer rows and columns.

This score will be scaled to 0-100, where 100 points are awarded to the best solution produced by us.

### Score Examples

| Rows | Cols | F1 threshold | Score |
| --- | --- | --- | --- |
| 2870 | 194 | PASS | 0.000 |
| 2870 | 6 | PASS | 0.330 |
| 300 | 6 | FAIL | 0.000 |



## Good Luck!

Help Astamakha impress Giorgi with the most compressed dataset that still reaches F1 >= 0.92!
