AIML Internship Report
AIML Internship Report
Among the models tested, Random Forest was found to deliver the most accurate
predictions in terms of both classification accuracy and the ability to handle complex, non-
linear relationships between the input variables. Performance evaluation was carried out
using various metrics such as accuracy, precision, recall, and Root Mean Squared Error
(RMSE), with Random Forest outperforming other algorithms in all these categories.
The findings from this study underscore the effectiveness of machine learning in
weather forecasting, particularly for predicting rainfall. This project demonstrates that with
proper data preprocessing and model selection, machine learning can provide reliable
rainfall predictions that can aid in resource planning, disaster preparedness, and climate
monitoring. Furthermore, this work opens avenues for future exploration, such as
integrating additional weather variables or utilizing deep learning techniques for even
higher accuracy in prediction tasks.
5
INDEX
1. Introduction 7
4. TensorFlow 25-29
5. SciKit-Learn 29-30
7. Project 33-40
6
INTRODUCTION
Machine Learning is the science of getting computers to learn without being explicitly
programmed. It is closely related to computational statistics, which focuses on making
prediction using computer. In its application across business problems, machine learning
is also referred as predictive analysis. Machine Learning is closely related to computational
statistics. Machine Learning focuses on the development of computer programs that can
access data and use it to learn themselves. The process of learning begins with observations
or data, such as examples, direct experience, or instruction, in order to look for patterns in
data and make better decisions in the future based on the examples that we provide. The
primary aim is to allow the computers learn automatically without human intervention or
assistance and adjust actions accordingly.
The name machine learning was coined in 1959 by Arthur Samuel. Tom M. Mitchell
provided a widely quoted,more formal definition of the algorithms studied in the machine
learning field: "A computer program is saidto learn from experience E with respect to some
class of tasks T and performance measure P if its performance at tasks in T, as measured
by P, improves with experience E." This follows Alan Turing's proposal in his paper
"Computing Machinery and Intelligence", in which the question "Can machines think?" is
replaced with the question "Can machines do what we (as thinking entities) can do?". In
Turing’s proposal the characteristics that could be possessed by a thinking machine and
the various implications in constructingone are exposed.
7
Types Of Machine Learning
The types of machine learning algorithms differ in their approach, the type of data they
input and output, andthe type of task or problem that they are intended to solve. Broadly
Machine Learning can be categorized into four categories.
I. Supervised Learning
II. Unsupervised Learning
III. Reinforcement Learning
IV. Semi-supervised Learning
SUPERVISED LEARNING
Supervised Learning is a type of learning in which we are given a data set and we
already know what are correct output should look like, having the idea that there is a
relationship between the input and output. Basically, it is learning task of learning a
function that maps an input to an output based on example input- output pairs. It infers a
function from labeled training data consisting of a set of training examples.
Supervised learning problems are categorized
Key Characteristics:
1. Labeled Data: Supervised learning requires labeled data, where each example is
accompanied by a target output.
2. Training: The algorithm learns from the labeled data during the training phase.
3. Prediction: The trained model makes predictions on new, unseen data.
UNSUPERVISED LEARNING
Unsupervised Learning is a type of learning that allows us to approach problems with
little or no idea what our problem should look like. We can derive the structure by clustering
the data based on a relationship amongthe variables in data. With unsupervised learning
there is no feedback based on prediction result. Basically, it is a type of self-organized
learning that helps in finding previously unknown patterns in data set without pre- existing
label.
1. Unlabeled Data: Unsupervised learning uses unlabeled data, where no target output is
provided.
8
2. Discovery: The algorithm discovers patterns, relationships, or groupings in the data.
3. No Supervision: No human expertise or labeled data is required.
REINFORCEMENT LEARNING
Key Characteristics:
1. Agent: The decision-making entity.
2. Environment: The external system with which the agent interacts.
3. Actions: The agent's decisions.
9
Applications Of Machine Learning
Machine learning is one of the most exciting technologies that one would have ever come
across. As it is evident from the name, it gives the computer that which makes it more
similar to humans: The ability to learn.Machine learning is actively being used today,
perhaps in many more places than one would expect. We probably use a learning algorithm
dozen of time without even knowing it. Applications of Machine Learning include:
• Web Search Engine: One of the reasons why search engines like google, bing etc
work so well is because the system has learnt how to rank pages through a complex
learning algorithm.
• Photo tagging Applications: Be it facebook or any other photo tagging application,
the ability to tagfriends makes it even more happening. It is all possible because of
a face recognition algorithm that runs behind the application.
• Spam Detector: Our mail agent like Gmail or Hotmail does a lot of hard work for
us in classifying themails and moving the spam mails to spam folder. This is again
achieved by a spam classifier running in the back end of mail application.
OBJECTIVES
Main objectives of training were to learn:
• How to determine and measure program complexity,
• Python Programming
• ML Library Scikit, Numpy , Matplotlib, Pandas.
• Statistical Math for the Algorithms.
• Learning to solve statistics and mathematical concepts.
• Supervised and Unsupervised Learning
• Classification and Regression
• ML Algorithms
10
2.Python – The New Generation Language
Python is a widely used general-purpose, high level programming language. It was
initially designed by Guido van Rossum in 1991 and developed by Python Software
Foundation. It was mainly developed for an emphasis on code readability, and its syntax
allows programmers to express concepts in fewer lines of code. Python is dynamically
typed and garbage-collected. It supports multiple programming paradigms, including
procedural, object-oriented, and functional programming. Python is often described as a
"batteries included"language due to its comprehensive standard library.
Feature of Python:
• Interpreted -
In Python there is no separate compilation and execution steps like C/C++. It directly
run the program from the source code. Internally, Python converts the source code into
an intermediate form called bytecodes which is then translated into native language of
specific computer to run it.
• Platform Independent -
Python programs can be developed and executed on the multiple operating system
platform. Python canbe used on Linux, Windows, Macintosh, Solaris and many more.
• Multi- Paradigm -
Python is a multi-paradigm programming language. Object-oriented programming and
structured programming are fully supported, and many of its features support functional
programming and aspect- oriented programming .
• Simple -
Python is a very simple language. It is a very easy to learn as it is closer to English
language. In pythonmore emphasis is on the solution to the problem rather than the
syntax.
• Rich Library Support -
Python standard library is very vast. It can help to do various things involving regular
expressions, documentation generation, unit testing, threading, databases, web
browsers, CGI, email, XML, HTML, WAV files, cryptography, GUI and many more.
• Free and Open Source -
Firstly, Python is freely available. Secondly, it is open-source. This means that its
source code is available to the public. We can download it, change it, use it, and
distribute it.
11
Why Python Is a Perfect Language for Machine
Learning?
12
3. Flexibility-
Python for machine learning is a great choice, as this language is very flexible:
▪ It offers an option to choose either to use OOPs or scripting.
▪ There’s also no need to recompile the source code, developers
can implement anychanges and quickly see the results.
▪ Programmers can combine Python and other languages to reach their
goals.
5. Community Support-
It’s always very helpful when there’s strong community support built around the
programming language. Python is an open-source language which means that
there’s a bunch of resources open for programmers starting from beginners and
ending with pros. A lot of Python documentation is available online as well as in
Python communities and forums, where programmers and machine learning
developers discuss errors, solve problems, and help each other out. Python
programming language is absolutely free as is the variety of useful libraries and
tools.
6. Growing Popularity-
As a result of the advantages discussed above, Python is becoming more and more
popular among data scientists. According to StackOverflow, the popularity of
Python is predicted to grow until 2020, at least. This means it’s easier to search for
developers and replace team players if required. Also, the costof their work maybe
not as high as when using a less popular programming language.
13
Data Preprocessing , Analyzing and Visualization
Machine Learning algorithms don’t work so well with processing raw data. Before we
can feed such data to an ML algorithm, we must preprocess it. We must apply some
transformations on it. With data preprocessing, we convert raw data into a clean data
set. To perform data this, there are 7 techniques -
1. Rescaling Data -
For data with attributes of varying scales, we can rescale attributes to possess the same
scale. We rescale attributes into the range 0 to 1 and call it normalization. We use the
MinMaxScaler class from scikit- learn.This gives us values between 0 and 1.
2. Standardizing Data -
With standardizing, we can take attributes with a Gaussian distribution and different
means and standard deviations and transform them into a standard Gaussian
distribution with a mean of 0 and a standard deviation of 1.
3. Normalizing Data -
In this task, we rescale each observation to a length of 1 (a unit norm). For this, we use
the Normalizer class.
4. Binarizing Data -
Using a binary threshold, it is possible to transform our data by marking the values
above it 1 and those equal to or below it, 0. For this purpose, we use the Binarizer class.
5. Mean Removal-
We can remove the mean from each feature to center it on zero.
7. Label Encoding -
Some labels can be words or numbers. Usually, training data is labelled with words to
make it readable.Label encoding converts word labels into numbers to let algorithms
work on them.
Types of Data Visualization:
1. Univariate Plots: Histograms, box plots, and density plots.
14
2. Multivariate Plots: Scatter plots, heatmaps, and parallel coordinates.
3. Interactive Visualization: Dashboards and interactive plots.
Tools for Data Preprocessing, Analysis, and Visualization:
1. Python Libraries: Pandas, NumPy, Matplotlib, Seaborn, Scikit-learn.
2. R Libraries: dplyr, tidyr, ggplot2, caret.
3. Data Visualization Tools: Tableau, Power BI, D3.js.
15
3.MACHINE LEARNING ALGORITHMS
There are many types of Machine Learning Algorithms specific to different use cases. As
we work with datasets, a machine learning algorithm works in two stages. We usually split
the data around 20%-80% between testing and training stages. Under supervised learning,
we split a dataset into a training data and test data in Python ML. Followings are the
Algorithms of Python Machine Learning.
1.Linear Regression –
Linear regression is one of the supervised Machine learning algorithms in Python that
observes continuous features and predicts an outcome. Depending on whether it runs on a
single variable or on many features, we can call it simple linear regression or multiple
linear regression.
This is one of the most popular Python ML algorithms and often under-appreciated. It
assigns optimal weightsto variables to create a line ax+b to predict the output. We often
use linear regression to estimate real valueslike a number of calls and costs of houses based
on continuous variables. The regression line is the best line that fits Y=a*X+b to denote a
relationship between independent and dependent variables.
16
2. Logistic Regression -
Logistic regression is a supervised classification is unique Machine Learning algorithms
in Python that finds its use in estimating discrete values like 0/1, yes/no, and true/false. This
is based on a given set of independentvariables. We use a logistic function to predict the
probability of an event and this gives us an output between 0 and 1. Although it says
‘regression’, this is actually a classification algorithm. Logistic regression fits data into a
logit function and is also called logit regression.
Logistic Regression Equation:
p = 1 / (1 + e^(-z))
where:
- p: probability of the event occurring
- e: base of the natural logarithm
- z: weighted sum of input variables
1. Decision Tree -
A decision tree falls under supervised Machine Learning Algorithms in Python and comes
of use for both classification and regression- although mostly for classification. This model
takes an instance, traverses the tree, and compares important features with a determined
conditional statement. Whether it descends to the leftchild branch or the right depends on
the result. Usually, more important features are closer to the root.
Decision Tree, a Machine Learning algorithm in Python can work on both categorical and
continuous dependent variables. Here, we split a population into two or more homogeneous
sets. Tree models where the target variable can take a discrete set of values are called
classification trees; in these tree structures, leaves represent class labels and branches
represent conjunctions of features that lead to those class labels. Decision trees where the
target variable can take continuous values (typically real numbers) are called regression
trees.
17
a new internal node or leaf node until a stopping criterion is met (e.g., all instances in
a node belong to the same class or a predefined depth is reached).
18
1.Naive Bayes Algorithm -
Naive Bayes is a classification method which is based on Bayes’ theorem. This assumes
independence betweenpredictors. A Naive Bayes classifier will assume that a feature in a
class is unrelated to any other. Consider a fruit. This is an apple if it is round, red, and 2.5
inches in diameter. A Naive Bayes classifier will say these characteristics independently
contribute to the probability of the fruit being an apple. This is even if features depend on
each other. For very large data sets, it is easy to build a Naive Bayesian model. Not only is
this model very simple, it performs better than many highly sophisticated classification
methods. Naïve Bayes classifiers are highly scalable, requiring a number of parameters
linear in the number of variables (features/predictors) in a learning problem. Maximum-
likelihood training can be done by evaluating a closed-form expression, which takes linear
time, rather than by expensive iterative approximation as used for many other types of
classifiers.
P(A∣B)=P(B)P(B∣A)P(A)
19
2.KNN Algorithm -
This is a Python Machine Learning algorithm for classification and regression- mostly for
classification. This i s a supervised learning algorithm that considers different centroids and
uses a usually Euclidean function to compare distance. Then, it analyzes the results and
classifies each point to the group to optimize it to place with all closest points to it. It
classifies new cases using a majority vote of k of its neighbors. The case it assignsto a class
is the one most common among its K nearest neighbors. For this, it uses a distance function.
k-NN is a type of instance-based learning, or lazy learning, where the function is only
approximated locally and all computation is deferred until classification. k-NN is a special
case of a variable-bandwidth, kernel density "balloon" estimator with a uniform kernel.
Euclidean Distance
This is nothing but the cartesian distance between the two points which are in the
plane/hyperplane. Euclidean distance also be visualized as length of the straight line that joins
the two points which are into consideration. This metric helps us calculate the net displacement
done between the two states of an object.
distance(x,Xi)=∑j=1d(xj–Xij)2]
o It is also called a lazy learner algorithm because it does not learn from the training
set immediately instead it stores the dataset and at the time of classification, it performs
an action on the dataset.
3. K- Means Algorithm -
k-Means is an unsupervised algorithm that solves the problem of clustering. It classifies
data using a number of clusters. The data points inside a class are homogeneous and
heterogeneous to peer groups. k-means clustering is a method of vector quantization,
originally from signal processing, that is popular for cluster analysis in data mining. k-
means clustering aims to partition n observations into k clusters in which each observation
belongs to the cluster with the nearest mean, serving as a prototype of the cluster. k-means
clustering is rather easy to apply to even large data sets, particularly when using heuristics
such as Lloyd's algorithm. It often is used as a preprocessing step for other algorithms, for
example to find a starting configuration. The problem is computationally difficult (NP-
hard). k-means originates from signal processing, and still finds use in this domain. In
cluster analysis, the k-means algorithm can be used to partition the input data set into k
partitions (clusters). k-means clustering has been used as a feature learning (or dictionary
learning) step, in either (semi-)supervised learning or unsupervised learning.
20
4.Random Forest -
A random forest is an ensemble of decision trees. In order to classify every new object
based on its attributes, trees vote for class- each tree provides a classification. The
classification with the most votes wins in the forest.Random forests or random decision
forests are an ensemble learning method for classification, regression andother tasks that
operates by constructing a multitude of decision trees at training time and outputting the
classthat is the mode of the classes (classification) or mean prediction (regression) of the
individual trees.
Algorithm for Random Forest Work:
1. Step 1: Select random K data points from the training set.
2. Step 2: Build the decision trees associated with the selected data points (Subsets).
3. Step 3: Choose the number N for decision trees that you want to build.
4. Step 4: Repeat Step 1 and 2.
5. Step 5: For new data points, find the predictions of each decision tree, and assign the
new data points to the category that wins the majority votes.
Model Evaluation Metrics: Metrics such as accuracy, precision, recall, and F1-score evaluate
a model’s effectiveness. Cross-validation further ensures model reliability by testing it on
multiple data splits.
Overfitting and Regularization: Overfitting occurs when a model performs well on training
data but poorly on unseen data. Regularization techniques, like L1 and L2 penalties, help
prevent overfitting by discouraging complex model structures.
21
4.Machine Learning Using TensorFlow
TensorFlow is an open-source machine learning platform that enables users to build, train, and
deploy machine learning models efficiently. Its architecture is designed for both research and
production, offering flexibility, scalability, and a robust set of tools for developing
sophisticated machine learning solutions.
Overview of TensorFlow
TensorFlow is an end-to-end platform for machine learning and deep learning tasks. Originally
developed for internal use by Google, it was released as an open-source framework in 2015,
which helped it gain popularity across industry and academia. TensorFlow allows users to
construct and execute complex machine learning models efficiently, leveraging computational
resources such as GPUs and TPUs.
• Ecosystem: TensorFlow offers a complete ecosystem for machine learning, including
data preprocessing, model building, training, and deployment tools.
• Flexibility: TensorFlow supports a range of machine learning applications, from
traditional models to cutting-edge neural networks.
• Community Support: The TensorFlow community contributes a wealth of resources,
such as tutorials, pre-trained models, and additional libraries.
22
tf.keras is a high-level API within TensorFlow that simplifies the construction, training, and
evaluation of machine learning models. It supports both Sequential and Functional APIs:
• Sequential API: Used for building simple linear stacks of layers, which is ideal for
straightforward neural network architectures.
• Functional API: Allows for the creation of complex, non-linear models such as multi-
input, multi-output, and custom layer models.
Tensor Board:
TensorBoard is TensorFlow's visualization tool for tracking and analysing model performance.
It provides a graphical interface to view:
• Training Metrics: Visualize loss, accuracy, and other key metrics during training.
• Model Graphs: Display computational graphs to understand model architecture.
• Hyperparameter Tuning: Track different hyperparameter settings and their impacts
on performance.
TensorBoard is an essential tool for diagnosing issues, monitoring training, and refining model
parameters.
TensorFlow Hub:
TensorFlow Hub is a library for accessing and reusing pre-trained models. By using pre-trained
models, developers can:
• Transfer Learning: Improve model accuracy and reduce training time by leveraging
models that have been trained on large datasets.
• Domain-Specific Models: Access specialized models (e.g., for image classification,
text embeddings) and integrate them with custom applications.
• Fine-Tuning: Modify the final layers of pre-trained models to adapt them for specific
tasks.
23
• Data Augmentation: Apply transformations such as rotation, scaling, or cropping to
images, which helps reduce overfitting and improves model robustness.
Python code:
model = tf.keras.Sequential([
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
24
5.Scikit-Learn in Machine Learning
Scikit-Learn is a popular, open-source machine learning library in Python, known for its
simplicity, efficiency, and versatility. It provides an extensive set of tools for data
preprocessing, model training, model evaluation, and hyperparameter tuning, making it
suitable for both beginners and experts.
25
2.4 Hyperparameter Tuning
Scikit-Learn includes tools for optimizing model parameters:
• Grid Search: Systematically test combinations of parameters to find the best model
configuration.
• Randomized Search: Efficiently sample a random subset of parameters for faster
tuning.
Model building, training, and testing are core stages in the machine learning workflow.
These steps are crucial in developing models that can generalize well to new, unseen data
and provide valuable predictions. Below, we break down each phase in the model
development process.
The choice of model depends on factors such as the data type, the task (prediction,
classification, etc.), and the quality of data (size, noise, missing values)
26
Model Training
Model training involves using labelled data to adjust the model's parameters so that it can
make accurate predictions on new data. This is the process where the model "learns" from
the data.
Model Testing
Testing the model is a critical step in evaluating its ability to generalize to new, unseen data.
This phase involves using the test set that was not used during training to assess how well the
model performs in real-world scenarios.
Evaluating Performance:
The model's performance is evaluated using different metrics depending on the type of task:
27
• For Classification:
o Accuracy: The percentage of correct predictions made by the model.
o Precision and Recall: Precision measures how many of the positive predictions
were correct, while recall measures how many of the actual positives were
identified.
o F1-Score: The harmonic mean of precision and recall, providing a balanced
metric when dealing with imbalanced classes.
o ROC-AUC: The Receiver Operating Characteristic Curve and the Area Under
the Curve are used to assess the model’s ability to discriminate between classes.
• For Regression:
o Mean Squared Error (MSE): Measures the average of the squared differences
between the predicted and actual values.
o R² Score: Represents the proportion of variance in the dependent variable
explained by themodel.
o Mean Absolute Error (MAE): Measures the average absolute difference
between predicted and actual values.
Model Validation:
During testing, it is also important to assess the model’s ability to generalize to unseen data. If
a model performs well on the training set but poorly on the test set, it is an indication of
overfitting. Techniques such as cross-validation can help mitigate this by ensuring the
model’s performance is consistent across multiple subsets of the dataset.
28
7.PROJECT REPORT
Objective:
Dataset Link:
Rainfall-Prediction-Using-Machine-Learning/Rainfall csv at main ·
nithyaprakash2003/Rainfall-Prediction-Using-Machine-Learning
Steps involved:
• We Import the data set into Jupiter Notebook using Python statements.
• We first Import the Libraries and then we Start Manipulating and Processing the
Data.
• We then remove Nan values.
• Then we detect the outliers and remove it.
• Split the data into Training and Testing data.
29
Python Code for Importing Libraries:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import metrics
from sklearn import model_selection
from sklearn import linear_model
from sklearn import ensemble
import xgboost
import numpy as np
import pandas as pd
import pickle
from sklearn import metrics
data = data.fillna(data.mean())
group =
data.groupby('SUBDIVISION')['YEAR','JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','
SEP','OCT','NOV','DEC']
data=group.get_group(('TAMIL NADU'))
# data.head()
df=data.melt(['YEAR']).reset_index()
# df.head()
df= df[['YEAR','variable','value']].reset_index().sort_values(by=['YEAR','index'])
# df.head()
df.columns=['Index','Year','Month','Avg_Rainfall']
Month_map={'JAN':1,'FEB':2,'MAR' :3,'APR':4,'MAY':5,'JUN':6,'JUL':7,'AUG':8,'SEP':9,
'OCT':10,'NOV':11,'DEC':12}
df['Month']=df['Month'].map(Month_map)
# df.head(12)
df.drop(columns="Index",inplace=True)
X=np.asanyarray(df[['Year','Month']]).astype('int')
y=np.asanyarray(df['Avg_Rainfall']).astype('int')
30
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=10)
# y_predict = random_forest_model.predict(X_test)
# print('MAE:', metrics.mean_absolute_error(y_test,y_predict))
# print('MSE:', metrics.mean_squared_error(y_test, y_predict))
file = open("model.pkl","wb")
pickle.dump(random_forest_model,file)
file.close()
# print(y_predict)
31
Data Exploration and Preprocessing
Data exploration and preprocessing are critical steps in any machine learning project, as they
help to understand the dataset’s structure, identify patterns, detect anomalies, and prepare the
data for model training. Proper preprocessing can significantly improve model accuracy and
robustness.
32
Filling Nan Values with Mean:
# filling na values with mean
data = data.fillna(data.mean())
data.isnull().any()
DATA VISUALIZATION:
33
DATA MODELLING:
Code:
Group=
data.groupby('SUBDIVISION')['YEAR','JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','
SEP','OCT','NOV','DEC']
data=group.get_group (('TAMIL NADU'))
data.head()
df= df[['YEAR','variable','value']].reset_index().sort_values(by=['YEAR','index'])
df.head()
Month_map={'JAN':1,'FEB':2,'MAR' :3,'APR':4,'MAY':5,'JUN':6,'JUL':7,'AUG':8,'SEP':9,
'OCT':10,'NOV':11,'DEC':12}
df['Month']=df['Month'].map(Month_map)
df.head(12)
34
TRAINING AND TESTING DATASET:
TO Split Train and Test Data:
Code:
MODELS:
Code:
from sklearn import preprocessing
from sklearn import svm
svm_regr = svm.SVC(kernel='rbf')
svm_regr.fit(X_train, y_train)
35
RANDOM FOREST MODEL:
Code:
y_train_predict=random_forest_model.predict(X_train)
y_test_predict=random_forest_model.predict(X_test)
@app.route("/",methods=['GET'])
@cross_origin()
def home():
return render_template("index.html")
@app.route("/predict",methods=['GET', 'POST'])
36
@cross_origin()
def predict():
if request.method == "POST":
# DATE
date = request.form['date']
day = float(pd.to_datetime(date, format="%Y-%m-%dT").day)
month = float(pd.to_datetime(date, format="%Y-%m-%dT").month)
# MinTemp
minTemp = float(request.form['mintemp'])
# MaxTemp
maxTemp = float(request.form['maxtemp'])
# Rainfall
rainfall = float(request.form['rainfall'])
# Evaporation
evaporation = float(request.form['evaporation'])
# Sunshine
sunshine = float(request.form['sunshine'])
# Wind Gust Speed
windGustSpeed = float(request.form['windgustspeed'])
# Pressure 9am
pressure9am = float(request.form['pressure9am'])
# Pressure 3pm
pressure3pm = float(request.form['pressure3pm'])
# Temperature 9am
temp9am = float(request.form['temp9am'])
# Temperature 3pm
temp3pm = float(request.form['temp3pm'])
37
Frontend Code(HTML):
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rainy Brain</title>
<link rel="stylesheet" href={{url_for('static',filename='style1.css')}}>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.14.0/css/all.min.css">
</head>
<body>
<section>
<input type="checkbox" id="check">
<header>
</div>
<h2><a href="#" class="logo">Rainy Brain</a></h2>
<div class="navigation">
<a href="#">Home</a>
<a href="#about">About Rainy Brain</a>
<a href="#dashboard">Dashboard</a>
<a href="#info">Developer</a>
<a href="/predict">Predictor</a>
</div>
<label for="check">
<i class="fas fa-bars menu-btn"></i>
<i class="fas fa-times close-btn"></i>
</label>
</header>
<div class="content" style="margin-top: 8%;">
<div class="info">
<h2>Plant Trees <br><span>Save Rain</span></h2>
<p> "Plant trees to bring the rains and get rid of the summer's heat.” - Trees help
reduce and moderate the temperature and climate, which is why it is so important that we
have more of them</p>
<a href="#about" class="info-btn">More info</a>
</div>
<section id="about">
<h2>About Rainy Brain</h2>
<p class="about-content" style="text-align: center;">Rainy Brain is a web app which has
a Machine Learning model running at the back. The purpose of developing this app is to
predict whether it will rain the next day or not.
Occasionally, tropical cyclones can bring heavy
rainfall to tropical coastal regions, which is also likely to reach further inland.
</p>
</section>
<section id="dashboard">
38
<h2>Dashboard</h2>
<p>This dashboard is done using a software called PowerBI which is a product of
Microsoft.
Here I have just attached the images of the dashboard because PowerBI needs
oraganizational
account. So to see the visualizations interactive I am attaching my <a
href="../static/rain.pbix" style="color: black; font-weight: bold;">PowerBI</a>
dashboard file. This requires PowerBI software to open the file. The usage of
dashboards like
these is to bring a better understanding about the dataset and also to bring some
beautiful insights</p>
<img class="dashboard-image" src="../static/dashboard.png" alt="1">
<div>
<img src="../static/1.png" alt="1">
<img src="../static/3.png" alt="3">
<img src="../static/4.png" alt="4">
<img src="../static/5.png" alt="5">
<img src="../static/6.png" alt="6">
<img src="../static/7.png" alt="7">
<img src="../static/8.png" alt="8">
<img src="../static/9.png" alt="9">
</div>
</section>
<section id="info">
<div>
<img src="../static/abc.png" alt="Shashank">
</div>
<div>
<h2>Developer</h2></br>
<ul style="list-style-type:circle">
<li style="font-size:25px">Shashank Kumar (20MCA0142)</li>
<li style="font-size:25px">Vishal Kumar (20MCA0238)</li>
<li style="font-size:25px">Devansh Tiwari (20MCA0007)</li>
<li style="font-size:25px">Prachi Jha (20MCA0143)</li>
<footer>
<p>
Developed with Shashank & Team
</p>
<div class="media-icons">
<a href="https://www.linkedin.com/in/shashank-kumar-sk269/"><i class="fab fa-
linkedin"></i></a>
<a href="https://github.com/kumar-shashank"><i class="fab fa-github"></i></a>
<a href="https://twitter.com/"><i class="fab fa-twitter"></i></a>
</div>
</footer>
</body>
</html>
39
Output:
The Output shows a user interface page that is built using HTML,CSS also we use Python
Flask For Web Framework.
40
We get the predicted rainfall in ‘mm’ of an state were input is month and year.
41
CONCLUSION :
42