SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Time Series Analysis with R1
Yanchang Zhao
http://www.RDataMining.com
R and Data Mining Workshop @ AusDM 2014
27 November 2014
1
Presented at UJAT and Canberra R Users Group
1 / 39
Outline
Introduction
Time Series Decomposition
Time Series Forecasting
Time Series Clustering
Time Series Classification
Online Resources
2 / 39
Time Series Analysis with R 2
time series data in R
time series decomposition, forecasting, clustering and
classification
autoregressive integrated moving average (ARIMA) model
Dynamic Time Warping (DTW)
Discrete Wavelet Transform (DWT)
k-NN classification
2
Chapter 8: Time Series Analysis and Mining, in book
R and Data Mining: Examples and Case Studies.
http://www.rdatamining.com/docs/RDataMining.pdf
3 / 39
R
a free software environment for statistical computing and
graphics
runs on Windows, Linux and MacOS
widely used in academia and research, as well as industrial
applications
5,800+ packages (as of 13 Sept 2014)
CRAN Task View: Time Series Analysis
http://cran.r-project.org/web/views/TimeSeries.html
4 / 39
Time Series Data in R
class ts
represents data which has been sampled at equispaced points
in time
frequency=7: a weekly series
frequency=12: a monthly series
frequency=4: a quarterly series
5 / 39
Time Series Data in R
a <- ts(1:20, frequency = 12, start = c(2011, 3))
print(a)
## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 2011 1 2 3 4 5 6 7 8 9 10
## 2012 11 12 13 14 15 16 17 18 19 20
str(a)
## Time-Series [1:20] from 2011 to 2013: 1 2 3 4 5 6 7 8 9 10...
attributes(a)
## $tsp
## [1] 2011 2013 12
##
## $class
## [1] "ts"
6 / 39
Outline
Introduction
Time Series Decomposition
Time Series Forecasting
Time Series Clustering
Time Series Classification
Online Resources
7 / 39
What is Time Series Decomposition
To decompose a time series into components:
Trend component: long term trend
Seasonal component: seasonal variation
Cyclical component: repeated but non-periodic fluctuations
Irregular component: the residuals
8 / 39
Data AirPassengers
Data AirPassengers: monthly totals of Box Jenkins international
airline passengers, 1949 to 1960. It has 144(=12×12) values.
plot(AirPassengers)
Time
AirPassengers
1950 1952 1954 1956 1958 1960
100200300400500600
9 / 39
Decomposition
apts <- ts(AirPassengers, frequency = 12)
f <- decompose(apts)
plot(f$figure, type = "b") # seasonal figures
2 4 6 8 10 12
−40−200204060
Index
f$figure
10 / 39
Decomposition
plot(f)
100300500
observed
150250350450
trend
−400204060
seasonal
−400204060
2 4 6 8 10 12
random
Time
Decomposition of additive time series
11 / 39
Outline
Introduction
Time Series Decomposition
Time Series Forecasting
Time Series Clustering
Time Series Classification
Online Resources
12 / 39
Time Series Forecasting
To forecast future events based on known past data
For example, to predict the price of a stock based on its past
performance
Popular models
Autoregressive moving average (ARMA)
Autoregressive integrated moving average (ARIMA)
13 / 39
Forecasting
# build an ARIMA model
fit <- arima(AirPassengers, order = c(1, 0, 0), list(order = c(2,
1, 0), period = 12))
fore <- predict(fit, n.ahead = 24)
# error bounds at 95% confidence level
U <- fore$pred + 2 * fore$se
L <- fore$pred - 2 * fore$se
ts.plot(AirPassengers, fore$pred, U, L,
col = c(1, 2, 4, 4), lty = c(1, 1, 2, 2))
legend("topleft", col = c(1, 2, 4), lty = c(1, 1, 2),
c("Actual", "Forecast", "Error Bounds (95% Confidence)"))
14 / 39
Forecasting
Time
1950 1952 1954 1956 1958 1960 1962
100200300400500600700
Actual
Forecast
Error Bounds (95% Confidence)
15 / 39
Outline
Introduction
Time Series Decomposition
Time Series Forecasting
Time Series Clustering
Time Series Classification
Online Resources
16 / 39
Time Series Clustering
To partition time series data into groups based on similarity or
distance, so that time series in the same cluster are similar
Measure of distance/dissimilarity
Euclidean distance
Manhattan distance
Maximum norm
Hamming distance
The angle between two vectors (inner product)
Dynamic Time Warping (DTW) distance
...
17 / 39
Dynamic Time Warping (DTW)
DTW finds optimal alignment between two time series.
library(dtw)
idx <- seq(0, 2 * pi, len = 100)
a <- sin(idx) + runif(100)/10
b <- cos(idx)
align <- dtw(a, b, step = asymmetricP1, keep = T)
dtwPlotTwoWay(align)
Index
Queryvalue
0 20 40 60 80 100
−1.0−0.50.00.51.0
18 / 39
Synthetic Control Chart Time Series
The dataset contains 600 examples of control charts
synthetically generated by the process in Alcock and
Manolopoulos (1999).
Each control chart is a time series with 60 values.
Six classes:
1-100 Normal
101-200 Cyclic
201-300 Increasing trend
301-400 Decreasing trend
401-500 Upward shift
501-600 Downward shift
http://kdd.ics.uci.edu/databases/synthetic_control/synthetic_
control.html
19 / 39
Synthetic Control Chart Time Series
# read data into R sep='': the separator is white space, i.e., one
# or more spaces, tabs, newlines or carriage returns
sc <- read.table("./data/synthetic_control.data", header = F, sep = "")
# show one sample from each class
idx <- c(1, 101, 201, 301, 401, 501)
sample1 <- t(sc[idx, ])
plot.ts(sample1, main = "")
20 / 39
Six Classes
24262830323436
1
15202530354045
101
2530354045
0 10 20 30 40 50 60
201
Time
0102030
301
2530354045
401
101520253035
0 10 20 30 40 50 60
501
Time
21 / 39
Hierarchical Clustering with Euclidean distance
# sample n cases from every class
n <- 10
s <- sample(1:100, n)
idx <- c(s, 100 + s, 200 + s, 300 + s, 400 + s, 500 + s)
sample2 <- sc[idx, ]
observedLabels <- rep(1:6, each = n)
# hierarchical clustering with Euclidean distance
hc <- hclust(dist(sample2), method = "ave")
plot(hc, labels = observedLabels, main = "")
22 / 39
Hierarchical Clustering with Euclidean distance
6
4
6
6
6
6
6
6
6
6
6
4
4
4
4
4
4
4
4
4
3
3
3
3
3
3
5
5
5
5
5
5
3
3
3
3
5
5
5
5
2
2
2
2
2
2
2
2
2
2
1
1
1
1
1
1
1
1
1
1
20406080100120140
hclust (*, "average")
dist(sample2)
Height
23 / 39
Hierarchical Clustering with Euclidean distance
# cut tree to get 8 clusters
memb <- cutree(hc, k = 8)
table(observedLabels, memb)
## memb
## observedLabels 1 2 3 4 5 6 7 8
## 1 10 0 0 0 0 0 0 0
## 2 0 3 1 1 3 2 0 0
## 3 0 0 0 0 0 0 10 0
## 4 0 0 0 0 0 0 0 10
## 5 0 0 0 0 0 0 10 0
## 6 0 0 0 0 0 0 0 10
24 / 39
Hierarchical Clustering with DTW Distance
myDist <- dist(sample2, method = "DTW")
hc <- hclust(myDist, method = "average")
plot(hc, labels = observedLabels, main = "")
# cut tree to get 8 clusters
memb <- cutree(hc, k = 8)
table(observedLabels, memb)
## memb
## observedLabels 1 2 3 4 5 6 7 8
## 1 10 0 0 0 0 0 0 0
## 2 0 4 3 2 1 0 0 0
## 3 0 0 0 0 0 6 4 0
## 4 0 0 0 0 0 0 0 10
## 5 0 0 0 0 0 0 10 0
## 6 0 0 0 0 0 0 0 10
25 / 39
Hierarchical Clustering with DTW Distance
3
3
3
3
3
3
5
5
3
3
3
3
5
5
5
5
5
5
5
5
6
6
6
4
6
4
4
4
4
4
4
4
4
4
6
6
6
6
6
6
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
02004006008001000
hclust (*, "average")
myDist
Height
26 / 39
Outline
Introduction
Time Series Decomposition
Time Series Forecasting
Time Series Clustering
Time Series Classification
Online Resources
27 / 39
Time Series Classification
Time Series Classification
To build a classification model based on labelled time series
and then use the model to predict the lable of unlabelled time
series
Feature Extraction
Singular Value Decomposition (SVD)
Discrete Fourier Transform (DFT)
Discrete Wavelet Transform (DWT)
Piecewise Aggregate Approximation (PAA)
Perpetually Important Points (PIP)
Piecewise Linear Representation
Symbolic Representation
28 / 39
Decision Tree (ctree)
ctree from package party
classId <- rep(as.character(1:6), each = 100)
newSc <- data.frame(cbind(classId, sc))
library(party)
ct <- ctree(classId ~ ., data = newSc,
controls = ctree_control(minsplit = 20,
minbucket = 5, maxdepth = 5))
29 / 39
Decision Tree
pClassId <- predict(ct)
table(classId, pClassId)
## pClassId
## classId 1 2 3 4 5 6
## 1 100 0 0 0 0 0
## 2 1 97 2 0 0 0
## 3 0 0 99 0 1 0
## 4 0 0 0 100 0 0
## 5 4 0 8 0 88 0
## 6 0 3 0 90 0 7
# accuracy
(sum(classId == pClassId))/nrow(sc)
## [1] 0.8183
30 / 39
DWT (Discrete Wavelet Transform)
Wavelet transform provides a multi-resolution representation
using wavelets.
Haar Wavelet Transform – the simplest DWT
http://dmr.ath.cx/gfx/haar/
DFT (Discrete Fourier Transform): another popular feature
extraction technique
31 / 39
DWT (Discrete Wavelet Transform)
# extract DWT (with Haar filter) coefficients
library(wavelets)
wtData <- NULL
for (i in 1:nrow(sc)) {
a <- t(sc[i, ])
wt <- dwt(a, filter = "haar", boundary = "periodic")
wtData <- rbind(wtData, unlist(c(wt@W, wt@V[[wt@level]])))
}
wtData <- as.data.frame(wtData)
wtSc <- data.frame(cbind(classId, wtData))
32 / 39
Decision Tree with DWT
ct <- ctree(classId ~ ., data = wtSc,
controls = ctree_control(minsplit=20, minbucket=5,
maxdepth=5))
pClassId <- predict(ct)
table(classId, pClassId)
## pClassId
## classId 1 2 3 4 5 6
## 1 98 2 0 0 0 0
## 2 1 99 0 0 0 0
## 3 0 0 81 0 19 0
## 4 0 0 0 74 0 26
## 5 0 0 16 0 84 0
## 6 0 0 0 3 0 97
(sum(classId==pClassId)) / nrow(wtSc)
## [1] 0.8883
33 / 39
plot(ct, ip_args = list(pval = F), ep_args = list(digits = 0))
V57
1
≤ 117 > 117
W43
2
≤ −4 > −4
W5
3
≤ −8 > −8
Node 4 (n = 68)
123456
0
0.2
0.4
0.6
0.8
1
Node 5 (n = 6)
123456
0
0.2
0.4
0.6
0.8
1
W31
6
≤ −6 > −6
Node 7 (n = 9)
123456
0
0.2
0.4
0.6
0.8
1
Node 8 (n = 86)
123456
0
0.2
0.4
0.6
0.8
1
V57
9
≤ 140 > 140
Node 10 (n = 31)
123456
0
0.2
0.4
0.6
0.8
1
V57
11
≤ 178 > 178
W22
12
≤ −6 > −6
Node 13 (n = 80)
123456
0
0.2
0.4
0.6
0.8
1
W31
14
≤ −13 > −13
Node 15 (n = 9)
123456
0
0.2
0.4
0.6
0.8
1
Node 16 (n = 99)
123456
0
0.2
0.4
0.6
0.8
1
W31
17
≤ −15 > −15
Node 18 (n = 12)
123456
0
0.2
0.4
0.6
0.8
1
W43
19
≤ 3 > 3
Node 20 (n = 103)
123456
0
0.2
0.4
0.6
0.8
1
Node 21 (n = 97)
123456
0
0.2
0.4
0.6
0.8
1
34 / 39
k-NN Classification
find the k nearest neighbours of a new instance
label it by majority voting
needs an efficient indexing structure for large datasets
k <- 20
newTS <- sc[501, ] + runif(100) * 15
distances <- dist(newTS, sc, method = "DTW")
s <- sort(as.vector(distances), index.return = TRUE)
# class IDs of k nearest neighbours
table(classId[s$ix[1:k]])
##
## 4 6
## 3 17
35 / 39
k-NN Classification
find the k nearest neighbours of a new instance
label it by majority voting
needs an efficient indexing structure for large datasets
k <- 20
newTS <- sc[501, ] + runif(100) * 15
distances <- dist(newTS, sc, method = "DTW")
s <- sort(as.vector(distances), index.return = TRUE)
# class IDs of k nearest neighbours
table(classId[s$ix[1:k]])
##
## 4 6
## 3 17
Results of majority voting: class 6
35 / 39
The TSclust Package
TSclust: a package for time seriesclustering 3
measures of dissimilarity between time series to perform time
series clustering.
metrics based on raw data, on generating models and on the
forecast behavior
time series clustering algorithms and cluster evaluation metrics
3
http://cran.r-project.org/web/packages/TSclust/
36 / 39
Outline
Introduction
Time Series Decomposition
Time Series Forecasting
Time Series Clustering
Time Series Classification
Online Resources
37 / 39
Online Resources
Chapter 8: Time Series Analysis and Mining, in book
R and Data Mining: Examples and Case Studies
http://www.rdatamining.com/docs/RDataMining.pdf
R Reference Card for Data Mining
http://www.rdatamining.com/docs/R-refcard-data-mining.pdf
Free online courses and documents
http://www.rdatamining.com/resources/
RDataMining Group on LinkedIn (8,000+ members)
http://group.rdatamining.com
RDataMining on Twitter (1,800+ followers)
@RDataMining
38 / 39
The End
Thanks!
Email: yanchang(at)rdatamining.com
39 / 39

