Time-Series Analysis in Minutes
Founder & CEO
Shanti Subramanyam
Orzota, Inc.
1
Agenda
§ Time-series	Introduction
› The	What	and	Why:	Use	Cases
› Why	Analyze
§ Exploratory	Analytics
› Fast	Visualization
› Insights
› Predictive	Analytics
› Forecasting
› Advanced	Prediction	
2
Time	Series	Definition
• Series	of	data	points	listed	in	time	order
• Commonly	taken	at	successive,	equally	spaced	points	in	time
Type of	Data Use	Case
Financial	Data Analyze	stock	performance
Census	Data
Analyze	population	types	and	
growth
Sales Data
Analyze	sales by	region,	
product,	etc.
Industrial	Data Analyze	machine	performance
Sample	Uses	Cases
Introduction
• Time series analytics in a variety of applications
• Classification
• Prediction
• Anomaly detection
• Pattern discovery
• And more…
5
Pattern 1 Pattern 2
Introduction Hybrid Neural Network(HNN) TreNet for Local Trend
ntroduction
Time series analytics in a variety of applications
• Classification
• Prediction
• Anomaly detection
• Pattern discovery
• And more…
5
Pattern 1 Pattern 2
ntroduction Hybrid Neural Network(HNN) TreNet for Local Trend
roduction
me series analytics in a variety of applications
Classification
Prediction
Anomaly detection
Pattern discovery
And more…
5
Pattern 1 Pattern 2
duction Hybrid Neural Network(HNN) TreNet for Local Trend
oduction
me series analytics in a variety of applications
Classification
Prediction
Anomaly detection
Pattern discovery
And more…
5
Pattern 1 Pattern 2
uction Hybrid Neural Network(HNN) TreNet for Local Trend
Time	Series	Applications
Classification
Prediction
Anomaly	Detection Pattern	Discovery
Time	Series	Components
• Trend	Component
• Seasonal	Component
• Cyclic	Component
• Irregular	Fluctuations
Time	Series	Components
• Trend	– gradual	upward	or	downward	shift
• Seasonality	– repeating	pattern	at	fixed	intervals	of	time	within	a	year
Cyclic	Component
Time	Series	that	exhibits	rises	and	falls	or	some	other	pattern	that	are	
NOT	of	a	fixed	period	is	said	to	have	a	cyclic pattern.	
Typically	this	is	exhibited	over	multiple	years.
Example:
Agri Commodities	exhibit	cyclical	
component.	
Area	under	cultivation	increases	
when	there	is	a	price	increase	in	
the	market	due	to	high	demand	
and	contracts	when	the	price
starts	falling	with	a	lag
Time	Series	Components
Exploratory	Analysis
Code	and	data	samples	available	at:	
https://github.com/Orzota/tutorials/tree/master/Time-Series
Exploratory	Analysis
• Basic	analysis	using	R
Load	data	from	csv	files
dat <-
read.csv(“/path/to/file.csv”)
• Create	time-series	
timeseries <- ts(dat,
start=c(1987,1), frequency=12)
plot.ts(timeseries)
TSstudio package
• Much	better	visualization	and	processing	for	TS	data
install.packages("TSstudio")
install.packages("xts")
library(TSstudio)
library(xts)
ts_plot(timeseries)
Seasonality	Plot
ts_seasonal (timeseries, type=“normal”)
Seasonality	Plot
ts_seasonal (timeseries, type=“cycle”)
Seasonality	Plot
ts_seasonal (timeseries, type=“box”)
Heatmaps
ts_heatmap (timeseries)
3D	Surface	Plots
ts_surface (timeseries)
Multiple	Time	Series
Data	Management
• Storing	large	amounts	of	historical	time	series	data	requires	a	scalable	
platform
• TimeScale DB
• InfluxDB
• OpenTSDB (built	on	HBase)
• Riak TS
• Things	to	look	for:
• Data	Ingestion	Rate
• Query	Speed	and	Capability
• Scalability
• Reliability
Aggregated	Analytics
20
Aggregated	Analytics
Aggregated	Analytics
Aggregated	Analytics
One	model	type	has	high	
“Pending	Sector	Count”
Predictive	Analytics
Code	and	data	samples	available	at:	
https://github.com/Orzota/tutorials/tree/master/Time-Series
Predictions
§ Forecast	Time-Series	Trend
› Sales	Forecasts	have	been	done	for	decades
› Sensor	Data	Forecasts	can	help	fix	issues	before	it	is	too	late
› Anomaly	Detection
› Network	Security	use	cases:	DDOS	attacks,	failed	logins
› Predictive	Maintenance
› Usually	requires	more	than	just	Time	Series	prediction
25
Exponential	Smoothing
§ Single	Exponential	Smoothing
§ Use	when	there	is	no	clear	
trend	or	seasonal	pattern
§ Works	for	slow	trend	changes	
as	well
26
Exponential	Smoothing
§ Double	Exponential	Smoothing	(Holt’s	Method)
§ Use	when	there	is	a	clear	trend
27
Triple	Exponential	Smoothing
§ Also	known	as	Holt-
Winters	Method	
§ Exponential	Smoothing	
applied	to	seasonality,	
level	and	trend
28
Forecasting	in	R
ARIMA	Model
• Great	for	short-term	forecasting;	can	handle	seasonality,	trends,	
errors,	cycles,	etc.		
• Cannot	handle	anomalies
Forecasting	Time	Series
Time	Series	in	Spark
Spark-TS
• Analyze	large	amounts	of	TS	data
• In	Scala,	Java	OR	Python
• Functionality	similar	to	R	
• Exploratory	Analysis	
• Save	the	data	in	Hive	and	use	standard	tools	like	Tableau
• Modeling	and	Predictions
• Exponential,	ARIMA,	other	Auto-regressive	models	as	well
Predictions	Using	Neural	Networks
§ Recurrent	Neural	Networks
§ Memorize	previous	info	and	apply	it	to	current	output
§ Complexity	reduction	ècurrent	state	relates	only	to	few	previous	states
§ LSTM	– Long	Short	Term	Memory
§ Widely	Used	Variant	of	RNNs
§ Model	learns	based	on	the	outputs
§ Uses	memory	units	to	learn	
§ when	to	“forget”		or	“update”	info
§ Ref:	http://file.scirp.org/pdf/JDAIP_2017082815492555.pdf
32
LSTM	GNB	for	Anomaly	Detection
§ LSTM	Gaussian	Naïve	Bayes	
Model
§ Enhances	LSTM	using	
Gaussian	Naïve	Bayes	Model
§ Uses	predicted	error	from	the	
LSTM	network	to	construct	
Gauss-NBayes
§ Detects	anomalies		from	the	
errors	and	learns	from	it
33
Conclusion
• Time	Series	Data	is	Every	Where
• Exploratory	Analysis	can	provide	lots	of	useful	insights
• Trend,	Seasonality,	Cyclic	Components	
• Single	Series	Analysis
• Multiple	Related	Series	
• Aggregation	of	Similar	Series	
• Predictive	Analytics
• Forecasting
• Anomaly	Detection
• Predictive	Maintenance
Additional	Info

Time-series Analysis in Minutes