You have to predict the total forest fire size for each state, for each month, from 2011 until 2015. The evaluation metric is as follows: 

$$
\text{Score} = \frac{1}{N} \sum_{i=1}^{N} \min \Big( \Big|\log \Big(\frac{\overset{\wedge}{y}_i}{y_i}\Big)\Big|, 10 \Big)
$$

**Where:**  
- \\(N\\): total number of predictions
- \\(\overset{\wedge}{y}_i\\): predicted fire size for instance i
- \\(y_i\\): ground truth fire size

The goal is to minimize the scoring metric.


## Submission File Format

Your submission file should be a CSV containing the columns 'ID', 'month', 'STATE', and 'total_fire_size'.

- **ID:** A unique identifier for each test instance. You can create this column by assigning sequential numbers to each row.
- **month:** The month that you're predicting for, in format: 'YYYY-MM'
- **STATE:** A 2 letter abbreviation of the state name.
- **total_fire_size:** The size of the fire.

Below is an example of how to create the `ID` column in a Pandas DataFrame and ensure it is the first column, along with saving the file as `submission.csv`.

### Example Code

```python
import pandas as pd

# Assume submission_df is your DataFrame with the predictions in a column called 'TARGET'
# For example, submission_df might have been generated from your predictions:
# submission_df = pd.DataFrame({'TARGET': predictions})

# Create an ID column by assigning a unique integer to each row
submission_df['ID'] = range(len(submission_df))

# Reorder the DataFrame so that 'ID' is the first column
cols = ['ID'] + [col for col in submission_df.columns if col != 'ID']
submission_df = submission_df[cols]

# Preview the DataFrame to check the columns and order
print(submission_df.head())

# Save the DataFrame as a CSV file with a header
submission_df.to_csv('submission.csv', index=False)
print("Submission file saved as 'submission.csv'.")
```

## Evaluation metric in python code

The metric code looks like this:
```python
import numpy as np
import pandas as pd

def score(solution: pd.DataFrame, submission: pd.DataFrame) -> float:
    """
    Computes the Kaggle competition metric for predicting forest fire sizes.

    Parameters:
        solution (pd.DataFrame): A DataFrame with columns ["ID", "STATE", "month", "total_fire_size"].
        submission (pd.DataFrame): A DataFrame with columns ["ID", "STATE", "month", "total_fire_size"],
                                  where "ID" is formatted as "STATE_month".

    Returns:
        float: The mean of min(abs(log(pred / true)), 10) over all valid entries.
    """
    # Merge submission with ground truth on (STATE, month)
    merged = solution.merge(submission, on=["STATE", "month"], how="left", suffixes=("_true", "_pred"))

    # Identify missing predictions and assign a score of 10 for them
    missing_pred_mask = merged["total_fire_size_pred"].isna()
    zero_pred_mask = merged["total_fire_size_pred"] <= 0

    # Compute log error where prediction is valid
    valid_pred_mask = ~missing_pred_mask & ~zero_pred_mask
    log_errors = np.full(len(merged), 10.0)  # Default to max penalty

    # Compute actual log error only for valid predictions
    log_errors[valid_pred_mask] = np.abs(np.log(merged.loc[valid_pred_mask, "total_fire_size_pred"] /
                                                 merged.loc[valid_pred_mask, "total_fire_size_true"]))

    # Apply the min operation
    final_scores = np.minimum(log_errors, 10)

    # Return the mean score (if no valid entries, return 10)
    return np.mean(final_scores) if len(final_scores) > 0 else 10.0
```