0% found this document useful (0 votes)
50 views29 pages

PPR G-19 (Corrected)

This document discusses weather forecasting and the use of machine learning for weather prediction. It provides background on traditional weather forecasting using physical simulations and differential equations, noting limitations beyond 10 days. Machine learning is presented as a potential alternative that is more robust. The document then outlines the methodology, technologies, and scope of a project using linear regression for weather prediction. Key points include collecting weather data, building a model based on past patterns to map new predictions, and focusing on improving accuracy for agriculture-dependent economies.

Uploaded by

techofficial321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views29 pages

PPR G-19 (Corrected)

This document discusses weather forecasting and the use of machine learning for weather prediction. It provides background on traditional weather forecasting using physical simulations and differential equations, noting limitations beyond 10 days. Machine learning is presented as a potential alternative that is more robust. The document then outlines the methodology, technologies, and scope of a project using linear regression for weather prediction. Key points include collecting weather data, building a model based on past patterns to map new predictions, and focusing on improving accuracy for agriculture-dependent economies.

Uploaded by

techofficial321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

CHAPTER -1

Introduction

1.1 Introduction to Weather Forecasting

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.

1.2 Methodology used

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.

1.3 Technologies Used

1.3.1 Machine learning – Linear Regression

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

JavaScript is a lightweight, interpreted programming language. It is designed for creating


network-centric applications. It is complimentary to and integrated with Java. JavaScript is
very easy to implement because it is integrated with HTML. It is open and cross-platform.
Once you learnt JavaScript, it helps you developing great front-end as well as back-end
software using different JavaScript based frameworks like jQuery, Node.JS etc.

JavaScript is used to create interactive websites. It is mainly used for:


o Client-side validation
o Displaying pop-up windows and dialog boxes

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.

JSON is built on two structures:

1) A collection of name/value pairs. In various languages, this is realized as an object,


record, structure, dictionary, hash table, keyed list, or associative array.

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.

1.3.5 Adobe After Effects

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.

1.3.7 Weather API


Weather APIs are Application Programming Interfaces that allow you to connect to
large databases of weather forecast and historical information. The weather API
provides enough weather data for basic weather information (e.g. current weather,
forecast, UV index data, and historical weather information). You can use geolocation
and names to get a city location.

5
CHAPTER -2
Problem Identification

2.1 Problem Statement

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.

2.2 Project Scope

● 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.

 Traditional observations made at the surface of atmospheric pressure, temperature,


wind speed, wind direction, humidity, precipitation are collected routinely from
trained observers, automatic weather stations or buoys. During the data assimilation
process, information gained from the observations is used In conjunction with a
numerical model's most recent forecast for the time that observations were made to
produce the meteorological analysis. The complicated equations which govern how
the state of a fluid changes with time require supercomputers to solve them.

● The output from this model can be used the weather forecast as alternative.

2.3 Design and Implementation Constraints

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.5 Assumptions and Dependencies


● The software product is dependent on a dataset that is been retrieved from the server
using various commands.
● The product will work based on the algorithm that has been discussed above.

2.6 System Features

2.6.1 Actors
● User
● Historical data provider
● Administrator

2.7 Functional Requirements

2.7.1 Accessing a database


● The system should allow administrator to add historical weather data.
● The system should be able to recognize patterns in temperature, humidity, and wind
with
use of historical data.

2.7.2 Prediction algorithm


● System should periodically apply prediction algorithms or models on obtained data
and
store results to central database.

● System shall obtain and display confidence value for each prediction given to user.

2.7.3 Actions performed by system


● System shall allow users to check weather for future three days.

2.8 Non-Functional Requirements

2.8.1 User Non-Functional Requirements

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.

2.8.2 System Non-Functional Requirements


● System should be able to run with core functionality from computer system.
● System should be able to show interactive animations to users regarding current and
future climatic conditions.

2.8.3 Other Non-Functional Requirements


● System should textual prediction of climate conditions.

2.9 Other Requirements

2.9.1 Performance Requirements

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

