Final Project Report
Final Project Report
Final Project Report
FORECASTING
A PROJECT REPORT
Submitted by
of
BACHELORS OF TECHNOLOGY
in
INFORMATION TECHNOLOGY
CERTIFICATE
INFORMATION TECHNOLOGY
1
Project Report: Machine Learning Model for Weather Forecasting
ACKNOWLEDGEMENT
2
Project Report: Machine Learning Model for Weather Forecasting
TABLE OF CONTENTS
TITLE
ABSTRACT 4
BACKGROUND 4
OBJECTIVE 4
1.0 INTRODUCTION 5
1.1 Introduction 5
2.0 METHODOLOGY 7
4.0 EXPERIMENTATION 9
5.0 RESULT AND DISCUSSION 10
5.1 Multiple Linear Regression 10
6.0 CONCLUSION 13
3
Project Report: Machine Learning Model for Weather Forecasting
ABSTRACT
Traditionally, climate assessment has been performed reliably by treating the environment
as a liquid. The current wind condition is being observed. The future state of the
environment is recorded by understanding thermodynamics and the numerical position of
the liquid elements. Nevertheless, this traditional arrangement of differential conditions as
observed by physical models is at times unstable under oscillating effects and uncertainties
when estimating the underlying states of air. This indicates an insufficient understanding
of environmental variations, so it limits climate forecasts to 10-day periods because climate
projections are essentially unreliable. But machine learning is moderately hearty for most
barometric destabilizing effects compared to traditional techniques. Another favorable
position of machine learning is that it does not depend on the physical laws of
environmental processes.
Background
For the current situation, India observatory conducts traditional weather forecasting. There
are four common methods to predict the weather. The first method is the climatology
method that is reviewing weather statistics gathered over multiple years and calculating the
averages. The second method is an analog method that is to find a day in the past with
weather similar to the current forecast. The third method is the persistence and trends
method that has no skill to predict the weather because it relies on past trends. The fourth
method is numerical weather prediction the is making weather predictions based on
multiple conditions in the atmosphere such as temperatures, wind speed, high-and low-
pressure systems, rainfall, snowfall, and other conditions. So, there are many limitations of
these traditional methods. Not only it forecasts the temperature in the current month at
most, but also it predicts without using machine learning algorithms. Therefore, my project
is to increase the accuracy and predict the weather in the future for at least one month by
applying machine learning techniques
Objective (Brief)
Purpose of this project is to predict the temperature using different algorithms like linear
regression, random forest regression, and Decision tree regression. The output value should
be numerically based on multiple extra factors like maximum temperature, minimum
temperature, cloud cover, humidity, and sun hours in a day, precipitation, pressure and
wind speed.
4
Project Report: Machine Learning Model for Weather Forecasting
1. INTRODUCTION
Weather prediction is the task of predicting the atmosphere at a future time and a given
area. This has been done through physical equations in the early days in which the
atmosphere is considered fluid. The current state of the environment is inspected, and the
future state is predicted by solving those equations numerically, but we cannot determine
very accurate weather for more than 10 days and this can be improved with the help of
science and technology.
There are numerous kinds of machine learning calculations, which are Linear Regression,
Polynomial Regression, Random Forest Regression, Artificial Neural Network, and
Recurrent Neural Network. These models are prepared dependent on the authentic
information gave of any area. Contribution to these models is given, for example, if
anticipating temperature, least temperature, mean air weight, greatest temperature, mean
dampness, and order for 2 days. In light of this Minimum Temperature and Maximum
Temperature of 7 days will be accomplished.
Machine Learning
Machine learning is relatively robust to perturbations and does not need any other physical
variables for prediction. Therefore, machine learning is a much better opportunity in the
evolution of weather forecasting. Before the advancement of Technology, weather
forecasting was a hard nut to crack. Weather forecasters relied upon satellites, data model’s
atmospheric conditions with less accuracy. Weather prediction and analysis have vastly
increased in terms of accuracy and predictability with the use of the Internet of Things, for
the last 40 years. With the advancement of Data Science, Artificial Intelligence, Scientists
now do weather forecasting with high accuracy and predictability.
5
Project Report: Machine Learning Model for Weather Forecasting
USE OF ALGORITHMS:
There are different methods of foreseeing temperature utilizing Regression and a variety
of Functional Regression, in which datasets are utilized to play out the counts and
investigation. To Train, the calculations 80% size of information is utilized and 20% size
of information is named as a Test set. For Example, if we need to anticipate the temperature
of Kanpur, India utilizing these Machine Learning calculations, we will utilize 8 Years of
information to prepare the calculations and 2 years of information as a Test dataset. The as
opposed to Weather Forecasting utilizing Machine Learning Algorithms which depends
essentially on reenactment dependent on Physics and Differential Equations, Artificial
Intelligence is additionally utilized for foreseeing temperature: which incorporates models,
for example, Linear regression, Decision tree regression, Random forest regression. To
finish up, Machine Learning has enormously changed the worldview of Weather estimating
with high precision and predictivity. What's more, in the following couple of years greater
progression will be made utilizing these advances to precisely foresee the climate to avoid
catastrophes like typhoons, Tornados, and Thunderstorms.
6
Project Report: Machine Learning Model for Weather Forecasting
2. METHODOLOGY
The dataset utilized in this arrangement has been gathered from Kaggle which is “Historical
Weather Data for Indian Cities” from which we have chosen the data for “Kanpur City”.
The dataset was created by keeping in mind the necessity of such historical weather data
in the community. The datasets for the top 8 Indian cities as per the population. The dataset
was used with the help of the worldweatheronline.com API and the wwo_hist package. The
datasets contain hourly weather data from 01-01-2009 to 01-01-2020. The data of each city
is for more than 10 years. This data can be used to visualize the change in data due to global
warming or can be used to predict the weather for upcoming days, weeks, months, seasons,
etc.
Note: The data was extracted with the help of worldweatheronline.com API and we cannot
guarantee the accuracy of the data.
The main target of this dataset can be used to predict the weather for the next day or week
with huge amounts of data provided in the dataset. Furthermore, this data can also be used
to make visualization which would help to understand the impact of global warming over
the various aspects of the weather like precipitation, humidity, temperature, etc.
In this project, we are concentrating on the temperature prediction of Kanpur city with the
help of various machine learning algorithms and various regressions. By applying various
regressions on the historical weather dataset of Kanpur city we are predicting the
temperature like first we are applying Multiple Linear regression, then Decision Tree
regression, and after that, we are applying Random Forest Regression.
7
Project Report: Machine Learning Model for Weather Forecasting
8
Project Report: Machine Learning Model for Weather Forecasting
3. EXPERIMENTATION
The record has just been separated into a train set and a test set. Each information has just
been labeled. First, we take the trainset organizer. We will train our model with the help of
histograms and plots. The feature so extracted is stored in a histogram. This process is done
for every data in the train set. Now we will build the model of our classifiers. The classifiers
which we will take into account are Linear Regression, Decision Tree Regression, and
Random Forest Regression. With the help of our histogram, we will train our model. The
most important thing in this process is to tune these parameters accordingly, such that we
get the most accurate results. Once the training is complete, we will take the test set. Now
for each data variable of the test set, we will extract the features using feature extraction
techniques and then compare its values with the values present in the histogram formed by
the train set. The output is then predicted for each test day. Now in order to calculate
accuracy, we will compare the predicted value with the labeled value. The different metrics
that we will use confusion matrix, R2 score, etc.
9
Project Report: Machine Learning Model for Weather Forecasting
10
Project Report: Machine Learning Model for Weather Forecasting
11
Project Report: Machine Learning Model for Weather Forecasting
12
Project Report: Machine Learning Model for Weather Forecasting
5. CONCLUSION
All the machine learning models: linear regression, various linear regression, decision tree
regression, random forest regression were beaten by expert climate determining
apparatuses, even though the error in their execution reduced significantly for later days,
demonstrating that over longer timeframes, our models may beat genius professional ones.
Talking about Random Forest Regression, it proves to be the most accurate regression
model. Likely so, it is the most popular regression model used, since it is highly accurate
and versatile. Below is a snapshot of the implementation of Random Forest in the project.
Weather Forecasting has a major test of foreseeing the precise outcomes which are utilized
in numerous ongoing frameworks like power offices, air terminals, the travel industry
focuses, and so forth. The trouble of this determining is the mind-boggling nature of
parameters. Every parameter has an alternate arrangement of scopes of qualities.
13