View trueskill_ex2.r
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
# This second example runs Trueskill on a tennis tournament, the Australian Open. | |
# Note that actual computation is commented out as it takes about ~40 seconds to | |
# update skill ratings over 127 matches. | |
library(trueskill) | |
# Data format of ausopen2012 is: Player, Opponent, Margin, Round, WRank, LRank | |
data("ausopen2012") | |
# create match_id in order to reshape |
View 2021-06-25-minutes-nets-playoffs.Rmd
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
--- | |
title: Minutes played by Nets, playoffs | |
layout: post | |
categories: | |
- posts | |
tags: | |
- nba, sports | |
output: | |
#html_document | |
md_document: |
View 2021-06-19-nba-21-bbr.Rmd
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
--- | |
title: "Basketball Reference" | |
layout: post | |
categories: | |
- notebook | |
tags: | |
- nba, sports | |
output: | |
html_document | |
# md_document: |
View 2021-06-17-nba-bbr.Rmd
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
--- | |
title: "'21 Brooklyn Nets performance in games missed by stars" | |
layout: post | |
categories: | |
- notebook | |
tags: | |
- nba, sports | |
output: | |
html_document | |
# md_document: |
View json_parser.hs
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
-- https://www.slideshare.net/redongjun/simple-json-parser | |
-- https://www.youtube.com/watch?v=r_Enynu_TV0 | |
import Text.ParserCombinators.Parsec | |
import Control.Monad | |
matchTrue :: Parser String | |
matchTrue = string "true" |
View k-fold CV.r
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
# original example from Digg Data website (Takashi J. OZAKI, Ph. D.) | |
# http://diggdata.in/post/58333540883/k-fold-cross-validation-in-r | |
library(plyr) | |
library(randomForest) | |
data <- iris | |
# in this cross validation example, we use the iris data set to |
View time lapse.R
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
setwd("C:/Documents and Settings/bhoung/My Documents/time/") | |
require("ggplot2") | |
require("maptools") | |
gpclibPermit() | |
# read in spatial data - from the ABS (Australian Burea of Statistics) website | |
shp <- readShapeSpatial( fn = "C:/Documents and Settings/bhoung/My Documents/asgc/SLA11aAust", verbose = TRUE, delete_null_obj=TRUE) | |
summary(shp) | |
list_names = names(shp) |
View ggmap example.r
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
require(ggmap) | |
require(foreign) | |
melb <- read.dta("/Users/brendanhoung/example/melb.dta") | |
melbourne <- qmap(location='melbourne, Australia', zoom = 10) + theme_set(theme_bw()) | |
melbourne_stamen <- qmap(location='melbourne, Australia', zoom = 10, source="stamen", maptype="watercolor") | |
melbourne_toner <- qmap(location='melbourne, Australia', zoom = 10, source="stamen", maptype="toner") | |
melbourne_osm <- qmap(location='melbourne, Australia', zoom = 10, source="osm") |
View analyzeSGP example.r
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
SGPstateData[["NAPLAN"]][["Growth"]][["System_Type"]] <- "Cohort Referenced" | |
SGPstateData[["NAPLAN"]][["Student_Report_Information"]][["Grades_Reported"]][["NUMERACY"]] <- c(3, 5, 7) | |
SGPstateData[["NAPLAN"]][["Assessment_Program_Information"]][["Grades_Tested"]] <- c(3, 5, 7) | |
SGPstateData$NAPLAN$Growth$Levels <- c("Very Low", "Low", "Typical", "High", "Very High") | |
SGPstateData[["NAPLAN"]][["Growth"]][["Cutscores"]] <- | |
list(Cuts=c(20, 40, 60, 80), | |
Labels=list("1st - 19th", "20th - 39th", "40th - 59th", "60th-79th", "80th-99th")) | |
#NUM YR3 2008 | |
s1 <- read.dta("C:/Protected/MI/Naplan/sgp/long/YR3_2008.dta") |