This file contains hidden or 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
| #Setup | |
| rm(list = ls(all = TRUE)) #CLEAR WORKSPACE | |
| #Directory | |
| setwd("~/Overfitting") | |
| #Load Required Packages | |
| library('caTools') | |
| library('caret') | |
| library('glmnet') |
This file contains hidden or 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
| ## | |
| ## Vignette code for ggsubplot with needed map_afghanistan and map_americas layers | |
| ## [email protected] | |
| ## Dec 16, 2012 | |
| # install.packages("ggsubplot") | |
| library(ggplot2) | |
| library(ggsubplot) | |
| library(maps) |
This file contains hidden or 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
| ## | |
| ## Sample code to demonstrate circular time plots in R | |
| ## [email protected] | |
| ## Dec 22, 2012 | |
| # inspired by | |
| # http://stackoverflow.com/questions/2076370/most-underused-data-visualization | |
| library(lubridate) | |
| library(circular) |
This file contains hidden or 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
| ## | |
| ## Example code for time-to-event analysis in R | |
| ## [email protected] | |
| ## Dec 28, 2012 | |
| ## | |
| ## joineR package: analyzing longitudinal data where the response | |
| ## from each person is a time-sequence of repeated measurements | |
| ## and we are interested in a possibly censored time-to-event outcome | |
| ## | |
| ## example: repeated ad viewings leading to a sale |
This file contains hidden or 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
| # | |
| # Functions to make ggplot KM survivor curves made with survfit() in library(survival) | |
| # | |
| # code written by Ramon Saccilotto | |
| # and included in his ggplot2 tutorial | |
| # 2010-12-08 | |
| # define custom function to create a survival data.frame | |
| createSurvivalFrame <- function(f.survfit){ | |
| # initialise frame variable |
This file contains hidden or 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
| # | |
| # PREDICTING LONG TERM CUSTOMER VALUE WITH BTYD PACKAGE | |
| # Pareto/NBD (negative binomial distribution) modeling of | |
| # repeat-buying behavior in a noncontractual setting | |
| # | |
| # Matthew Baggott, [email protected] | |
| # | |
| # Accompanying slides at: | |
| # http://www.slideshare.net/mattbagg/baggott-predict-customerinrpart1# | |
| # |
This file contains hidden or 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
| *.pyc |
This file contains hidden or 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(ggplot2) | |
| library(ggmap) | |
| # blue bottle coffee shops in SF area | |
| latitude <- c(37.782375,37.795933,37.776327,37.762033,37.795966,37.785936) | |
| longitude <- c(-122.407567,-122.273128,-122.42328,-122.411603,-122.394025,-122.400761) | |
| df2 <- data.frame(longitude=longitude,latitude=latitude) | |
| # df to make map title on the water | |
| dflabels <- data.frame(longitude=-122.678, |
OlderNewer