Created
April 24, 2019 16:48
-
-
Save wheresalice/0c90d357f8b7c0168f47ed0bd60f935f to your computer and use it in GitHub Desktop.
Take a MySQL export of Jira ticket count per day, use Facebook's Prophet library to predict the next year, and then graph that.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(prophet) | |
# mysql -e "select distinct(CAST(CREATED AS DATE)) C, COUNT(*) from jira.jiraissue WHERE project=1 AND reporter='alice' group by C;" -N -B > jira.txt | |
jira <- read.delim('jira.txt', header=FALSE) | |
dates <- as.POSIXct(strptime(jira$V1, "%Y-%m-%d")) | |
jira_with_dates <-data.frame(dates, jira['V2']) | |
names(jira_with_dates) = c("ds", "y") | |
m <- prophet(daily.seasonality = TRUE) | |
m <- add_country_holidays(m, country_name = "UK") | |
m <- fit.prophet(m, jira_with_dates) | |
future = make_future_dataframe(m, periods = 365) | |
forecast = predict(m, future) | |
plot(m, forecast) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment