SlideShare uma empresa Scribd logo
1 de 30
DATA ANALYSIS ON
WEATHER FORECASTING
Prepared by,
Trupti Shingala
Introduction: Dataset
We have used weather forecast dataset having 366
observations from rattle package in R.
Used following Independent variables from the
dataset:
Max_Temperature , Min_Temperature,
WindSpeed3pm,WindSpeed9am, Pressure3pm,
Humidity9am, Humidity3pm,RainToday,
RainTomorrow.
Data Clean and Goals
 Replaced the missing value with the field mean for
numerical data.
 Implement various algorithms on the data to help
derive conclusion on classification and clustering of
data.
Algorithms used
Classification:
 K-nearest neighbors
 Naive Bayes
 DecisionTree- Rpart
Clustering:
 K means clustering
Classification and RegressionTree
 The decision trees produced by CART are
strictly binary, containing exactly two branches
for each decision node.
 CART recursively partitions the records in the
training data set into subsets of records with
similar values for the target attribute.
 The CART algorithm grows the tree by
conducting for each decision node, an
exhaustive search of all available variables and
all possible splitting values.
 Formula = Rain_Tomorrow ~ min_temp+
max_temp+windspeed9am+windspeed3pm+h
umidity3pm+pressure3pm
DecisionTree
Decision Tree
 To determine if the tree is appropriate or if some of the
branches need to be subjected to pruning we can use
the cptable element of the rpart object:
 The xerror column contains of estimates of cross-
validated prediction error for different numbers of splits
(nsplit).The best tree has three splits.
 Now we can prune back the large initial tree using the
min Cp value.
The error rate of the decision tree after pruning is 16%
K-MEANS CLUSTRING
 k-means clustering is a method of vector
quantization, originally from signal processing, that is
popular for cluster analysis in data mining.
 The goal of K-Means algorithm is to find the best
division of n entities in k groups, so that the total
distance between the group's members and its
corresponding centroid, representative of the group,
is minimized.
 Formally, the goal is to partition the n entities
into k sets Si, i=1, 2, ..., k in order to minimize the
within-cluster sum of squares (WCSS), defined as:
K-means Algorithm Step #1
A typical version of the K-means algorithm runs
in the following steps:
1. Initial cluster seeds are
chosen (at random).
– These represent the
“temporary” means of the
clusters.
– Imagine our random
numbers were 60 for
group 1 and 70 for group
SEED1
SEED
2
K-means Algorithm Step #2
2.The squared
Euclidean distance
from each object to
each cluster is
computed, and each
object is assigned to
the closest cluster.
K-means Algorithm Step #3
3. For each
cluster, the new
centroid is
computed – and
each seed value
is now replaced
by the respective
cluster centroid.
• The new
mean for cluster
1 is 62.3
• The new
mean for cluster
2 is 68.9
K-means Algorithm Step #4 – #6
4.The squared Euclidean distance from an
object to each cluster is computed, and the
object is assigned to the cluster with the
smallest squared Euclidean distance.
5.The cluster centroids are recalculated
based on the new membership assignment.
6. Steps 4 and 5 are repeated until no object
moves clusters.
Applications
 market segmentation
 computer vision
 geostatistics
 astronomy
 Agriculture
 It often is used as a preprocessing step
for other algorithms, for example to find a
starting configuration.
FREQUENCYTABLE
 for k=2
For k=3
PLOTTING CLUSTER
FOR K=2 FOR K=3
Naïve Bayes Classifier
 Computes the conditional a-posterior
probabilities of a categorical class variable
given independent predictor variables
using the Bayes rule.
Naïve Bayes Classifier(Cont..)
 Naive Bayes classifiers assume that the
effect of a variable value on a given class is
independent of the values of other
variable.This assumption is called class
conditional independence.
 An advantage of the naive Bayes classifier
is that it requires a small amount of
training data to estimate the variable
values necessary for classification.
Naïve Bayes Classifier(Cont..)
 Here, we implemented Naïve Bayes on