Weitere ähnliche Inhalte

Was ist angesagt?

5. R basics
5. R basics5. R basics
5. R basicsFAO
 
Association Rule Mining with R
Association Rule Mining with RAssociation Rule Mining with R
Association Rule Mining with RYanchang Zhao
 
R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for BeginnersMetamarkets
 
13. Cubist
13. Cubist13. Cubist
13. CubistFAO
 
R programming intro with examples
R programming intro with examplesR programming intro with examples
R programming intro with examplesDennis
 
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Databricks
 
The Ring programming language version 1.5.2 book - Part 35 of 181
The Ring programming language version 1.5.2 book - Part 35 of 181The Ring programming language version 1.5.2 book - Part 35 of 181
The Ring programming language version 1.5.2 book - Part 35 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 27 of 88
The Ring programming language version 1.3 book - Part 27 of 88The Ring programming language version 1.3 book - Part 27 of 88
The Ring programming language version 1.3 book - Part 27 of 88Mahmoud Samir Fayed
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting SpatialFAO
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavVyacheslav Arbuzov
 
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Dr. Volkan OBAN
 
The Ring programming language version 1.2 book - Part 25 of 84
The Ring programming language version 1.2 book - Part 25 of 84The Ring programming language version 1.2 book - Part 25 of 84
The Ring programming language version 1.2 book - Part 25 of 84Mahmoud Samir Fayed
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on rAbhik Seal
 