2.9.3 Security Requirements

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.

2.9.4 Hardware Requirements

The system requires a database in order to store persistent data.

2.9.5 Software Constraints

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

In software industries, Object Oriented Development process is widely used. Object-Oriented


Programming has heavily contributed toward a standardized method of modeling known as
the Unified Modeling Language (UML). UML has become synonym for software modeling.
UML is commonly used to model the software architecture as per the requirements and it
includes a set of graphic notation techniques to create visual models of software-intensive
systems. With the help of different UML diagrams for building the software, source code can
be easily generated. The correctness of source code depends on the UML specification which
needs to be standard, complete, precise, and unambiguous. A good UML specification leads
to clearly defined semantics and an efficient code can be generated. The project is based upon
the predicting
Weather's condition.

3.1.1 Proposed approach

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.

3.1.2 Weather Prediction System Architecture

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.

The system building process consists of following sequential steps:


1. Fetching the dataset
2. Cleaning the dataset

9
3. Selection of the features of dataset
4. Train Model
5. Use the model to predict results.

3.2 Use-Case Diagram

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

Fig 3.1. UI Design

3.4 Code

3.4.1 main.jsx

import { ChakraProvider } from "@chakra-ui/react";


import axios from "axios";
import React from "react";
import ReactDOM from "react-dom";
import { Provider as ReduxProvider } from "react-redux";
import App from "./App";
import "./index.css";
import { store } from "./redux/store";

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";

import { useEffect, useState } from "react";


import { shallowEqual, useDispatch, useSelector } from "react-redux";
import { celsius } from "../helpers/extraFunctions";
import { getItem } from "../helpers/sessionStorage";
import { getWeatherByLocation, syncData } from "../redux/actions";
import { Error } from "./Error";
import { Loading } from "./Loading";
import { Map } from "./Map";
import { FaSyncAlt } from "react-icons/fa";
import { Newbox, NewText } from "./SmallComponents";
import { Forcast } from "./Forcast";

export const Deatils = () => {


const {
isLoading,

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));
}, []);

