Publications by Priyank Goyal
Hierarchical Clustering
# Load the data data("USArrests") # Standardize the data df <- scale(USArrests) # Show the first 6 rows head(df, nrow = 6) ## Murder Assault UrbanPop Rape ## Alabama 1.24256408 0.7828393 -0.5209066 -0.003416473 ## Alaska 0.50786248 1.1068225 -1.2117642 2.484202941 ## Arizona 0.07163341 1.4788032 0.99...
908 sym R (3442 sym/28 pcs) 3 img
PAM_KMedoid
Data data("USArrests") # Load the data set df <- scale(USArrests) # Scale the data head(df, n = 3) # View the firt 3 rows of the data ## Murder Assault UrbanPop Rape ## Alabama 1.24256408 0.7828393 -0.5209066 -0.003416473 ## Alaska 0.50786248 1.1068225 -1.2117642 2.484202941 ## Arizona 0.07163341 1.4788032 0.998980...
304 sym R (3822 sym/19 pcs) 2 img
Clustering-KMeans
K Means Clustering data("USArrests") # Loading the data set df <- scale(USArrests) # Scaling the data # View the firt 3 rows of the data head(df, n = 3) ## Murder Assault UrbanPop Rape ## Alabama 1.24256408 0.7828393 -0.5209066 -0.003416473 ## Alaska 0.50786248 1.1068225 -1.2117642 2.484202941 ## Arizona 0.07163341...
502 sym R (6215 sym/22 pcs) 2 img
Clustering Distance Measures
Introduction Remember: For Cluster Analysis 1. Rows are observations and columns are variables. 2. Any Missing value must be imputed/removed 3. Data must be standardised. lets Load the dataset “US Arrests” data("USArrests") df <- USArrests Remove any missing value that may be present in the data df <- na.omit(df) Scale of Data df <- scal...
775 sym R (2459 sym/24 pcs) 1 img
Omellette Demand Time Series
Loading Library load("workspace.RData") ## Registered S3 methods overwritten by 'ggplot2': ## method from ## [.quosures rlang ## c.quosures rlang ## print.quosures rlang ## Registered S3 method overwritten by 'xts': ## method from ## as.zoo.xts zoo ## Registered S3 method overwritten by 'quantmod': ## met...
1073 sym R (3346 sym/29 pcs) 4 img
ETS Model
This is an example of ETS, see the blog for Theory. International Tourist Visitor nights to Australia library(fpp2) ## Warning: package 'fpp2' was built under R version 3.6.1 ## Loading required package: ggplot2 ## Registered S3 methods overwritten by 'ggplot2': ## method from ## [.quosures rlang ## c.quosures rlang ## ...
246 sym R (1821 sym/18 pcs) 3 img
Time Series Idly Demand
Develop Various Forecast Models for Idly, Continental Breakfast and Omelette. Identify the best forecasting model using MAPE. Loading fpp2 package library(fpp2) ## Warning: package 'fpp2' was built under R version 3.6.1 ## Loading required package: ggplot2 ## Registered S3 methods overwritten by 'ggplot2': ## method from ## [.quosu...
2196 sym R (20623 sym/98 pcs) 17 img
Croston_Method
library(fpp2) ## Warning: package 'fpp2' was built under R version 3.6.1 ## Loading required package: ggplot2 ## Registered S3 methods overwritten by 'ggplot2': ## method from ## [.quosures rlang ## c.quosures rlang ## print.quosures rlang ## Loading required package: forecast ## Warning: package 'forecast' was built ...
1168 sym R (1161 sym/16 pcs) 1 img
Exponential Smoothing
Simple Exponential Smoothing Suitable for forecasting data with no clear trend or seasonal pattern. library(fpp2) load("workspace.RData") oildata <- window(oil, start=1996) autoplot(oildata) + ylab("Oil (millions of tonnes)") + xlab("Year") SES is applied as oildata <- window(oil, start=1996) # Estimate parameters fc <- ses(oildata, h=5) ...
1171 sym R (2402 sym/14 pcs) 6 img
Decomposition of Time Series
load("workspace.RData") library(fpp2) Three components: Trend Cycle, seasonal, random Why: 1. to understand the series 2. to Improve the accuracy of forecasting Moving Average To Understand trend-cycle eg. if we have a data autoplot(elecsales) + xlab("Year") + ylab("GWh") + ggtitle("Annual electricity sales: South Australia") We can compute ...
1316 sym R (2997 sym/13 pcs) 6 img