Oracle 12c SQL: Date Ranges
Oracle 12c SQL: Date RangesOracle 12c SQL: Date Ranges
Oracle 12c SQL: Date RangesStew Ashton
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)stasimus
 

Was ist angesagt? (20)

5. R basics
5. R basics5. R basics
5. R basics
 
Association Rule Mining with R
Association Rule Mining with RAssociation Rule Mining with R
Association Rule Mining with R
 
R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for Beginners
 
13. Cubist
13. Cubist13. Cubist
13. Cubist
 
R programming intro with examples
R programming intro with examplesR programming intro with examples
R programming intro with examples
 
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
 
The Ring programming language version 1.5.2 book - Part 35 of 181
The Ring programming language version 1.5.2 book - Part 35 of 181The Ring programming language version 1.5.2 book - Part 35 of 181
The Ring programming language version 1.5.2 book - Part 35 of 181
 
The Ring programming language version 1.3 book - Part 27 of 88
The Ring programming language version 1.3 book - Part 27 of 88The Ring programming language version 1.3 book - Part 27 of 88
The Ring programming language version 1.3 book - Part 27 of 88
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting Spatial
 
R and data mining
R and data miningR and data mining
R and data mining
 
R learning by examples
R learning by examplesR learning by examples
R learning by examples
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
 