RainToday and RainTomorrow attributes with
another attributes of MinTemp, MaxTemp,
Temp9am,Temp3pm, Pressure9am,
Pressure3pm.
Naïve Bayes Classifier(Cont..)
 Perform naïve Bayes on categorical data only. Here
in predict model if type is row then the
conditional a-posterior probabilities for each class
are returned.
 Else the class with maximum probability is
returned
Naïve Bayes Classifier(Cont..)
Pred No Yes
No 300 66
Yes 0 0
 Output
 Perform naïve Bayes using Laplace
smoothing. It is technique that used to
smooth categorical data.
 The default (0) value of laplace disables
Laplace smoothing.
Naïve Bayes Classifier(Cont..)
Naïve Bayes Classifier(Cont..)
Pred No Yes
No 258 34
Yes 42 32
Pred No Yes
No 271 38
Yes 29 28
 RainToday  RainTomorrow
 It is a Lazy Learning Algorithm
 Whenever we have a new point to classify , we
find its K nearest neighbors from the training
data
 It Defers the decision to generalize the past
training examples till a new query is encountered
 K-NN uses distance function to calculate the
distance between points from the center
 Our Goal is to specify for which value of K the
weather data is most accurate
K - Nearest Neighbor
 Given a query instance xq to be classified,
 Let x1,x2….xk denote the k instances from
training examples that are nearest to xq
 Return the class that represents the maximum of
the k instances
 For eg: if we take K=5
In this case query Xq
Will be classified as
Negative since 3 of its
Nearest neighbors are classified as negative
K - Nearest Neighbor
K-Nearest Neighbor – Transitional
Conclusions
 For K = 1 we have following Table result & error
rate for rain tomorrow
 For K = 2 we have followingTable result &
error rate for rain tomorrow
 For K = 5 we have following Table result & error rate for
rain tomorrow
 For K = 10 we have following Table result & error
rate for rain tomorrow
K - Nearest Neighbor
K-Nearest Neighbor – Conclusions
and Error Rate
 The error rate changes every time since
the training and the test dataset are not
stable
 The error rate is 21%
Comparison of Algorithms
Accuracy of the following algorithms are:
1. KNN – 79%
2. K-means – 80.5%
3. Decision tree – 84%

Mais conteúdo relacionado

Mais procurados

lazy learners and other classication methods
lazy learners and other classication methodslazy learners and other classication methods
lazy learners and other classication methodsrajshreemuthiah
 
IRJET - Intelligent Weather Forecasting using Machine Learning Techniques
IRJET -  	  Intelligent Weather Forecasting using Machine Learning TechniquesIRJET -  	  Intelligent Weather Forecasting using Machine Learning Techniques
IRJET - Intelligent Weather Forecasting using Machine Learning TechniquesIRJET Journal
 
Machine Learning for Disease Prediction
Machine Learning for Disease PredictionMachine Learning for Disease Prediction
Machine Learning for Disease PredictionMustafa Oğuz
 
Data cube computation
Data cube computationData cube computation
Data cube computationRashmi Sheikh
 
Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...
Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...
Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...IRJET Journal
 
Vc dimension in Machine Learning
Vc dimension in Machine LearningVc dimension in Machine Learning
Vc dimension in Machine LearningVARUN KUMAR
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learningAmAn Singh
 
Inductive analytical approaches to learning
Inductive analytical approaches to learningInductive analytical approaches to learning
Inductive analytical approaches to learningswapnac12
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersFunctional Imperative
 
Crop predction ppt using ANN
Crop predction ppt using ANNCrop predction ppt using ANN
Crop predction ppt using ANNAstha Jain
 
Prediction of rainfall using image processing
Prediction of rainfall using image processingPrediction of rainfall using image processing
Prediction of rainfall using image processingVineesh Kumar
 
Random forest
Random forestRandom forest
Random forestUjjawal
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsMd. Main Uddin Rony
 
