Problem #184
Author:Carina Brebenaru
Difficulty
Your best score
N/A
In the distant Galactic Wars universe, two equally powerful armies are in constant conflict: the Jedai and the Imperials (Calmtroopers).
One of the most powerful Jedai, Anaklyn Groundwalker, is caught in a mission with numerous battles from which, this time, he is not sure he will escape. Palme, his girlfriend, asks for your help and wants to predict if Anaklyn will be victorious based on various battle factors, such as weapons, armor, force, but also moral state (self-confidence).
Luckily for you, a Calmtrooper (from the Imperial camp) dropped a set with his equipment, and you can build a model that can predict Anaklyn's victory.
You have found two files:
train.csv - data about previous battles, containing the winnertest.csv - data about future battles, without knowing the winner| Name | Type | Description |
|---|---|---|
| FightID | int | Unique ID of the fight |
| weapon_jedai | object | Jedai Weapon |
| armour_jedai | object | Jedai armor protection (%) |
| weapon_calmtrooper | object | Calmtrooper Weapon |
| armour_calmtrooper | object | Calmtrooper armor protection (%) |
| injuries | object | Injured fighter |
| number_of_fights | float | Number of fights fought |
| force_level | float | Opponent's force level |
| accuracy_calmtrooper | float | Calmtrooper's shooting accuracy |
| fight_planet | object | Planet where the fight takes place |
| weather_conditions | object | Weather conditions |
| surprise_attack | bool | Surprise attacks |
| moral_jedai | float | Jedai morale |
| moral_calmtrooper | float | Calmtrooper morale |
| winner | int | Winner of the fight |
Palme, known for being demanding (and because she noticed you are skilled), asks you to solve 4 tasks.
Subtasks 1 and 2 involve data analysis and processing.
Subtasks 3 and 4 evaluate the performance of the label assignment model and the classification model, respectively.
To equip himself well for battle, Anaklyn needs to know how to dress.
Calculate how many fights in test.csv take place on planets of type "Nabira" and where the weather conditions (weather_conditions) are of type Snow.
You discovered that the Calmtroopers set a trap for you and that they actually no longer use the weapons Anaklyn knew:
Replace all occurrences of the weapon Experimental Weapon with Double Blaster in the train.csv dataset and display how many values you had to replace.
(For the following subtasks, this replacement has already been performed in test.csv)
Analyzing previous fights, Anaklyn noticed that they can be categorized into 3 fighting styles (0, 1, 2), using the skills of the Jedai and the opponent (force, morale, armor, experience, etc.).
For each fight in test.csv, determine the corresponding fighting style.
Evaluation Metric
The Adjusted Rand Index (ARI) is used to evaluate the fight categorization, which measures the similarity between the two partitions, adjusting for random matching.
The ARI coefficient for two partitions is defined as:
ARI = (RI - E[RI]) / (max(RI) - E[RI])
where:
If the obtained number is close to 1, it means the division into fight types was done skillfully and the boundaries between fight characteristics were correctly identified. Anaklyn's life depends on knowing these types of battles, so the maximum score for this subtask is offered only if the evaluation metric value is >= 0.95.
Given the dataset describing individual fights between Jedai and Calmtroopers, build a classification model to predict the outcome of the fight for each row in test.csv.
The target variable is: winner (0 - Calmtrooper wins / 1 - Jedai wins).
Evaluation is done using the macro F1 score.
The macro F1 score is calculated as follows:
This metric treats both classes equally and penalizes models that only correctly predict the majority class.
Evaluation thresholds:
The final submission must be a CSV file named submission.csv containing exactly 3 columns:
subtaskID - the subtask number (1, 2, 3, 4)datapointID - the ID of each fightanswer - the appropriate answer for that subtask and datapointIDNote: For Subtasks 1 and 2, which require a single answer, display a single line for each subtask, with datapointID equal to 1 and 2, respectively.