Skip to content

Latest commit

 

History

History
240 lines (162 loc) · 11.3 KB

SoftwareDesign.md

File metadata and controls

240 lines (162 loc) · 11.3 KB

Software Design Document
for
Snow Prediction Software

Version 1.0 approved

Prepared by Frank Vanris, Conrad Nark, Stefana Ciustea

Bellevue College

Instructor: Gordon Gul

Course: CS410

4/16/2024

1. Introduction

1.1 Purpose

This software design document describes the architecture and system design of the Snow Prediction software, and how reliable and usable it will be for the user.

1.2 Scope

The goal for this software is to provide efficient and reliable data to the user for a given day in whether if it is going to snow or not in snoqualmie pass and how much possible snow accumulation for that given day could there be.

1.3 Overview

The main gist of this document is to explain and express how the design for this software will be handled and to explain how the user will be able to use our software efficiently and reliably.

1.4 Reference Material

Here are the given sources that were used to rely information for this document:

1.5 Definitions and Acronyms

  • KNN (K Nearest Neighbor: Machine learning algorithm)
  • NN (Neural Networks: Machine learning algorithm)
  • PD: Prediction Determinations
  • DF: DataFrames (part of the pandas python library)

System Overview

The goal of this software is to predict reliable data and information on a given day to the user when the user would like to know how snowy it could be on a given day. (For our time complexity a given day within 2-3 days ahead or a week).

We will be using a learning model known as KNN to predict on a given day how much snow will fall or whether if it is going to snow at all. We will only be sending the user the average of snow fall for that given day. Not snowfall during certain hourly time intervals.

As for where the user will be able to retrieve and see these predictions. They will find it within a website found on the web that we will be creating. A web server that will retrieve the data and our predictions, and present the information to the user.

3 System Architecture

The System itself is going to be a web based application, where all the backend work is being done by parsing through given data or obtaining the given data, then shaping it so that it can easily pass through the KNN model. Then obtain the predictions and send the information to the web server that we will create.

3.1 Architectural Design

Given architecture in how this will be designed is presented here in this image:

image

  • Backend Developers:Conrad Nark, Frank Vanris
  • Frontend Developers: Stefana Ciustea

3.2 Decomposition Description

image

3.3 Design Rationale

We chose this architecture because it was easy to visualize it in a streamline scenario. We want to obtain the data then go through predictions then send the information to the user when they use the web server.

Some issues that could occur is that certain design paradigms within this structure could be removed. For example certain issues within data analysis for our software could contain discrepensies so the software structure could change to obtaining different data or to immediatly removing the complete set of data to something reliable and usable.

4 Data Design

4.1 Data Description

Most of the given information that will be used will be stored into DF's half of the data that we obtain as csv files will be stored into DF's in order to send the data and have it usable for the KNN algorithm. Certain sets of columns of Data could be and will sometimes be stored in it's own seperate DF. With the DF placed into the KNN algorithm we will be able to create PD's from the data. and with that information we could then send it to the user via the web server that will be established.

4.2 Data Dictionary

Functional Description

Functionality

Snow Prediction System

Description:
The system predicts snowfall using historical data and K-Nearest Neighbors (KNN) algorithm.

Components

Data Collection

Description: Obtain a CSV file containing historical weather data (including snowfall records).

Prediction Model

Description: Train a KNN model using the historical data to predict snowfall.

Python Script

Description: Create a Python script that:
- Takes input (e.g., date) from the user.
- Uses the trained KNN model to predict snowfall for the specified date.
- Sends the prediction to the React web server.

React Web Server

Description: A web server built with React that:

  • Displays data to the user.
  • Provides a search bar for querying specific information.
  • Allows users to click a button to retrieve snowfall predictions.

User Interaction

Description:
Users can:
  • Search for specific information (e.g., by date).
  • Click a button to get snowfall predictions for the next day.
  • View possible snow accumulation amounts.

5. Component Design

Component: Data Collection

  • Function: LoadData()