Grid based method & model based clustering method
Grid based method & model based clustering methodGrid based method & model based clustering method
Grid based method & model based clustering methodrajshreemuthiah
 
Crop prediction using machine learning
Crop prediction using machine learningCrop prediction using machine learning
Crop prediction using machine learningdataalcott
 

Mais procurados (20)

Rain project
Rain project Rain project
Rain project
 
lazy learners and other classication methods
lazy learners and other classication methodslazy learners and other classication methods
lazy learners and other classication methods
 
IRJET - Intelligent Weather Forecasting using Machine Learning Techniques
IRJET -  	  Intelligent Weather Forecasting using Machine Learning TechniquesIRJET -  	  Intelligent Weather Forecasting using Machine Learning Techniques
IRJET - Intelligent Weather Forecasting using Machine Learning Techniques
 
Machine Learning for Disease Prediction
Machine Learning for Disease PredictionMachine Learning for Disease Prediction
Machine Learning for Disease Prediction
 
Data cube computation
Data cube computationData cube computation
Data cube computation
 
Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...
Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...
Crop Recommendation System to Maximize Crop Yield using Machine Learning Tech...
 
Vc dimension in Machine Learning
Vc dimension in Machine LearningVc dimension in Machine Learning
Vc dimension in Machine Learning
 
Concept learning
Concept learningConcept learning
Concept learning
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
 
Inductive analytical approaches to learning
Inductive analytical approaches to learningInductive analytical approaches to learning
Inductive analytical approaches to learning
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
 
Crop predction ppt using ANN
Crop predction ppt using ANNCrop predction ppt using ANN
Crop predction ppt using ANN
 
Prediction of rainfall using image processing
Prediction of rainfall using image processingPrediction of rainfall using image processing
Prediction of rainfall using image processing
 
Random forest
Random forestRandom forest
Random forest
 
Weather forecasting
Weather forecastingWeather forecasting
Weather forecasting
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
 
Grid based method & model based clustering method
Grid based method & model based clustering methodGrid based method & model based clustering method
Grid based method & model based clustering method
 
BIG DATA TO AVOID WEATHER RELATED FLIGHT DELAYS PPT
BIG DATA TO AVOID WEATHER RELATED FLIGHT DELAYS PPTBIG DATA TO AVOID WEATHER RELATED FLIGHT DELAYS PPT
BIG DATA TO AVOID WEATHER RELATED FLIGHT DELAYS PPT
 
Predictive Modelling
Predictive ModellingPredictive Modelling
Predictive Modelling
 
Crop prediction using machine learning
Crop prediction using machine learningCrop prediction using machine learning
Crop prediction using machine learning
 

Semelhante a Data analysis of weather forecasting

Enhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetEnhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetAlaaZ
 
Parallel kmeans clustering in Erlang
Parallel kmeans clustering in ErlangParallel kmeans clustering in Erlang
Parallel kmeans clustering in ErlangChinmay Patel
 
3.2 partitioning methods
3.2 partitioning methods3.2 partitioning methods
3.2 partitioning methodsKrish_ver2
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Zihui Li
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmOptimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmIJERA Editor
 
Instance based learning
Instance based learningInstance based learning
Instance based learningswapnac12
 
CLUSTER ANALYSIS ALGORITHMS.pptx
CLUSTER ANALYSIS ALGORITHMS.pptxCLUSTER ANALYSIS ALGORITHMS.pptx
CLUSTER ANALYSIS ALGORITHMS.pptxShwetapadmaBabu1
 
Premeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means ClusteringPremeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means ClusteringIJCSIS Research Publications
 
CSA 3702 machine learning module 3
CSA 3702 machine learning module 3CSA 3702 machine learning module 3
CSA 3702 machine learning module 3Nandhini S
 
Parallel Algorithms K – means Clustering
Parallel Algorithms K – means ClusteringParallel Algorithms K – means Clustering
Parallel Algorithms K – means ClusteringAndreina Uzcategui
 
An improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracyAn improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracyijpla
 
MLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackMLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackarogozhnikov
 
Parallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationParallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationGeoffrey Fox
 
Matrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsMatrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsYONG ZHENG
 

Semelhante a Data analysis of weather forecasting (20)

Enhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetEnhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial Dataset
 
Parallel kmeans clustering in Erlang
Parallel kmeans clustering in ErlangParallel kmeans clustering in Erlang
Parallel kmeans clustering in Erlang
 
Neural nw k means
Neural nw k meansNeural nw k means
Neural nw k means
 
3.2 partitioning methods
3.2 partitioning methods3.2 partitioning methods
3.2 partitioning methods
 
Knn 160904075605-converted
Knn 160904075605-convertedKnn 160904075605-converted
Knn 160904075605-converted
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmOptimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
 
Instance based learning
Instance based learningInstance based learning
Instance based learning
 
CLUSTER ANALYSIS ALGORITHMS.pptx
CLUSTER ANALYSIS ALGORITHMS.pptxCLUSTER ANALYSIS ALGORITHMS.pptx
CLUSTER ANALYSIS ALGORITHMS.pptx
 
K Means Clustering in ML.pptx
K Means Clustering in ML.pptxK Means Clustering in ML.pptx
K Means Clustering in ML.pptx
 
Premeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means ClusteringPremeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means Clustering
 
CSA 3702 machine learning module 3
CSA 3702 machine learning module 3CSA 3702 machine learning module 3
CSA 3702 machine learning module 3
 
K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)
 
Parallel Algorithms K – means Clustering
Parallel Algorithms K – means ClusteringParallel Algorithms K – means Clustering
Parallel Algorithms K – means Clustering
 
An improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracyAn improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracy
 
MLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackMLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic track
 
Parallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationParallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel application
 
Clustering
ClusteringClustering
Clustering
 
KNN.pptx
KNN.pptxKNN.pptx
KNN.pptx
 
Matrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsMatrix Factorization In Recommender Systems
Matrix Factorization In Recommender Systems
 

Último

Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...amitlee9823
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 

Último (20)

Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 

Data analysis of weather forecasting

  • 1. DATA ANALYSIS ON WEATHER FORECASTING Prepared by, Trupti Shingala
  • 2. Introduction: Dataset We have used weather forecast dataset having 366 observations from rattle package in R. Used following Independent variables from the dataset: Max_Temperature , Min_Temperature, WindSpeed3pm,WindSpeed9am, Pressure3pm, Humidity9am, Humidity3pm,RainToday, RainTomorrow.
  • 3. Data Clean and Goals  Replaced the missing value with the field mean for numerical data.  Implement various algorithms on the data to help derive conclusion on classification and clustering of data.
  • 4. Algorithms used Classification:  K-nearest neighbors  Naive Bayes  DecisionTree- Rpart Clustering:  K means clustering
  • 5. Classification and RegressionTree  The decision trees produced by CART are strictly binary, containing exactly two branches for each decision node.  CART recursively partitions the records in the training data set into subsets of records with similar values for the target attribute.  The CART algorithm grows the tree by conducting for each decision node, an exhaustive search of all available variables and all possible splitting values.  Formula = Rain_Tomorrow ~ min_temp+ max_temp+windspeed9am+windspeed3pm+h umidity3pm+pressure3pm
  • 7. Decision Tree  To determine if the tree is appropriate or if some of the branches need to be subjected to pruning we can use the cptable element of the rpart object:  The xerror column contains of estimates of cross- validated prediction error for different numbers of splits (nsplit).The best tree has three splits.  Now we can prune back the large initial tree using the min Cp value.
  • 8. The error rate of the decision tree after pruning is 16%
  • 9. K-MEANS CLUSTRING  k-means clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining.  The goal of K-Means algorithm is to find the best division of n entities in k groups, so that the total distance between the group's members and its corresponding centroid, representative of the group, is minimized.  Formally, the goal is to partition the n entities into k sets Si, i=1, 2, ..., k in order to minimize the within-cluster sum of squares (WCSS), defined as:
  • 10. K-means Algorithm Step #1 A typical version of the K-means algorithm runs in the following steps: 1. Initial cluster seeds are chosen (at random). – These represent the “temporary” means of the clusters. – Imagine our random numbers were 60 for group 1 and 70 for group SEED1 SEED 2
  • 11. K-means Algorithm Step #2 2.The squared Euclidean distance from each object to each cluster is computed, and each object is assigned to the closest cluster.
  • 12. K-means Algorithm Step #3 3. For each cluster, the new centroid is computed – and each seed value is now replaced by the respective cluster centroid. • The new mean for cluster 1 is 62.3 • The new mean for cluster 2 is 68.9
  • 13. K-means Algorithm Step #4 – #6 4.The squared Euclidean distance from an object to each cluster is computed, and the object is assigned to the cluster with the smallest squared Euclidean distance. 5.The cluster centroids are recalculated based on the new membership assignment. 6. Steps 4 and 5 are repeated until no object moves clusters.
  • 14. Applications  market segmentation  computer vision  geostatistics  astronomy  Agriculture  It often is used as a preprocessing step for other algorithms, for example to find a starting configuration.
  • 18. Naïve Bayes Classifier  Computes the conditional a-posterior probabilities of a categorical class variable given independent predictor variables using the Bayes rule.
  • 19. Naïve Bayes Classifier(Cont..)  Naive Bayes classifiers assume that the effect of a variable value on a given class is independent of the values of other variable.This assumption is called class conditional independence.  An advantage of the naive Bayes classifier is that it requires a small amount of training data to estimate the variable values necessary for classification.
  • 20. Naïve Bayes Classifier(Cont..)  Here, we implemented Naïve Bayes on RainToday and RainTomorrow attributes with another attributes of MinTemp, MaxTemp, Temp9am,Temp3pm, Pressure9am, Pressure3pm.
  • 21. Naïve Bayes Classifier(Cont..)  Perform naïve Bayes on categorical data only. Here in predict model if type is row then the conditional a-posterior probabilities for each class are returned.  Else the class with maximum probability is returned
  • 22. Naïve Bayes Classifier(Cont..) Pred No Yes No 300 66 Yes 0 0  Output
  • 23.  Perform naïve Bayes using Laplace smoothing. It is technique that used to smooth categorical data.  The default (0) value of laplace disables Laplace smoothing. Naïve Bayes Classifier(Cont..)
  • 24. Naïve Bayes Classifier(Cont..) Pred No Yes No 258 34 Yes 42 32 Pred No Yes No 271 38 Yes 29 28  RainToday  RainTomorrow
  • 25.  It is a Lazy Learning Algorithm  Whenever we have a new point to classify , we find its K nearest neighbors from the training data  It Defers the decision to generalize the past training examples till a new query is encountered  K-NN uses distance function to calculate the distance between points from the center  Our Goal is to specify for which value of K the weather data is most accurate K - Nearest Neighbor
  • 26.  Given a query instance xq to be classified,  Let x1,x2….xk denote the k instances from training examples that are nearest to xq  Return the class that represents the maximum of the k instances  For eg: if we take K=5 In this case query Xq Will be classified as Negative since 3 of its Nearest neighbors are classified as negative K - Nearest Neighbor
  • 27. K-Nearest Neighbor – Transitional Conclusions  For K = 1 we have following Table result & error rate for rain tomorrow  For K = 2 we have followingTable result & error rate for rain tomorrow
  • 28.  For K = 5 we have following Table result & error rate for rain tomorrow  For K = 10 we have following Table result & error rate for rain tomorrow K - Nearest Neighbor
  • 29. K-Nearest Neighbor – Conclusions and Error Rate  The error rate changes every time since the training and the test dataset are not stable  The error rate is 21%
  • 30. Comparison of Algorithms Accuracy of the following algorithms are: 1. KNN – 79% 2. K-means – 80.5% 3. Decision tree – 84%