Author Topic: Developing short-term weather forecasts  (Read 171 times)

0 Members and 1 Guest are viewing this topic.

Offline Paolo

  • Member
  • *
  • Posts: 4
Developing short-term weather forecasts
« on: March 12, 2025, 03:58:41 AM »
Hi everyone,
I'm developing a program that can be used to make short-term weather forecasts.
I'm writing this post to ask if there is anyone else who has or is developing something similar.
It would be helpful to exchange ideas and opinions about it.

Having access to an infinite amount of data at a time available on the internet, I am undecided, for example, which significant data to use.
The ones I'm using are described below.

The program is an application that predicts weather conditions for different hours in the future (specifically +3 hours, +6 hours, +9 hours and +12 hours). It uses a machine learning model to analyze historical weather data and make predictions based on inputs provided by the user.
Both ground data, collected by my weather station, and upper data from the DWD ICON model are entered

The user (me) enters data such as:
• Barometric pressure
• Pressure trend over the last 12 hours
• Wind direction and intensity last 3 hours
• Temperature and humidity trend last 6 hours
• Current weather conditions

• Temperature 850 hpa,700 hpa,500 hpa
• Humidity 850 hpa,700 hpa,500 hpa
• Wind direction 850 hpa,700 hpa,500,300 hpa
• Wind speed 300 hpa

The program returns:
• The weather forecast for +3h, +6h, +9h and +12h.
• A percentage of efficiency for each forecast, which indicates how confident the model is in its prediction.

The program is written in Python. It uses several Python libraries to run:
1. tkinter:
o A library for creating graphical user interfaces (GUIs) in Python.
o Used to build the application window, input fields, and buttons.
2. pandas:
o A library for data manipulation and analysis.
o Used to load weather data from an Excel file and prepare it for analysis.
3. scikit-learn:
o A library for machine learning.
o Contains tools for training models, making predictions, and evaluating accuracy.
o In the program, it is used to:
 Train a decision tree model (DecisionTreeClassifier).
 Optimize model parameters with GridSearchCV.
 Make predictions and calculate associated probabilities.
4. LabelEncoder:
o A scikit-learn tool to encode categorical variables (e.g. "Clear", "Rain",Snow,Snowstorm) into numbers.
o Used to transform weather conditions in text format into numbers, so that the model can process them.
5. train_test_split:
o A scikit-learn function to split the data into two sets:
 Training set: Used to train the model.
 Test set: Used to evaluate the accuracy of the model.
6. accuracy_score:
o A scikit-learn metric to calculate the accuracy of the model's predictions.

The program loads historical weather data from an Excel file.
o A The program uses a decision tree (DecisionTreeClassifier) ​​to train four separate models, one for each time horizon (+3h, +6h, +9h, +12h).
o The model parameters are optimized using GridSearchCV, which searches for the best combination of parameters to maximize accuracy.
o The user enters current weather data through a graphical window.
o The data is passed to the model, which returns forecasts for +3h, +6h, +9h and +12h.
o The program uses predict_proba to calculate the probability associated with each forecast.
o The forecasts and efficiency percentages are displayed in the graphical interface.

The data I have available are still very few (a considerable archive is needed...) and currently the forecasts still have a percentage of unreliability.

Has anyone done something similar? I'd love to exchange ideas and opinions.


 

anything