Checklist Bulgaria selection 2025 IOAI Team Selection · Task 1
Air Temperature Forecasting
Bulgarian title: Предвиждане на температурата на атмосферния въздух
Forecast daily mean temperature in Delhi with a Random Forest regressor using values from previous days.
The task
The data are daily weather records for Delhi, India, from 1 January 2013 to 24 April 2017: date, meantemp, humidity, wind_speed (km/h) and meanpressure. The training file covers 2013-2016; the test file covers 1 January - 24 April 2017 and omits meantemp.
Contestants must train a Random Forest Regressor that predicts the temperature from the measured values of previous days, considering which temporal features to extract and which forest parameters to optimise and how.
Abridged and translated by SOTA from the official Bulgarian materials. The official statement has the exact rules, and it wins wherever this summary differs.
In English
This task was published in Bulgarian. SOTA translated its 2 files into English on 17 September 2026. Only the words changed in the notebooks: markdown, code comments, messages and printed output. The code, file names and paths are the original's, so a translated notebook runs with the original data.
- Task notebook Bulgarian original of Task notebook
- Solution by Reni Paskaleva Bulgarian original of Solution by Reni Paskaleva
Read the task notebook in English
Task: Air Temperature Forecasting
Data
The given CSV files provide atmospheric data from 1 January 2013 to 24 April 2017 for the city of Delhi, India. The data contain the following parameters:
- date - the date in YYYY-MM-DD format,
- meantemp - the mean temperature for the day,
- humidity - the air humidity,
- wind_speed - the wind speed, measured in km/h,
- meanpressure - the mean atmospheric pressure.
The data are split into a training set and a test set.
Training set
daily_climate_train.csv - contains data from 1 January 2013 to 31 December 2016.
Test set
daily_climate_temp.csv - contains data from 1 January 2017 to 24 April 2017. It does not contain the variable meantemp, which is to be predicted.
Task
The goal of the task is to train a regressor based on a random forest (Random Forest Regressor) that predicts the temperature on the basis of the measured values of the indicators from the previous days.
When composing your solution, consider:
- What time-based features can we extract from the data?
- Which parameters of the random forest should we optimise, and how?
Scoring
To score the solution we will use the mean squared error (MSE - mean square error). For this metric, lower values mean a better model.
import kagglehub
# Download latest version
path = kagglehub.dataset_download("melaniaberbatova/time-series-data")
print("Path to dataset files:", path)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import TimeSeriesSplit
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import make_scorer
import os
os.listdir(path)
df_train = pd.read_csv(os.path.join(path,"daily_climate_train.csv"))
df_train.head(3)
df_train.tail(3)
# General statistics of the data
df_train.describe()
# Correlation matrix
correlation_mat = df_train.select_dtypes('number').corr()
fig, ax = plt.subplots()
sns.heatmap(correlation_mat, annot = True, ax=ax)
plt.show()
# Distributions and joint distributions of the data
sns.pairplot(df_train)
df_test = pd.read_csv(os.path.join(path,"daily_climate_test.csv"))
df_test.head()
# Start your solution here
# Feature construction
# Add additional features to the data here
# Construction of the training set
# Do not change this code!
# Removing the date column, since RandomForestRegressor does not support the format
df_train.drop(columns='date', inplace=True)
X_train = df_train.drop('meantemp', axis=1)
y_train = df_train['meantemp']
# Splitting the data for cross-validation
tscv = TimeSeriesSplit(n_splits=5)
# Creating a grid for the hyperparameter search
param_grid = {
'n_estimators': [50, 100, 200],
# change the values and/or add more hyperparameters here
}
# Initialising the scoring function and the model
# Do not change this code!
scorer = make_scorer(mean_squared_error, greater_is_better=False)
rf = RandomForestRegressor(random_state=42, n_jobs=-1)
# Hyperparameter tuning
grid_search = GridSearchCV(estimator=rf,
param_grid=param_grid,
cv=tscv,
scoring=scorer,
n_jobs=-1,
verbose=1)
grid_search.fit(X_train, y_train)
# Model selection
# Do not change this code!
model = grid_search.best_estimator_
print(f"Best parameters: {grid_search.best_params_}")
# Add the same features to the test set as well
# The number of columns in X_test must be the same as in X_train
X_test = df_test.copy()
# Prediction on the test set
# Do not change this code!
X_test = df_test.copy()
X_test.drop(columns='date', inplace=True)
predictions = model.predict(X_test)
# Saving the predictions to the file submission_time_series.csv
# Do not change this code!
submission_df = pd.DataFrame({'predictions': predictions})
submission_df.to_csv('submission_time_series.csv', index=False)
Translated by SOTA. The Bulgarian original is the official version and wins wherever the two differ. The solution is a sample solution by a member of the 2025 national team. The statement names the test file daily_climate_temp.csv, but the file in the original folder is daily_climate_test.csv. If you organise this olympiad and would like the translation removed, email [email protected] and we will take it down.
At a glance
- You get
daily_climate_train.csvanddaily_climate_test.csv.- You submit
- Predictions for the test period (the notebook writes
submission_time_series.csvwith a 'predictions' column). - Scoring
- Mean squared error (lower is better).
- Rules
- The model must be a Random Forest Regressor.
- Format
- Bulgarian IOAI 2025 team selection, Day 1, Task 1. Dates and format are not published in the repository.