| **You can download the initial exercise file from [link](https://quera.org/contest/assignments/103149/download_problem_initial_project/356095/).** |
| ------------------------------------------------------------------------------ |
In the year 2142, the dark, underground megacity of "Neo-Veridia" is on the brink of a major financial crisis. NeonCorp is the city's largest technology and cybernetics holding, granting "Quantum Credit" (QC) loans to citizens so they can afford neural chips and biological upgrades.
But a disaster has occurred! NeonCorp's legacy AI evaluation system has been hacked by cyber hackers, and now citizens who have no intention of repaying are looting the company's financial credits. Meanwhile, NeonCorp's executives discovered that the company's previous evaluator, who was responsible for approving loans, was approving or rejecting applications entirely by chance, based solely on the physical appearance of the applicants! He was immediately fired and transferred to the organic recycling department, and now the threat of bankruptcy looms over the NeonCorp empire.
Now, NeonCorp wants one thing from you: design an intelligent, multi-table model that predicts the repayment status of financial contracts (loans) in the exact second of the request, based on the complete behavioral and transactional history of the citizens. NeonCorp's data extraction team has extracted the complete history of Nexus nodes (user accounts) and payment systems in the form of several relational tables and provided them to you. Your task is to save the company from a financial collapse!
| **target** | **Contract Status** |
| ---------- | --------------------------------------------- |
| 0 | Terminated and repaid contract |
| 1 | Terminated contract with incomplete repayment |
| 2 | Active contract with no registered issues |
| 3 | Active contract with debt or repayment issues |
For each `loan_id` in `test.csv`, you must predict exactly one of the values `{0, 1, 2, 3}`.
| **File** | **Primary Key** | **Description** |
| ----------------------- | --------------- | ---------------------------------------------------------- |
| `train.csv` | `loan_id` | Training loans along with the `target` column |
| `test.csv` | `loan_id` | Test loans without the target column |
| `account.csv` | `account_id` | Account, district, billing frequency, and opening date |
| `client.csv` | `client_id` | Client's gender, birth date, and district |
| `disp.csv` | `disp_id` | Client-account relationship and access type |
| `trans.csv` | `trans_id` | Transaction history, amount, balance, and transfer details |
| `order.csv` | `order_id` | Standing orders for the account |
| `card.csv` | `card_id` | Cards connected to account accesses |
| `district.csv` | `district_id` | Demographic and economic indicators of the district |
| `sample_submission.csv` | `loan_id` | Sample of a valid output format |
The relationship between the tables is also as follows:
| **Source Table and Column** | **Destination Table and Column** |
| -------------------------------------- | -------------------------------- |
| `train.account_id` / `test.account_id` | `account.account_id` |
| `account.district_id` | `district.district_id` |
| `disp.account_id` | `account.account_id` |
| `disp.client_id` | `client.client_id` |
| `client.district_id` | `district.district_id` |
| `card.disp_id` | `disp.disp_id` |
| `trans.account_id` | `account.account_id` |
| `order.account_id` | `account.account_id` |
The `date` column in `train.csv` and `test.csv` is the loan date. When creating features for a loan, only information that was available prior to that loan's date is permitted. To use transactions, the following condition must be met:
Code snippet
```
trans.date < loan.date
```
As a result, a transaction recorded simultaneously with or after the loan date must not be used in the features of that loan. The account opening date must also be prior to the loan date. The `card.csv` and `order.csv` tables do not have separate validity periods and should be interpreted as snapshot information.
### **Output**
To evaluate your system, you must predict the final status of the contracts present in `test.csv`. Your output must be a text or CSV file containing two columns named `contract_id` and `prediction`. The prediction column must contain numerical classes (0, 1, 2, or 3).
Code snippet
```
loan_id,target
10045,2
10046,0
10047,3
10048,1
...
```
### **Evaluation Method and Financial Penalties**
## **Problem Evaluation**
To evaluate this problem and your model, we use the following "cost matrix". In this problem, due to financial risks, correct predictions have no penalty (0), and every type of prediction error carries a different penalty weight (based on the severity of the loss for the business). Your goal is to train a model that minimizes fatal errors.
| **Actual Class \ Prediction** | **0 (Successful Settlement)** | **1 (Default/No Repayment)** | **2 (Regular Active)** | **3 (In Debt & Critical)** |
| ----------------------------- | ----------------------------- | ---------------------------- | ---------------------- | -------------------------- |
| **0 (Successful Settlement)** | 0 | 20 | 5 | 20 |
| **1 (Default/No Repayment)** | 100 | 0 | 100 | 5 |
| **2 (Regular Active)** | 5 | 20 | 0 | 20 |
| **3 (In Debt & Critical)** | 100 | 5 | 100 | 0 |
**Final Score Calculation Formula:**
$$\text{Final Score} = 100 \times \max\left(0, 1 - \frac{\text{Model Penalty}}{\text{Baseline Penalty}}\right)$$
%align_left_start%
+ **Model Penalty:** Total penalties generated by your model's predictions.
+ **Baseline Penalty:** Total penalties of the baseline model.
%align_end%
Financial penalties are considered based on the following damage matrix:
+ **Rejecting a good customer (Missed opportunity):** If a loan is genuinely without issue (Class 0 or 2) but your model predicts it as critical or default (Class 1 or 3), the company loses the customer. **(Penalty: 20 QC)**
+ **Approving a default customer (Heavy loss):** If a loan is genuinely default or critical (Class 1 or 3) but your model predicts it as without issue (Class 0 or 2), the company loses all the money. **(Heavy penalty: 100 QC)**
+ **Timing mistake (Administrative error):** If you predict an active loan as terminated or vice versa (error between Class 0 and 2, or error between Class 1 and 3). **(Minor penalty: 5 QC)**
+ **Perfectly correct prediction:** No damage. **(Penalty: 0 QC)**