const handleSyncData = () => {


setIsRotate(true);
dispatch(syncData(data.name, 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

export const weatherAppAPI = "c0d290eeee9dd399b017a6d2ba64be7e";

export const googleMapAPI =


"AIzaSyAq15HbfCRMW7RqNb5LUNyOLyfzpYI0wl4";

3.4.4 ForcastModel.jsx

import { Box, Grid, Icon, Modal, ModalBody, ModalCloseButton,


ModalContent, ModalFooter, ModalHeader, ModalOverlay, Text,
useDisclosure } from "@chakra-ui/react";
import { dateFormat } from "../helpers/extraFunctions";
import { NewText } from "./SmallComponents";
import { ImSun } from "react-icons/im";
import { MdOutlineNightsStay } from "react-icons/md";

export const ForcastModal = ({ data }) => {

const { date, day } = dateFormat(data.dt);


const { isOpen, onOpen, onClose } = useDisclosure();

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>

<Grid templateColumns={'50% 50%'} >


<Box pb={'10px'} pl={'15%'}>
{['Felt Temp.', 'Humidity', 'Wind', 'Pressure', 'Day Temp.',
'Evening Temp.', 'Night Temp.', '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'} pb={'10px'}
pl={'15%'}>
<NewText>{data.feels_like.day}<sup>o</sup>
C</NewText>
<NewText>{data.humidity}%</NewText>
<NewText>{(data.wind_speed * 3.6).toFixed(2)}
Km/h</NewText>
<NewText>{data.pressure} hPa</NewText>
<NewText>{data.temp.day}<sup>o</sup>
C</NewText>
<NewText>{data.temp.eve}<sup>o</sup> C</NewText>
<NewText>{data.temp.night}<sup>o</sup>
C</NewText>
<NewText>{data.temp.min}<sup>o</sup>
C</NewText>
<NewText>{data.temp.max}<sup>o</sup>
C</NewText>
</Box>

16
</Grid>
</Box>
</ModalBody>

<ModalFooter></ModalFooter>
</ModalContent>
</Modal>
</>
);
};

3.4.5 Navbar.jsx

import { Button, Center, Flex, Icon, Input, useToast } from "@chakra-ui/react";


import { useState } from "react";
import { useDispatch } from "react-redux";
import { getWeatherByCity, getWeatherByLocation } from "../redux/actions";
import { HiLocationMarker } from "react-icons/hi";

export const Navbar = () => {


const [city, setCity] = useState("");
const dispatch = useDispatch();
const toast = useToast();

const handleChnage = () => {


dispatch(getWeatherByCity(city, toast));
};

const handleLocationData = () => {


dispatch(getWeatherByLocation(toast));
};

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

import axios from "axios";


import { weatherAppAPI } from "../helpers/API";
import { myToast } from "../helpers/extraFunctions";
import { setItem } from "../helpers/sessionStorage";
import { GET_DATA_ERROR, GET_DATA_LOADING,
GET_DATA_SUCCESS } from "./actionTypes";

export const getDataLoading = () => {


return { type: GET_DATA_LOADING };
}

export const getDataSuccess = (payload) => {


return { type: GET_DATA_SUCCESS, payload };
}

export const getDataError = () => {


return { type: GET_DATA_ERROR };
}

export const getWeatherByLocation = (toast) => (dispatch) => {

const success = async (position) => {


try {
let { latitude, longitude } = position.coords;
dispatch(getDataLoading());
let weatherData = await axios.get(`/weather?lat=${latitude}&lon=$
{longitude}&appid=${weatherAppAPI}`);
weatherData = weatherData.data;
let forcastData = await axios.get(`/onecall?lat=${latitude}&lon=$
{longitude}&exclude=hourly,minutely&units=metric&appid=$
{weatherAppAPI}`);
forcastData = forcastData.data.daily;
let payload = { weatherData, forcastData }
dispatch(getDataSuccess(payload));
setItem("weather", payload);
myToast(toast, "Your location weather updated", "success")
} catch (err) {
console.log(err);

19
dispatch(getDataError());
}
}

const error = (err) => {


console.warn(`ERROR(${err.code}): ${err.message}`);
myToast(toast, "Please turn on your location", "error")
}

navigator.geolocation.getCurrentPosition(success, error);
}

export const getWeatherByCity = (city, toast) => async (dispatch) => {


try {
dispatch(getDataLoading());
let weatherData = await axios.get(`/weather?q=${city}&appid=$
{weatherAppAPI}`);
weatherData = weatherData.data;
let { lon, lat } = weatherData.coord;
let forcastData = await axios.get(`/onecall?lat=${lat}&lon=$
{lon}&exclude=hourly,minutely&units=metric&appid=${weatherAppAPI}`);
forcastData = forcastData.data.daily;
let payload = { weatherData, forcastData };
dispatch(getDataSuccess(payload));
setItem("weather", payload);
myToast(toast, "City weather data updated", "success");

} catch (err) {
console.log(err);
dispatch(getDataError());
myToast(toast, "City weather data doesn't exist", "error");
}
}

export const syncData = (city, toast) => async (dispatch) => {


try {
let weatherData = await axios.get(`/weather?q=${city}&appid=$
{weatherAppAPI}`);
weatherData = weatherData.data;
let { lon, lat } = weatherData.coord;
let forcastData = await axios.get(`/onecall?lat=${lat}&lon=$
{lon}&exclude=hourly,minutely&units=metric&appid=${weatherAppAPI}`);
forcastData = forcastData.data.daily;

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.

4.1 Unit Testing

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

4.2 Integration Testing

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

5.2. Main Page

23
5.3. Tablet View

24
5.4. Mobile View

25
Chapter 6

Deployment

6.1 Purpose of Deployment Phase

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.

6.2 Preparation and Procedures

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.

6.3 Product Deployment

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

3. all references cited in the text must be listed

4. list all references cited in the text in alphabetical

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

You might also like