Perm winter school 2014.01.31
Perm winter school 2014.01.31Perm winter school 2014.01.31
Perm winter school 2014.01.31
 
RHadoop, R meets Hadoop
RHadoop, R meets HadoopRHadoop, R meets Hadoop
RHadoop, R meets Hadoop
 
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
 
Seminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mmeSeminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mme
 
The Ring programming language version 1.2 book - Part 25 of 84
The Ring programming language version 1.2 book - Part 25 of 84The Ring programming language version 1.2 book - Part 25 of 84
The Ring programming language version 1.2 book - Part 25 of 84
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on r
 
Oracle 12c SQL: Date Ranges
Oracle 12c SQL: Date RangesOracle 12c SQL: Date Ranges
Oracle 12c SQL: Date Ranges
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)
 

Andere mochten auch

A little-book-of-r-for-time-series
A little-book-of-r-for-time-seriesA little-book-of-r-for-time-series
A little-book-of-r-for-time-seriesS DG
 
Time Series Modelling in R-Forecasting.
Time Series Modelling in R-Forecasting.Time Series Modelling in R-Forecasting.
Time Series Modelling in R-Forecasting.Dr. Volkan OBAN
 
Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...
Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...
Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...Justin Hunter
 
Chapter 5 ( some discrete probability distributions 21 april, 2014)
Chapter 5 ( some discrete probability distributions  21 april, 2014)Chapter 5 ( some discrete probability distributions  21 april, 2014)
Chapter 5 ( some discrete probability distributions 21 april, 2014)Rana Ehtisham Ul Haq
 
Quantitive Time Series Analysis of Malware and Vulnerability Trends
Quantitive Time Series Analysis of Malware and Vulnerability TrendsQuantitive Time Series Analysis of Malware and Vulnerability Trends
Quantitive Time Series Analysis of Malware and Vulnerability Trendsamiable_indian
 
Hamilton 1994 time series analysis
Hamilton 1994 time series analysisHamilton 1994 time series analysis
Hamilton 1994 time series analysisOzan Baskan
 
Exploring Best Practises in Design of Experiments
Exploring Best Practises in Design of ExperimentsExploring Best Practises in Design of Experiments
Exploring Best Practises in Design of ExperimentsJMP software from SAS
 
Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...
Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...
Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...JMP software from SAS
 
NG BB 47 Basic Design of Experiments
NG BB 47 Basic Design of ExperimentsNG BB 47 Basic Design of Experiments
NG BB 47 Basic Design of ExperimentsLeanleaders.org
 
ML on Big Data: Real-Time Analysis on Time Series
ML on Big Data: Real-Time Analysis on Time SeriesML on Big Data: Real-Time Analysis on Time Series
ML on Big Data: Real-Time Analysis on Time SeriesSigmoid
 
Time Series
Time SeriesTime Series
Time Seriesyush313
 
Gujrat
GujratGujrat
GujratUOG
 
New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...
New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...
New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...Spark Summit
 

Andere mochten auch (18)

A little-book-of-r-for-time-series
A little-book-of-r-for-time-seriesA little-book-of-r-for-time-series
A little-book-of-r-for-time-series
 
Time Series Modelling in R-Forecasting.
Time Series Modelling in R-Forecasting.Time Series Modelling in R-Forecasting.
Time Series Modelling in R-Forecasting.
 
Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...
Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...
Hexawise Software Test Design Tool - "Vendor Meets User" at CAST Software Tes...
 
Chapter 5 ( some discrete probability distributions 21 april, 2014)
Chapter 5 ( some discrete probability distributions  21 april, 2014)Chapter 5 ( some discrete probability distributions  21 april, 2014)
Chapter 5 ( some discrete probability distributions 21 april, 2014)
 
Quantitive Time Series Analysis of Malware and Vulnerability Trends
Quantitive Time Series Analysis of Malware and Vulnerability TrendsQuantitive Time Series Analysis of Malware and Vulnerability Trends
Quantitive Time Series Analysis of Malware and Vulnerability Trends
 
Hamilton 1994 time series analysis
Hamilton 1994 time series analysisHamilton 1994 time series analysis
Hamilton 1994 time series analysis
 
LeanUX: Online Design of Experiments
LeanUX: Online Design of ExperimentsLeanUX: Online Design of Experiments
LeanUX: Online Design of Experiments
 
