PPR G-19 (Corrected)
PPR G-19 (Corrected)
Introduction
Weather forecasting is the task of predicting the state of the atmosphere at a future time and a
specified location. Traditionally, this has been done through physical simulations in which
the atmosphere is modeled as a fluid. The present state of the atmosphere is sampled, and the
future state is computed by numerically solving the equations of fluid dynamics and
thermodynamics. However, the system of ordinary differential equations that govern this
physical model is unstable under perturbations, and uncertainties in the initial measurements
of the atmospheric conditions and an incomplete understanding of complex atmospheric
processes restrict the extent of accurate weather forecasting to a 10 day period, beyond which
weather forecasts are significantly unreliable. Machine learning, on the contrary, is relatively
robust to perturbations and doesn’t require a complete understanding of the physical
processes that govern the atmosphere. Therefore, machine learning may represent a viable
alternative to physical models in weather forecasting.
Machine learning is the ability of computers to learn without being explicitly programmed. It
allows machines to find hidden patterns and insights. In supervised learning, we build a
model based on labeled training data. The model is then used for mapping new examples. So,
based on the observed weather patterns from the past, a model can be built and used to
predict the weather.
This project work focuses on solving the weather prediction anomalies and in-efficiency
based on linear regression algorithms and to formulate an efficient weather prediction model
based on the linear regression algorithms.
In a developing country and an economy like India where major population is dependent
on agriculture, weather conditions play an important and vital role in economic growth
of the overall nation. So, weather prediction should be more precise and accurate.
Weather parameters are collected from the open source . The data used in this project is
of the years 2013-2019. The programming language used is ‘Python’. Fig. 1.1 visualizes
the system in the form of a block diagram.
1
Fig 1.1 System Block Diagram
The weather is predicted using various indices like temperature, humidity and dew-point.
Temperature is the measure of hotness or coldness, generally measured using a thermometer.
Units the temperatures most frequently used are Celsius and Fahrenheit. We have used
maximum and minimum temperature values along with normal temperature as different index
values for prediction of the weather.
Humidity is the quantity of water vapor present in the atmosphere. It is a relative quantity.
Dew point is the temperature of the atmosphere (which varies according to pressure and
humidity) below which water droplets begin to condense and dew is formed.
Linear regression is the most basic and frequently used predictive model for analysis.
Regression estimates are generally used to describe the data and elucidate relationship
between one or more independent and dependent variables. Linear regression finds the best-
fit through the points, graphically. The best-fit line through the points is known as the
regression line
2
Fig.1.2. Example of regression line
Fig. 1 is an example of the best-fit line. Here, the line can be straight or curved depending on
the data. The best-fit line can also be a quadratic or polynomial which gives us better answer
to our questions.
1.3.2 JavaScript
1.3.3 Json
JSON (JavaScript Object Notation) is a lightweight format that is used for data interchanging.
Itis based on a subset of JavaScript language. It has been the preferred format because it is
much more lightweight.
2) An ordered list of values. In most languages, this is realized as an array, vector, list,
or sequence.
3
Fig 1.3 JSON Object Diagram
1.3.4 ReactJS
ReactJS is a declarative, efficient, and flexible JavaScript library for building reusable
UI components. It is an open-source, component-based front-end library which is
responsible only for the view layer of the application. It was initially developed and
maintained by Facebook and later used in its products like WhatsApp & Instagram.
The main objective of ReactJS is to develop User Interfaces (UI) that improves the
speed of the apps. It uses virtual DOM (JavaScript object), which improves the
performance of the app. The JavaScript virtual DOM is faster than the regular DOM.
We can use ReactJS on the client and server-side as well as with other frameworks. It
uses component and data patterns that improve readability and helps to maintain larger
apps.
Adobe After Effects is a digital visual effect, motion graphics, and compositing
application developed by Adobe Systems and used in the post-production process of
film making and television production. Among other things, After Effects can be used
for keying, tracking, compositing, and animation. It also functions as a very basic non-
linear editor, audio editor, and media transcoder.
After Effects has extensive plug-in support; a broad range of third-party plug-ins are
available. A variety of plug-in styles exist, such as particle systems for realistic effects
for rain, snow, fire, etc.
With or without third-party plug-ins, After Effects can render 3D effects. Some of these
3D plug-ins use basic 2D layers from After Effects. In addition to 3D effects, there are
plug-ins for making video look like film or cartoons; simulating fire, smoke, or water;
particle systems; slow motion; creating animated charts, graphs, and other data
visualization; calculating the 3Dmovement of a camera in a 2D video shot; eliminating
flicker, noise, or rigging lines; translating timelines from FCP or Avid; adding high-end
color correction; and other workflow improvements and visual effects
4
1.3.6 Python
Python is an interpreted, object-oriented, high-level programming language with
dynamic semantics. Its high-level built in data structures, combined with dynamic
typing and dynamic binding, make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax emphasizes readability and
therefore reduces the cost of program maintenance. Python supports modules and
packages, which encourages program modularity and code reuse. The Python interpreter
and the extensive standard library are available in source or binary form without charge
for all major platforms, and can be freely distributed.
5
CHAPTER -2
Problem Identification
Weather prediction is a useful tool for informing populations of expected weather conditions.
Weather prediction is a complex topic and poses significant variation in practice. We will
attempt to understand and implement a weather prediction application using the linear
regression.
● Weather forecasts are made by collecting as much data as possible about the current
state
of the atmosphere (particularly the temperature, humidity and wind) to determine how
the
atmosphere evolves in the future.
● However, the chaotic nature of the atmosphere makes the forecasts less accurate as
the range
of the forecast increases.
● The output from this model can be used the weather forecast as alternative.
The product is developed using API server. The back-end database are CSV files on the basis
of that,
the prediction takes place. The product is a general-purpose application software in which
any user can gather the predicted information. The linear regression is used that predicts the
weather based on the previous analysis of a data
Major Components:
● Data Collection: The feeding historical data to the system, this could be from specific
region.
● Data Cleaning: Under this component the data like the missing data, duplicated data is
found and bad data is weed out
● Data selection: Under this stage, relevant data related to analysis is retrieved and
classified under 6 attributes.
6
2.4 User Documentation
The product is a general-purpose application software where any user can access the software
to gather information about the weather based on a current or a previous data analysis. In this
product the software makes a request to the server to access the current dataset through which
the data is analyzed using various machine learning algorithms.
2.6.1 Actors
● User
● Historical data provider
● Administrator
● System shall obtain and display confidence value for each prediction given to user.
7
● System shall allow for users to get prediction for weather within almost two mouse
clicks.
● System should ensure that features that do not require a user to be logged in.
The proposed software that we are going to develop will be used as the general-
purposeapplication software. Therefore, it is expected that the database would perform
functionally allthe requirements that are specified by the user.
The database may get crashed at any certain time due to virus or operating system
failure.Therefore, it is required to take the database backup
We are going to develop a secured database for the user. Software Quality Attributes. The
Quality of the database is maintained in such a way so that it can be very user friendly to all
the users.
The development of the system will be constrained by the availability of required software
such
as web servers, dataset and development tools.
8
CHAPTER -3
Design
Among modeling languages Unified Modeling Language (UML) has become most popular.
UML is commonly used in the design and implementation of any system and software
architectures. To achieve functional and non functional requirements of the system, UML
model helps. In order to initiate the programming phase of building software, UML tools help
in the creation of source code from UML diagram. The main objective of this paper to model
a Weather Prediction System (Linear Regression approach) using UML. Weather prediction
is a challenging area. The future weather conditions are predicted by trained regression
model. In this chapter, we proposed a UML model for Weather Prediction using linear
regression which provide a technique for predicting weather. This proposed enhanced method
for weather prediction has advantages over other techniques
3.1 Introduction
The proposed System using an enhanced approach is tested using the dataset of last 6 years
from (2013-2019). The results are compared with previous methods results. The proposed
enhanced method for weather prediction has advantages over the traditional techniques. This
model produces the most accurate forecasts in comparison with previous techniques. This
system can help the meteorologist to predict the future weather easily with accuracy.
The system is developed in python along with JavaScript. Daily data sets of last 6 years
(2013-2019) has been fetched to train our model. The system takes input from the datasets
and produces the result.
9
3. Selection of the features of dataset
4. Train Model
5. Use the model to predict results.
An interaction between a user and a system is described by use case diagram. Use case
diagrams describe what a system does from the standpoint of an external observer. The
emphasis is on what a system does rather than how. Use case diagrams are closely connected
to scenarios. A scenario is an example of what happens when someone interacts with the
system. A use case diagram is a collection of actors, use cases, and their communications.
For initial development we can use this use case. In this use case diagram we can see
following use cases and actor. Use cases are self explanatory and they represent the main
functions of Weather Prediction System.
3.3 Ui Design
3.4 Code
3.4.1 main.jsx
10
axios.defaults.baseURL = "https://api.openweathermap.org/data/2.5";
ReactDOM.render(
<React.StrictMode>
<ChakraProvider>
<ReduxProvider store={store}>
<App />
</ReduxProvider>
</ChakraProvider>
</React.StrictMode>,
document.getElementById("root")
);
3.4.2 details.jsx
import {
Box,
Container,
Flex,
Grid,
Heading,
Icon,
Text,
useToast,
} from "@chakra-ui/react";
11
weatherData: data,
forcastData,
isError,
} = useSelector((state) => state, shallowEqual);
const [isRotate, setIsRotate] = useState(false);
const dispatch = useDispatch();
const toast = useToast();
useEffect(() => {
let weather = getItem("weather");
!weather && dispatch(getWeatherByLocation(toast));
}, []);
return isLoading ? (
<Loading />
) : isError ? (
<Error />
):(
<>
<Box maxW={"1400px"} m={"20px auto 5px"} p={"20px"}
minH={"550px"}>
<Grid
gridTemplateColumns={[
"100%",
"repeat(2, 1fr)",
"repeat(2, 1fr)",
"30% 27.5% 38%",
]}
gap={"30px"}
>
<Newbox>
<Box color={"#5e82f4"} p={"20px"} textAlign={"center"}>
<Flex justify={"end"}>
<Icon
onClick={handleSyncData}
onAnimationEnd={() => {
setIsRotate(false);
}}
12
className={isRotate ? "iconRotate" : undefined}
cursor={"pointer"}
w={"23px"}
h={"23px"}
as={FaSyncAlt}
/>
</Flex>
<Heading>{data.name}</Heading>
<Heading fontSize={["100px", "120px", "120px", "100px",
"120px"]}>
{Math.round(data.main.temp - 273)}
<sup>o</sup>C
</Heading>
<Heading>{data.weather[0].main}</Heading>
</Box>
</Newbox>
<Newbox>
<Grid templateColumns={"50% 50%"} h={"100%"} p={"8px"}>
<Box py={"10px"} pl={"15%"}>
{[
"Felt Temp.",
"Humidity",
"Wind",
"Visibility",
"Max Temp.",
"Min Temp.",
].map((e, i) => (
<Text
key={i}
color={"#5e82f4"}
fontWeight={500}
mt={"15px"}
fontSize={"18px"}
>
{e}
</Text>
))}
</Box>
<Box borderRadius={"30px"} bg={"#5e82f4"} py={"10px"}
pl={"15%"}>
<NewText>
{celsius(data.main.feels_like)}
13
<sup>o</sup> C
</NewText>
<NewText>{data.main.humidity}%</NewText>
<NewText>{(data.wind.speed * 3.6).toFixed(2)} Km/h</NewText>
<NewText>{(data.visibility * 0.001).toFixed(2)} Km</NewText>
<NewText>
{celsius(data.main.temp_max)}
<sup>o</sup> C
</NewText>
<NewText>
{celsius(data.main.temp_min)}
<sup>o</sup> C
</NewText>
</Box>
</Grid>
</Newbox>
<Newbox>
<Map city={data.name} />
</Newbox>
</Grid>
<Grid
mt={"40px"}
templateColumns={[
"repeat(2, 1fr)",
"repeat(3, 1fr)",
"repeat(4, 1fr)",
"repeat(5, 1fr)",
"repeat(8, 1fr)",
]}
gap={"20px"}
>
{forcastData.map((e, i) => (
<Forcast key={i} data={e} />
))}
</Grid>
<div className="tagLine">
<p id="madeByG16">College Project Group 19.</p>
</div>
</Box>
</>
14
);
};
3.4.3 Api.js
3.4.4 ForcastModel.jsx
return (
<>
<Box onClick={onOpen} cursor={'pointer'} mt={'10px'}>
<Text color={'#5e82f4'} fontWeight={500} fontSize={'27px'}>
<Icon as={ImSun} /> {Math.round(data.temp.day)}<sup>o</sup>
C
</Text>
<Text color={'#5e82f4'} fontWeight={500} fontSize={'27px'}>
<Icon as={MdOutlineNightsStay} />
{Math.round(data.temp.night)}<sup>o</sup> C
</Text>
<Text color={'#5e82f4'} fontWeight={500} fontSize={'20px'}>
{data.weather[0].main}
</Text>
</Box>
15
<Modal isOpen={isOpen} onClose={onClose} >
<ModalOverlay />
<ModalContent>
<ModalHeader></ModalHeader>
<ModalCloseButton />
<ModalBody>
<Box p={'10px'}>
<Box p={'5px'} bg={'#5e82f4'} textAlign={'center'}
borderRadius={'30px'} mb={'20px'} >
<Text fontWeight={500} color={'white'}
fontSize={'18px'}>{date}</Text>
<Text fontWeight={500} color={'white'}
fontSize={'18px'}>{day}</Text>
</Box>
16
</Grid>
</Box>
</ModalBody>
<ModalFooter></ModalFooter>
</ModalContent>
</Modal>
</>
);
};
3.4.5 Navbar.jsx
return (
<Flex
width={"100%"}
p={"10px"}
minH={"70px"}
bgColor={"#e5e5f7"}
justifyContent={"center"}
flexDirection={["column", "row"]}
gap={["10px", "0px"]}
>
17
<Center px={"10px"}>
<Input
onKeyPress={({ key }) => {
key === "Enter" ? handleChnage() : undefined;
}}
onInput={(e) => {
setCity(e.target.value);
}}
value={city}
borderRadius={"15px 0px 0px 15px"}
bg={"white"}
_focus={{ border: "none" }}
placeholder="City"
/>
<Button
onClick={handleChnage}
borderRadius={"0px 15px 15px 0px"}
color={"white"}
bg={"#5e82f4"}
_hover={{ bg: "5e82f4" }}
>
Search
</Button>
</Center>
<Center px={"10px"}>
<Button
bg={"#5e82f4"}
_hover={{ bg: "5e82f4" }}
color={"white"}
w={"100%"}
borderRadius={"15px"}
leftIcon={<Icon w={"30px"} h={"30px"} as={HiLocationMarker} />}
onClick={handleLocationData}
>
Your Location Weather
</Button>
</Center>
</Flex>
);
};
18
3.4.6 Actions.jsx
19
dispatch(getDataError());
}
}
navigator.geolocation.getCurrentPosition(success, error);
}
} catch (err) {
console.log(err);
dispatch(getDataError());
myToast(toast, "City weather data doesn't exist", "error");
}
}
20
let payload = { weatherData, forcastData };
dispatch(getDataSuccess(payload));
setItem("weather", payload);
myToast(toast, "Data sync successfully", "success");
} catch (err) {
console.log(err);
dispatch(getDataError());
myToast(toast, "City weather data doesn't exist", "error");
}
}
21
CHAPTER -4
Testing
Testing is the process of evaluating a system or its component with the intent to find whether
it satisfies the specified requirement or not. Testing is executing a system in order to identify
any gaps, errors, or missing requirements in contrary to the actual requirements. Systems
should not be tested as a single, monolithic unit. The testing process should therefore proceed
in the stages where testing is carried out incrementally in conjunction with system
implementation. Errors in program components may come to light at a later stage of the
testing process. The process is therefore an iterative one with information being fed back
from later stage to earlier parts of the process. Following testing’s were done during the
course of our project.
Unit testing focuses verification efforts on the smaller unit of software design. Using the
detailed design description as a guide, important control paths are tested to uncover errors
within the boundary of the module. The relative complexity of the test and the error detected
as a result is limited by the constraint scope established for unit testing. The unit test is
always white box oriented, and the step can be conducted in parallel for multiple modules.
Tested individual python file by debugging and using print statement Individual Component
rendering
With unit testing the modules may function properly, but at times they may have in advertent
effect on another, sub function when combined, may not produce the desired functions
individually acceptable impression may be signed to unacceptable levels then global data
structure may present problems. Integration testing is a systematic technique for constructing
the program structure while at the same time conducting tests to uncover errors associated
with interfacing. The objective is to take unit tested modules and build a program structure
that has been dictated by the design.
22
Chapter 5
Results
5.1. Splash Screen
23
5.3. Tablet View
24
5.4. Mobile View
25
Chapter 6
Deployment
The deployment phase is the final phase of the software development life cycle (SDLC) and
puts the product into production. After the project team tests the product and the product
passes each testing phase, the product is ready to go live. This means that the product is ready
to be used in a real environment by all end users of the product. There are various phases of
the deployment process the project team must follow to ensure the code and technology
deploy appropriately. The phases include deployment preparation and procedures, product
deployment, transferring ownership of the product, and closing the deployment phase.
In the preparation and procedures phase, the project team installs the software and conducts
another test to ensure successful installation. Once the installation is complete, the project
team creates operating procedures, which include instructions for how the software should
work in the information technology environment. If there are issues with system
functionality, the operating instructions also provide a mitigation plan to help the end user
repair the issue.
Under the product deployment phase, the project team implements the programming and
coding to each system location. For example, say a company has two regional worksites in
Noida and Kolkata and over 2,000 computer systems. The deployment phase includes
pushing the program and coding to each regional site and each computer system.
6.4 Environment Variables:
● Visual Studio Code - Visual Studio Code is an IDE developed by Microsoft for
Windows, Linux and macOS It includes support for debugging, embedded Git
control
and GitHub, syntax highlighting, intelligent completion, snippets, and code
refactoring.
It is highly customizable, allowing users to change the theme, keyboard shortcuts,
preferences, and install extensions that add additional functionality. The source code
is free and open source and released under the permissive MIT License. The compiled
binaries are freeware and free for private or commercial use.
Working with Git and other SCM providers has never been easier. Review diffs, stage
files, and make commits right from the editor. Push and pull from any hosted SCM
service. If want to add new languages, themes, debuggers, and to connect to
additional
services just install the extensions. Extensions run in separate processes, ensuring they
26
won’t slow down the editor.
● Adobe Illustrator- Adobe Illustrator is a software application for creating drawings,
illustrations, and artwork using a Windows or MacOS computer. Illustrator was
initially
released in 1987 and it continues to be updated at regular intervals, and is now
included
as part of the Adobe Creative Cloud. Illustrator is widely used by graphic designers,
web designers, visual artists, and professional illustrators throughout the world to
create
high quality artwork. Illustrator includes many sophisticated drawing tools that can
reduce the time need to create illustrations
One of Adobe Illustrator’s most important features is that the quality of artwork
created
using Illustrator is independent of the resolution at which it is displayed. This means
that an image created in Illustrator can be enlarged or reduced without sacrificing
image
quality. This is an attribute of vector artwork, which uses mathematical relationships
in
describing lines, arcs, and other parts of an illustrator. By comparison, photographs
edited using tools such as Adobe Photoshop are resolution-dependent, and image
quality.
27
Conclusions and Further Work
This research suggests and proposes an efficient and accurate weather prediction and
forecasting model using linear regression concept. This concept is a part of machine learning.
It is a very efficient weather prediction model and using the entities temperature, humidity
and pressure, it can be used to make reliable weather predictions. This model also facilitates
decision making in day to day life. It can yield even better results when applied to cleaner and
larger datasets. Pre-processing of the datasets is effective in the prediction as unprocessed
data can also affect the efficiency of the model.
Future Enhancement
• Mobile and IOS application Integration.
• Addition of new cities weather dataset to predict there future weather also.
• Addition of new Indices.
• Animation like snow and functions like notifications can also be added.
28
References
It is tempting to omit the titles of the articles cited, and the university allows this,
but thinks of all the times when author has seen a reference in a paper and gone to
look it up only to find that it was not helpful after all. If he cites a journal article or
book, the reader can go to a library and check that the cited document and check
whether or not it says what he says it did. A web site may disappear, and it may
have been updated or changed completely. So references to the web are usually
less satisfactory. Nevertheless, there are some very useful and authoritative
sources. However it is expected that such citations should not be overused. In
particular, a web citation should not be used if there exists a "hard" citation.
Author should give the exactURL. Thumb rules followed to refer some one’s work
are given below.
1. cite all ideas, concepts, text, data that are not own by the project group
2. if author makes a statement, he must back it up with his own data or a reference
Sample Examples :
1. https.wikipedia.com
2. https.w3schools.com
3. https.reactjs.org
4. https.weatherapi.org
5. https://dev.to/achowba/building-a-modal-in-react-
15hg#:~:targetText=Open%20the%20Modal.js%20file,%7B%7B%20transform%3A
%20props.show%20%3F
29