Skip to content

Commit

Permalink
old website
Browse files Browse the repository at this point in the history
old website
  • Loading branch information
mbrachman committed Aug 23, 2023
0 parents commit eca3379
Show file tree
Hide file tree
Showing 89 changed files with 32,341 additions and 0 deletions.
87 changes: 87 additions & 0 deletions IV first enabled dashboard.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: "IV Dashboard Impact on Self-Enablement"
output:
flexdashboard::flex_dashboard:

orientation: columns
social: menu
source_code: embed
---

```{r, include=FALSE, echo=FALSE, message=FALSE, warning=FALSE}
#Income verification experimentation revenue impact estimate
library(tidyverse)
library(prophet)
library(lubridate)
library(dygraphs)
library(xts)
library(quantmod)
library(flexdashboard)
ns = as_tibble(read.csv("IV - Day First Enabled by Customer by Day.csv")) #read in data - should be updated to read directly from Cupola query
ns$Day = as.Date(ns$IV_ENABLED_DAY)
ns = ns %>% arrange(Day) %>% mutate(CUM_SELF_ENABLED = cumsum(SELF_ENABLED))
##prophet model
z = ns %>% select(Day,CUM_SELF_ENABLED) %>% rename(ds = 1, y = 2)
z = z %>% filter(ds < "2022-03-07") #day IV awareness dash go live
#account for seasonal trends
z$sat = ifelse(weekdays(as.Date(z$ds)) == 'Saturday',1,0)
z$sun = ifelse(weekdays(as.Date(z$ds)) == 'Sunday',1,0)
z$m1 = ifelse(day(z$ds) == 1,1,0) #add binary dummy variable for first of the month
z$m2 = ifelse(day(z$ds) == 2,1,0) #add binary dummy variable for second of the month
z$m31 = ifelse(day(z$ds) == 31,1,0) #add binary dummy variable for 31st of the month
z$m30 = ifelse(day(z$ds) == 30,1,0) #add binary dummy variable for 30th of the month
m <- prophet(daily.seasonality = 50, changepoint.prior.scale = 0.5, seasonality.prior.scale = 0.1)
m <- add_regressor(m,'m1')
m <- add_regressor(m,'m2')
m <- add_regressor(m,'m31')
m <- add_regressor(m,'m30')
m <- add_regressor(m,'sat')
m <- add_regressor(m,'sun')
m = add_country_holidays(m, 'US')
m <- add_seasonality(m, name='monthly', period=30.5, fourier.order=5)
m <- fit.prophet(m, z)
future <- make_future_dataframe(m, periods = 60)
future$sat = ifelse(weekdays(as.Date(future$ds)) == 'Saturday',1,0)
future$sun = ifelse(weekdays(as.Date(future$ds)) == 'Sunday',1,0)
future$m1 = ifelse(day(future$ds) == 1,1,0) #add binary dummy variable for first of the month
future$m2 = ifelse(day(future$ds) == 2,1,0) #add binary dummy variable for second of the month
future$m31 = ifelse(day(future$ds) == 31,1,0) #add binary dummy variable for 31st of the month
future$m30 = ifelse(day(future$ds) == 30,1,0) #add binary dummy variable for 30th of the month
forecast <- predict(m, future)
prophet_plot_components(m, forecast) ##use these to create plots
dyplot.prophet(m, forecast)
d = ns %>% filter(Day == max(Day)) %>% select(Day) #select max day in actuals
round(ns$CUM_SELF_ENABLED[which(ns$Day == '2022-04-28')] - forecast$yhat[409],0) #why is it so hard to do date logic on the forecast object...argh 5 more self-enabled than expected on 2022-04-28
round(ns$CUM_SELF_ENABLED[which(ns$Day == '2022-04-28')] - forecast$yhat_upper[409],0) #71 fewer
round(ns$CUM_SELF_ENABLED[which(ns$Day == '2022-04-28')] - forecast$yhat_lower[409],0) #87 more
#create xts object for plotting
z1 = ns %>% select(Day,CUM_SELF_ENABLED) %>% rename(ds = 1, y = 2)
z3 = forecast %>% select(ds, yhat, yhat_lower, yhat_upper)
z2 = left_join(z1,z3)
z4 = xts(x = z2, order.by = z2$ds)
```
```{r}
dygraph(z4) %>% dySeries(c("yhat_lower", "yhat", "yhat_upper"), label = "forecast") %>% dySeries("y", label = "actual") %>% dyOptions(colors = RColorBrewer::brewer.pal(3, "Set1")) %>% dyLegend(show = "onmouseover") %>% dyRangeSelector() %>% dyEvent("2022-03-07", "IV Dashboard Banner Go-Live", labelLoc = "bottom")
```



301 changes: 301 additions & 0 deletions IV-Data-Analysis.html

Large diffs are not rendered by default.

2,774 changes: 2,774 additions & 0 deletions IV-dashboard-experiment-impact.html

Large diffs are not rendered by default.

2,775 changes: 2,775 additions & 0 deletions IV-first-enabled-dashboard.html

Large diffs are not rendered by default.

2,778 changes: 2,778 additions & 0 deletions IV-landing-page-experiment-impact.html

Large diffs are not rendered by default.

258 changes: 258 additions & 0 deletions IV.html

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions MicahB-APPF.github.io.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
30 changes: 30 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Phantom by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)


This is Phantom, a simple design built around a grid of large, colorful, semi-interactive
image tiles (of which you can have as many or as few as you like). Makes use of some
SVG and animation techniques I've been experimenting with on that other project of mine
you may have heard about (https://carrd.co), and includes a handy generic page for whatever.

Demo images* courtesy of Unsplash, a radtastic collection of CC0 (public domain) images
you can use for pretty much whatever.

(* = not included)

AJ
[email protected] | @ajlkn


Credits:

Demo Images:
Unsplash (unsplash.com)

Icons:
Font Awesome (fontawesome.io)

Other:
jQuery (jquery.com)
Responsive Tools (github.com/ajlkn/responsive-tools)
334 changes: 334 additions & 0 deletions RI-Daily-Policies-Prophet-Model.html

Large diffs are not rendered by default.

270 changes: 270 additions & 0 deletions Rmd_readthedown.html

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions assets/css/fontawesome-all.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit eca3379

Please sign in to comment.