Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View seanjtaylor's full-sized avatar

Sean J. Taylor seanjtaylor

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@seanjtaylor
seanjtaylor / check.log
Created January 24, 2017 21:17
configure.win only
* using log directory 'd:/RCompile/CRANguest/R-release/prophet.Rcheck'
* using R version 3.3.2 (2016-10-31)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'prophet/DESCRIPTION' ... OK
* this is package 'prophet' version '0.1'
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Sean Taylor <sjt@fb.com>'
New submission
@seanjtaylor
seanjtaylor / check.log
Last active January 24, 2017 19:56
Biarch: true
* using log directory 'd:/RCompile/CRANguest/R-release/prophet.Rcheck'
* using R version 3.3.2 (2016-10-31)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'prophet/DESCRIPTION' ... OK
* this is package 'prophet' version '0.1'
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Sean Taylor <sjt@fb.com>'
New submission
@seanjtaylor
seanjtaylor / check.log
Created January 24, 2017 19:41
No Biarch, No configure.win
* using log directory 'd:/RCompile/CRANguest/R-release/prophet.Rcheck'
* using R version 3.3.2 (2016-10-31)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'prophet/DESCRIPTION' ... OK
* this is package 'prophet' version '0.1'
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Sean Taylor <sjt@fb.com>'
New submission
@seanjtaylor
seanjtaylor / check.log
Created January 24, 2017 18:46
Biarch: true + configure.win
* using log directory 'd:/RCompile/CRANguest/R-release/prophet.Rcheck'
* using R version 3.3.2 (2016-10-31)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'prophet/DESCRIPTION' ... OK
* this is package 'prophet' version '0.1'
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Sean Taylor <sjt@fb.com>'
New submission
@seanjtaylor
seanjtaylor / install.libs.R
Created January 24, 2017 18:38
My install.libs.R
packageStartupMessage('Compiling models (this will take a minute...)')
dest <- file.path(R_PACKAGE_DIR, paste0('libs', R_ARCH))
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
logistic.growth.src <- file.path(R_PACKAGE_SOURCE, 'inst', 'stan', 'prophet_logistic_growth.stan')
logistic.growth.binary <- file.path(dest, 'prophet_logistic_growth.RData')
logistic.growth.stanc <- rstan::stanc(logistic.growth.src)
logistic.growth.stanm <- rstan::stan_model(stanc_ret = logistic.growth.stanc,
model_name = 'logistic_growth')
@seanjtaylor
seanjtaylor / wikipedia.R
Created January 12, 2017 23:08
Download a list of page views for Wikipedia back to 2008.
library(dplyr)
library(RJSONIO)
get_page_visits <- function(page) {
past <- expand.grid(year = 2008:2015, month = 1:12) %>%
mutate(url = paste('http://stats.grok.se/json/en', as.character(year * 100 + month), page, sep = '/')) %>%
group_by(url) %>%
do({
a <- RJSONIO::fromJSON(.$url)$daily_views
data_frame(ds = names(a), views = a)
@seanjtaylor
seanjtaylor / setuptools.md
Created January 11, 2017 18:51
Problem with setuptools

In my setup.py build command, I create a pickle file that I'd like to be available at runtime. I do this by subclassing from the setuptools.command.build_py.build_py and overriding the run command:

class my_command(build_py):
    def run(self):
        target_dir = os.path.join(self.build_lib, 'my_package/data')
        self.mkpath(target_dir)
        with open(os.path.join(target_dir, 'my_file.pkl'), 'wb') as f:
 pickle.dump({'foo': 'bar'}, f)
@seanjtaylor
seanjtaylor / btl.R
Last active November 15, 2016 18:16
Simple ridge regression team ranking
library(dplyr)
library(tidyr)
## 2015 season only
g2015 <- game %>%
select(seas, wk, ptsh, ptsv, h, v) %>%
filter(seas == 2015) %>%
arrange(gid)
## Makes a 32-column matrix with indicators for home team