Exploring Best Practises in Design of Experiments
Exploring Best Practises in Design of ExperimentsExploring Best Practises in Design of Experiments
Exploring Best Practises in Design of Experiments
 
Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...
Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...
Exploring Best Practises in Design of Experiments: A Data Driven Approach to ...
 
Design of Experiments
Design of ExperimentsDesign of Experiments
Design of Experiments
 
NG BB 47 Basic Design of Experiments
NG BB 47 Basic Design of ExperimentsNG BB 47 Basic Design of Experiments
NG BB 47 Basic Design of Experiments
 
ML on Big Data: Real-Time Analysis on Time Series
ML on Big Data: Real-Time Analysis on Time SeriesML on Big Data: Real-Time Analysis on Time Series
ML on Big Data: Real-Time Analysis on Time Series
 
Pharmaceutical Design of Experiments for Beginners
Pharmaceutical Design of Experiments for Beginners  Pharmaceutical Design of Experiments for Beginners
Pharmaceutical Design of Experiments for Beginners
 
Quality by Design : Design of experiments
Quality by Design : Design of experimentsQuality by Design : Design of experiments
Quality by Design : Design of experiments
 
Time Series
Time SeriesTime Series
Time Series
 
Slideshow
SlideshowSlideshow
Slideshow
 
Gujrat
GujratGujrat
Gujrat
 
New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...
New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...
New Directions in pySpark for Time Series Analysis: Spark Summit East talk by...
 

Ähnlich wie R data mining-Time Series Analysis with R

RDataMining slides-time-series-analysis
RDataMining slides-time-series-analysisRDataMining slides-time-series-analysis
RDataMining slides-time-series-analysisYanchang Zhao
 
Una introducción a la minería de series temporales
Una introducción a la minería de series temporalesUna introducción a la minería de series temporales
Una introducción a la minería de series temporalesFacultad de Informática UCM
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyrRomain Francois
 
Basic R Data Manipulation
Basic R Data ManipulationBasic R Data Manipulation
Basic R Data ManipulationChu An
 
Complex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutionsComplex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutionsPeter Solymos
 
Just in time (series) - KairosDB
Just in time (series) - KairosDBJust in time (series) - KairosDB
Just in time (series) - KairosDBVictor Anjos
 
HACKSing heterogeneity in cell motility
HACKSing heterogeneity in cell motilityHACKSing heterogeneity in cell motility
HACKSing heterogeneity in cell motilityHee June Choi
 
⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...
⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...
⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...Victor Asanza
 
RDataMining slides-clustering-with-r
RDataMining slides-clustering-with-rRDataMining slides-clustering-with-r
RDataMining slides-clustering-with-rYanchang Zhao
 
Next Generation Programming in R
Next Generation Programming in RNext Generation Programming in R
Next Generation Programming in RFlorian Uhlitz
 
maxbox starter60 machine learning
maxbox starter60 machine learningmaxbox starter60 machine learning
maxbox starter60 machine learningMax Kleiner
 
Parallel Computing with R
Parallel Computing with RParallel Computing with R
Parallel Computing with RPeter Solymos
 
DAW: Duplicate-AWare Federated Query Processing over the Web of Data
DAW: Duplicate-AWare Federated Query Processing over the Web of DataDAW: Duplicate-AWare Federated Query Processing over the Web of Data
DAW: Duplicate-AWare Federated Query Processing over the Web of DataMuhammad Saleem
 
Time series data mining techniques
Time series data mining techniquesTime series data mining techniques
Time series data mining techniquesShanmukha S. Potti
 
Accelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPUAccelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPUDavide Nardone
 

Ähnlich wie R data mining-Time Series Analysis with R (20)

RDataMining slides-time-series-analysis
RDataMining slides-time-series-analysisRDataMining slides-time-series-analysis
RDataMining slides-time-series-analysis
 
Una introducción a la minería de series temporales
Una introducción a la minería de series temporalesUna introducción a la minería de series temporales
Una introducción a la minería de series temporales
 
R Cheat Sheet
R Cheat SheetR Cheat Sheet
R Cheat Sheet
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
Basic R Data Manipulation
Basic R Data ManipulationBasic R Data Manipulation
Basic R Data Manipulation
 
Complex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutionsComplex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutions
 
Just in time (series) - KairosDB
Just in time (series) - KairosDBJust in time (series) - KairosDB
Just in time (series) - KairosDB
 
R programming language
R programming languageR programming language
R programming language
 
HACKSing heterogeneity in cell motility
HACKSing heterogeneity in cell motilityHACKSing heterogeneity in cell motility
HACKSing heterogeneity in cell motility
 
⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...
⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...
⭐⭐⭐⭐⭐ Device Free Indoor Localization in the 28 GHz band based on machine lea...
 
RDataMining slides-clustering-with-r
RDataMining slides-clustering-with-rRDataMining slides-clustering-with-r
RDataMining slides-clustering-with-r
 
RBootcam Day 2
RBootcam Day 2RBootcam Day 2
RBootcam Day 2
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Next Generation Programming in R
Next Generation Programming in RNext Generation Programming in R
Next Generation Programming in R
 
maxbox starter60 machine learning
maxbox starter60 machine learningmaxbox starter60 machine learning
maxbox starter60 machine learning
 
Parallel Computing with R
Parallel Computing with RParallel Computing with R
Parallel Computing with R
 
DAW: Duplicate-AWare Federated Query Processing over the Web of Data
DAW: Duplicate-AWare Federated Query Processing over the Web of DataDAW: Duplicate-AWare Federated Query Processing over the Web of Data
DAW: Duplicate-AWare Federated Query Processing over the Web of Data
 