Description: Loads historical weather data from a CSV file.
Input: Path to CSV file.
Output: Data structure containing the loaded data.
Local Data: CSV file path, data structure for storing weather data.

Component: Prediction Model

  • Function: TrainModel()

    • Description: Trains the KNN model using historical weather data.
    • Input: Historical weather data structure.
    • Output: Trained KNN model.
    • Local Data: KNN model parameters, training dataset.
  • Function: PredictSnowfall()

    • Description: Predicts snowfall using the trained KNN model.
    • Input: Date for prediction, trained KNN model.
    • Output: Snowfall prediction result.
    • Local Data: Date, prediction result.

Component: Python Script

  • Function: GetUserInput()

    • Description: Takes date input from the user.
    • Input: None.
    • Output: User-specified date.
    • Local Data: User input date.
  • Function: SendPrediction()

    • Description: Sends the snowfall prediction to the React web server.
    • Input: Snowfall prediction result.
    • Output: None.
    • Local Data: Web server endpoint, prediction data.

Component: React Web Server

  • Function: DisplayData()

    • Description: Displays data to the user on the web interface.
    • Input: Data to be displayed.
    • Output: None.
    • Local Data: Data to display.
  • Function: SearchData()

    • Description: Provides a search bar for querying specific information.
    • Input: Search query.
    • Output: Search results.
    • Local Data: Search query, search results.
  • Function: RetrievePrediction()

    • Description: Allows users to click a button to retrieve snowfall predictions.
    • Input: None.
    • Output: Snowfall prediction for the next day.
    • Local Data: Prediction result.

Component: User Interaction

  • Function: SearchInformation()

    • Description: Enables users to search for specific information by date.
    • Input: Date query.
    • Output: Information for the specified date.
    • Local Data: Date query, search results.
  • Function: GetNextDayPrediction()

    • Description: Allows users to get snowfall predictions for the next day.
    • Input: None.
    • Output: Snowfall prediction for the next day.
    • Local Data: Prediction result.
  • Function: ViewAccumulation()

    • Description: Displays possible snow accumulation amounts to the user.
    • Input: None.
    • Output: Snow accumulation data.
    • Local Data: Accumulation data.

6. Human Interface Design

6.1 Overview of User Interface

When a user opens the site, they will see a screen with a search bar and the logo to the left of it. The main focus for the user will be the central button labeled "Get Forecast." Clicking this button will open a new screen displaying the forecast for the upcoming days in a given week (with a range of 2-3 days for prediction). Each day's forecast will include predictions for whether it will snow or not. An icon on the screen will indicate if snow is expected or if another type of weather event is forecasted. If snow is predicted, the screen will also display information on how much snow is expected to accumulate over a 24-hour period.

In the search tab, users can look up information specific to Snoqualmie Pass. All search queries in the search bar will be limited to Snoqualmie Pass. The primary focus of the site is to predict snowfall at the Snoqualmie Pass summit. Users can search for information such as temperature, humidity, and more within the search bar.

6.2 Screen Images

Main Page: image

Getting Forecast: image

7. Requirements Tracability Matrix

Provides a cross reference that traces components and data structures to requirements in our SRS document.
Table shows which system components satisfy each of the functional requirements from the SRS. In order to refer to the functional requirements, we assign them some numbers/codes in the SRS.
Requirement-ID Requirement Description Design Development Data Design Component Interface Design Component
R1 The system should be able to load historical weather data from Snoqualmie Pass Component: Data Collection LoadData() function N/A
R2 The system should train a KNN model using historical weather data from Snoqualmie Pass Component: Prediction Model TrainModel() function, PredictSnowfall() function N/A
R3 The system should provide a web interface for users N/A GetUserInput() function, SendPrediction() function, SearchData() function, SearchInformation() function Component: React Web Server, Component: Python Script
R4 The system should display snowfall predictions for the next day when users click the Get Forecast button N/A PredictSnowfall() function, DisplayData() function, RetrievePrediction() function, GetNextDayPrediction() function, ViewAccumulation() function Component: User Interaction