Weather Prediction using Machine Learning (Python)

Weather is a important aspect of a person life as it can help us to know when it will rain and when it will be sunny. Weather forecasting is the attempt to predict the weather condition at some future time and the weather conditions that may be expected. The climatic conditions parameters are based on the temperature, pressure, humidity, dewpoint, rainfall, precipitation, wind speed and size of data set. The parameters temperature, pressure, humidity, dew point, precipitation, rainfall is only considered for experimental analysis.

Firstly, the data is trained. For this prediction, we will be using Auto Regression model. For the project we will using Python, Matplotlib, Pandas, Scikit-learn and Jupyter Notebook.

Let’s earn some knowledge about programming language, libraries and editor used to build this project.

Weather forecasting is simply the prediction of future weather based on different parameters of the past like temperature, humidity, dew, wind speed and direction. Weather Prediction is an important factor affecting people lives. Once data is taken, it is trained. The heart of this project is the algorithm which is used to predict the weather using these data. The more parameters considered, the higher the accuracy. This project can help many people finding the weather of tomorrow.

The project simply uses temperature for training the data. Here these data are then trained using Auto-Regressive model for the prediction.

There are many research papers that have been published related to predicting the weather. A paper was published. That paper proposes a modern method to develop a service oriented architecture for the weather information systems which forecast weather using these data mining techniques. This can be carried out by using artificial neural network and decision tree algorithm data collected in specific time. Algorithm has presented the best results to generate classification rules for the mean weather variables. The results showed that these data mining techniques can be enough for weather forecasting . Another paper was published on ‘Analysis on The Weather Forecasting and Techniques’ where they decided that artificial neural network and concept of fuzzy logic provides a best solution and prediction comparatively . They decided to take temperature, humidity, pressure, wind and various other attributes into consideration.

Training a model is the process of iteratively improving your prediction equation by looping through the dataset multiple times, each time updating the weight and bias values in the direction indicated by the slope of the cost function (gradient). Training is complete when we reach an acceptable error threshold, or when subsequent training iterations fail to reduce our cost.

Functional Requirements

Flow Chart

Flow Chart of our project


Graph of Trained and Predicted Data

Data Collection

Dataset of our project


The prediction system works properly. The values of all the attributes were properly pre-processed. After all the pre-processing was completed, model was implemented and it was trained using train data. Our accuracy was found to be around .


The weather prediction done using auto-regressive model and are very essential for improving the future performance for the people. For predicting the weather, the auto-regressive model was applied to the datasets of the weather. We made a model to predict the weather using some selected input variables collected from Kaggle. The problem with current weather scenario is that we are not able to prepare our self and not able to do some important works. So, for knowing the weather scenario at high accuracy considering every factor that affects in the weather scenario, this model is created.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store