Time series data mining techniques
Time series data mining techniquesTime series data mining techniques
Time series data mining techniques
 
Accelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPUAccelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPU
 

Mehr von Dr. Volkan OBAN

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Dr. Volkan OBAN
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - ExampleDr. Volkan OBAN
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python Dr. Volkan OBAN
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriDr. Volkan OBAN
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesDr. Volkan OBAN
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...Dr. Volkan OBAN
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in PythonDr. Volkan OBAN
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R Dr. Volkan OBAN
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with RDr. Volkan OBAN
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingDr. Volkan OBAN
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Dr. Volkan OBAN
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-PythonScikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-PythonDr. Volkan OBAN
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Dr. Volkan OBAN
 
Pandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheetPandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheetDr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleDr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleDr. Volkan OBAN
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package ExamplesDr. Volkan OBAN
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)Dr. Volkan OBAN
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.Dr. Volkan OBAN
 

Mehr von Dr. Volkan OBAN (20)

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - Example
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) Parametreleri
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - Examples
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in Python
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R
 
R forecasting Example
R forecasting ExampleR forecasting Example
R forecasting Example
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with R
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision Making
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-PythonScikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-Python
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
 
Pandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheetPandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheet
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package Examples
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.
 

Kürzlich hochgeladen

Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Boston Institute of Analytics
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryJeremy Anderson
 
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...GQ Research
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhhThiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhhYasamin16
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...ssuserf63bd7
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxellehsormae
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 
detection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxdetection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxAleenaJamil4
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 

Kürzlich hochgeladen (20)

Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data Story
 
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhhThiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhh
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptx
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 
detection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxdetection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptx
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 

R data mining-Time Series Analysis with R

  • 1. Time Series Analysis with R1 Yanchang Zhao http://www.RDataMining.com R and Data Mining Workshop @ AusDM 2014 27 November 2014 1 Presented at UJAT and Canberra R Users Group 1 / 39
  • 2. Outline Introduction Time Series Decomposition Time Series Forecasting Time Series Clustering Time Series Classification Online Resources 2 / 39
  • 3. Time Series Analysis with R 2 time series data in R time series decomposition, forecasting, clustering and classification autoregressive integrated moving average (ARIMA) model Dynamic Time Warping (DTW) Discrete Wavelet Transform (DWT) k-NN classification 2 Chapter 8: Time Series Analysis and Mining, in book R and Data Mining: Examples and Case Studies. http://www.rdatamining.com/docs/RDataMining.pdf 3 / 39
  • 4. R a free software environment for statistical computing and graphics runs on Windows, Linux and MacOS widely used in academia and research, as well as industrial applications 5,800+ packages (as of 13 Sept 2014) CRAN Task View: Time Series Analysis http://cran.r-project.org/web/views/TimeSeries.html 4 / 39
  • 5. Time Series Data in R class ts represents data which has been sampled at equispaced points in time frequency=7: a weekly series frequency=12: a monthly series frequency=4: a quarterly series 5 / 39
  • 6. Time Series Data in R a <- ts(1:20, frequency = 12, start = c(2011, 3)) print(a) ## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ## 2011 1 2 3 4 5 6 7 8 9 10 ## 2012 11 12 13 14 15 16 17 18 19 20 str(a) ## Time-Series [1:20] from 2011 to 2013: 1 2 3 4 5 6 7 8 9 10... attributes(a) ## $tsp ## [1] 2011 2013 12 ## ## $class ## [1] "ts" 6 / 39
  • 7. Outline Introduction Time Series Decomposition Time Series Forecasting Time Series Clustering Time Series Classification Online Resources 7 / 39
  • 8. What is Time Series Decomposition To decompose a time series into components: Trend component: long term trend Seasonal component: seasonal variation Cyclical component: repeated but non-periodic fluctuations Irregular component: the residuals 8 / 39
  • 9. Data AirPassengers Data AirPassengers: monthly totals of Box Jenkins international airline passengers, 1949 to 1960. It has 144(=12×12) values. plot(AirPassengers) Time AirPassengers 1950 1952 1954 1956 1958 1960 100200300400500600 9 / 39
  • 10. Decomposition apts <- ts(AirPassengers, frequency = 12) f <- decompose(apts) plot(f$figure, type = "b") # seasonal figures 2 4 6 8 10 12 −40−200204060 Index f$figure 10 / 39
  • 11. Decomposition plot(f) 100300500 observed 150250350450 trend −400204060 seasonal −400204060 2 4 6 8 10 12 random Time Decomposition of additive time series 11 / 39
  • 12. Outline Introduction Time Series Decomposition Time Series Forecasting Time Series Clustering Time Series Classification Online Resources 12 / 39
  • 13. Time Series Forecasting To forecast future events based on known past data For example, to predict the price of a stock based on its past performance Popular models Autoregressive moving average (ARMA) Autoregressive integrated moving average (ARIMA) 13 / 39
  • 14. Forecasting # build an ARIMA model fit <- arima(AirPassengers, order = c(1, 0, 0), list(order = c(2, 1, 0), period = 12)) fore <- predict(fit, n.ahead = 24) # error bounds at 95% confidence level U <- fore$pred + 2 * fore$se L <- fore$pred - 2 * fore$se ts.plot(AirPassengers, fore$pred, U, L, col = c(1, 2, 4, 4), lty = c(1, 1, 2, 2)) legend("topleft", col = c(1, 2, 4), lty = c(1, 1, 2), c("Actual", "Forecast", "Error Bounds (95% Confidence)")) 14 / 39
  • 15. Forecasting Time 1950 1952 1954 1956 1958 1960 1962 100200300400500600700 Actual Forecast Error Bounds (95% Confidence) 15 / 39
  • 16. Outline Introduction Time Series Decomposition Time Series Forecasting Time Series Clustering Time Series Classification Online Resources 16 / 39
  • 17. Time Series Clustering To partition time series data into groups based on similarity or distance, so that time series in the same cluster are similar Measure of distance/dissimilarity Euclidean distance Manhattan distance Maximum norm Hamming distance The angle between two vectors (inner product) Dynamic Time Warping (DTW) distance ... 17 / 39
  • 18. Dynamic Time Warping (DTW) DTW finds optimal alignment between two time series. library(dtw) idx <- seq(0, 2 * pi, len = 100) a <- sin(idx) + runif(100)/10 b <- cos(idx) align <- dtw(a, b, step = asymmetricP1, keep = T) dtwPlotTwoWay(align) Index Queryvalue 0 20 40 60 80 100 −1.0−0.50.00.51.0 18 / 39
  • 19. Synthetic Control Chart Time Series The dataset contains 600 examples of control charts synthetically generated by the process in Alcock and Manolopoulos (1999). Each control chart is a time series with 60 values. Six classes: 1-100 Normal 101-200 Cyclic 201-300 Increasing trend 301-400 Decreasing trend 401-500 Upward shift 501-600 Downward shift http://kdd.ics.uci.edu/databases/synthetic_control/synthetic_ control.html 19 / 39
  • 20. Synthetic Control Chart Time Series # read data into R sep='': the separator is white space, i.e., one # or more spaces, tabs, newlines or carriage returns sc <- read.table("./data/synthetic_control.data", header = F, sep = "") # show one sample from each class idx <- c(1, 101, 201, 301, 401, 501) sample1 <- t(sc[idx, ]) plot.ts(sample1, main = "") 20 / 39
  • 21. Six Classes 24262830323436 1 15202530354045 101 2530354045 0 10 20 30 40 50 60 201 Time 0102030 301 2530354045 401 101520253035 0 10 20 30 40 50 60 501 Time 21 / 39
  • 22. Hierarchical Clustering with Euclidean distance # sample n cases from every class n <- 10 s <- sample(1:100, n) idx <- c(s, 100 + s, 200 + s, 300 + s, 400 + s, 500 + s) sample2 <- sc[idx, ] observedLabels <- rep(1:6, each = n) # hierarchical clustering with Euclidean distance hc <- hclust(dist(sample2), method = "ave") plot(hc, labels = observedLabels, main = "") 22 / 39
  • 23. Hierarchical Clustering with Euclidean distance 6 4 6 6 6 6 6 6 6 6 6 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 5 5 5 5 5 5 3 3 3 3 5 5 5 5 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 20406080100120140 hclust (*, "average") dist(sample2) Height 23 / 39
  • 24. Hierarchical Clustering with Euclidean distance # cut tree to get 8 clusters memb <- cutree(hc, k = 8) table(observedLabels, memb) ## memb ## observedLabels 1 2 3 4 5 6 7 8 ## 1 10 0 0 0 0 0 0 0 ## 2 0 3 1 1 3 2 0 0 ## 3 0 0 0 0 0 0 10 0 ## 4 0 0 0 0 0 0 0 10 ## 5 0 0 0 0 0 0 10 0 ## 6 0 0 0 0 0 0 0 10 24 / 39
  • 25. Hierarchical Clustering with DTW Distance myDist <- dist(sample2, method = "DTW") hc <- hclust(myDist, method = "average") plot(hc, labels = observedLabels, main = "") # cut tree to get 8 clusters memb <- cutree(hc, k = 8) table(observedLabels, memb) ## memb ## observedLabels 1 2 3 4 5 6 7 8 ## 1 10 0 0 0 0 0 0 0 ## 2 0 4 3 2 1 0 0 0 ## 3 0 0 0 0 0 6 4 0 ## 4 0 0 0 0 0 0 0 10 ## 5 0 0 0 0 0 0 10 0 ## 6 0 0 0 0 0 0 0 10 25 / 39
  • 26. Hierarchical Clustering with DTW Distance 3 3 3 3 3 3 5 5 3 3 3 3 5 5 5 5 5 5 5 5 6 6 6 4 6 4 4 4 4 4 4 4 4 4 6 6 6 6 6 6 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 02004006008001000 hclust (*, "average") myDist Height 26 / 39
  • 27. Outline Introduction Time Series Decomposition Time Series Forecasting Time Series Clustering Time Series Classification Online Resources 27 / 39
  • 28. Time Series Classification Time Series Classification To build a classification model based on labelled time series and then use the model to predict the lable of unlabelled time series Feature Extraction Singular Value Decomposition (SVD) Discrete Fourier Transform (DFT) Discrete Wavelet Transform (DWT) Piecewise Aggregate Approximation (PAA) Perpetually Important Points (PIP) Piecewise Linear Representation Symbolic Representation 28 / 39
  • 29. Decision Tree (ctree) ctree from package party classId <- rep(as.character(1:6), each = 100) newSc <- data.frame(cbind(classId, sc)) library(party) ct <- ctree(classId ~ ., data = newSc, controls = ctree_control(minsplit = 20, minbucket = 5, maxdepth = 5)) 29 / 39
  • 30. Decision Tree pClassId <- predict(ct) table(classId, pClassId) ## pClassId ## classId 1 2 3 4 5 6 ## 1 100 0 0 0 0 0 ## 2 1 97 2 0 0 0 ## 3 0 0 99 0 1 0 ## 4 0 0 0 100 0 0 ## 5 4 0 8 0 88 0 ## 6 0 3 0 90 0 7 # accuracy (sum(classId == pClassId))/nrow(sc) ## [1] 0.8183 30 / 39
  • 31. DWT (Discrete Wavelet Transform) Wavelet transform provides a multi-resolution representation using wavelets. Haar Wavelet Transform – the simplest DWT http://dmr.ath.cx/gfx/haar/ DFT (Discrete Fourier Transform): another popular feature extraction technique 31 / 39
  • 32. DWT (Discrete Wavelet Transform) # extract DWT (with Haar filter) coefficients library(wavelets) wtData <- NULL for (i in 1:nrow(sc)) { a <- t(sc[i, ]) wt <- dwt(a, filter = "haar", boundary = "periodic") wtData <- rbind(wtData, unlist(c(wt@W, wt@V[[wt@level]]))) } wtData <- as.data.frame(wtData) wtSc <- data.frame(cbind(classId, wtData)) 32 / 39
  • 33. Decision Tree with DWT ct <- ctree(classId ~ ., data = wtSc, controls = ctree_control(minsplit=20, minbucket=5, maxdepth=5)) pClassId <- predict(ct) table(classId, pClassId) ## pClassId ## classId 1 2 3 4 5 6 ## 1 98 2 0 0 0 0 ## 2 1 99 0 0 0 0 ## 3 0 0 81 0 19 0 ## 4 0 0 0 74 0 26 ## 5 0 0 16 0 84 0 ## 6 0 0 0 3 0 97 (sum(classId==pClassId)) / nrow(wtSc) ## [1] 0.8883 33 / 39
  • 34. plot(ct, ip_args = list(pval = F), ep_args = list(digits = 0)) V57 1 ≤ 117 > 117 W43 2 ≤ −4 > −4 W5 3 ≤ −8 > −8 Node 4 (n = 68) 123456 0 0.2 0.4 0.6 0.8 1 Node 5 (n = 6) 123456 0 0.2 0.4 0.6 0.8 1 W31 6 ≤ −6 > −6 Node 7 (n = 9) 123456 0 0.2 0.4 0.6 0.8 1 Node 8 (n = 86) 123456 0 0.2 0.4 0.6 0.8 1 V57 9 ≤ 140 > 140 Node 10 (n = 31) 123456 0 0.2 0.4 0.6 0.8 1 V57 11 ≤ 178 > 178 W22 12 ≤ −6 > −6 Node 13 (n = 80) 123456 0 0.2 0.4 0.6 0.8 1 W31 14 ≤ −13 > −13 Node 15 (n = 9) 123456 0 0.2 0.4 0.6 0.8 1 Node 16 (n = 99) 123456 0 0.2 0.4 0.6 0.8 1 W31 17 ≤ −15 > −15 Node 18 (n = 12) 123456 0 0.2 0.4 0.6 0.8 1 W43 19 ≤ 3 > 3 Node 20 (n = 103) 123456 0 0.2 0.4 0.6 0.8 1 Node 21 (n = 97) 123456 0 0.2 0.4 0.6 0.8 1 34 / 39
  • 35. k-NN Classification find the k nearest neighbours of a new instance label it by majority voting needs an efficient indexing structure for large datasets k <- 20 newTS <- sc[501, ] + runif(100) * 15 distances <- dist(newTS, sc, method = "DTW") s <- sort(as.vector(distances), index.return = TRUE) # class IDs of k nearest neighbours table(classId[s$ix[1:k]]) ## ## 4 6 ## 3 17 35 / 39
  • 36. k-NN Classification find the k nearest neighbours of a new instance label it by majority voting needs an efficient indexing structure for large datasets k <- 20 newTS <- sc[501, ] + runif(100) * 15 distances <- dist(newTS, sc, method = "DTW") s <- sort(as.vector(distances), index.return = TRUE) # class IDs of k nearest neighbours table(classId[s$ix[1:k]]) ## ## 4 6 ## 3 17 Results of majority voting: class 6 35 / 39
  • 37. The TSclust Package TSclust: a package for time seriesclustering 3 measures of dissimilarity between time series to perform time series clustering. metrics based on raw data, on generating models and on the forecast behavior time series clustering algorithms and cluster evaluation metrics 3 http://cran.r-project.org/web/packages/TSclust/ 36 / 39
  • 38. Outline Introduction Time Series Decomposition Time Series Forecasting Time Series Clustering Time Series Classification Online Resources 37 / 39
  • 39. Online Resources Chapter 8: Time Series Analysis and Mining, in book R and Data Mining: Examples and Case Studies http://www.rdatamining.com/docs/RDataMining.pdf R Reference Card for Data Mining http://www.rdatamining.com/docs/R-refcard-data-mining.pdf Free online courses and documents http://www.rdatamining.com/resources/ RDataMining Group on LinkedIn (8,000+ members) http://group.rdatamining.com RDataMining on Twitter (1,800+ followers) @RDataMining 38 / 39