Skip to content

Instantly share code, notes, and snippets.

evalparse xiaodaigh

Block or report user

Report or block xiaodaigh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hd_binning
High Definition Binning {#HD_binning}
=====================
The process of binning (or discretization) of variables is a well-established practice in building credit scorecards. The binning process involves taking raw values e.g. income and cutting that data into bins (discrete ranges) such as 2000-3000, 3000-4000. Typically we would see an upward trend in terms of Good/Bad Odds as the income levels go up.
In this blog post I would like to explain a novel approach to binning that can produce very fine binning.
Automatic Binary Binning Algorithm (ABBA)
---------
View gist:2a01b284377cb189369a
Top 5 Underdog Stories
1. Zhou Jun Xun wins LG cup
No one from outside Japan, South Korea, China has ever won an international title until Zhou Jun Xun from Taiwan. He was the first 9 dan from Taiwan and he has an unmistakable large red birth mark on his face. On his way to LG cup victory he defeated Lee Chang Ho and Lee Sedol. His most famous win was against Lee Sedol where he played a new move in the avanlanche
2. Ear-reddening
Shuwa was the up start who nobody expected could challenge the pre-Meijin
3. Go Seigen vs Shuko
When Go Seigen won the competition to ear the right to challenge Shuko. No one expected Go to win or perhaps come close to winning. Shuko played white and since there is no komi at the time, the only adavantage he had was that he could adjourn the game at any time. Go lost the game by 2 points.
@xiaodaigh
xiaodaigh / runthis.R
Last active Dec 22, 2015
A Shiny component for Handsontable
View runthis.R
shiny::runGitHub("shinyhandsontable-example","xiaodaigh")
@xiaodaigh
xiaodaigh / genGraphVizCode.r
Last active Dec 22, 2015
Generating GraphViz code for visualizing Shiny reactive dependencies
View genGraphVizCode.r
d <- parse("server stripped bare.R")
dc <- as.character(d)
reactives <- NULL
# find reactive sources
for(t in dc) {
if( grepl("reactive(.*)$",t)) { #if it is reactive
g <- gregexpr("^[A-Za-z0-9._]*",t)
p <- as.numeric(g[[1]])
l <- attr(g[[1]],"match.length")
View dataset.txt
item1,item2,item3,item4,item5,item6,item7,item8,item9,item10
1,1,,,1,1,,,,
,,1,1,,,1,1,,
1,,,,1,,,,1,1
,1,,1,1,,1,,1,
1,1,1,1,1,1,,,,1
,1,,,,,1,,,
,,1,1,1,1,,1,,
1,,,1,,,,1,,1
,,1,1,1,,,,1,1
@xiaodaigh
xiaodaigh / server.R
Created Sep 20, 2013
Beginner help on input and plotting
View server.R
library(shiny)
#tu<-read.csv(file="tu.csv", header = TRUE, sep = ",")
#attach(tu)
tu <- data.frame(id=rnorm(1000),size=rnorm(1000),months=rnorm(1000))
shinyServer(function(input, output) {
it<- reactive({
print(input$tu)
switch(input$tu,
"id" = tu$id,
View color.js
$(document).delegate("#mytable",'DOMSubtreeModified','DOMNodeInserted', function(event) {
color()
});
function color(){
$('#mytable td').each(function(){
$(this).css({'background':'#CCC'});
})
}
@xiaodaigh
xiaodaigh / server.R
Created Sep 22, 2013
A simple Shiny spy to tell Shiny that the session has closed
View server.R
library(shiny)
data(pressure)
data(cars)
shinyServer(function(input, output, session) {
# Partial example
observe({
@xiaodaigh
xiaodaigh / README.md
Last active Dec 23, 2015
Shiny: Multiple selections created using one htmlOutput
View README.md

To run

shiny::runGist("6684134")

View corr.ilic.r
#
#
cor.ilic <- function(x,y) {
# tryCatch(t <- table(x,y,exclude=NULL,useNA="ifany")
# , error = function(e) {
#
# }
# )
bt <- table.p(data.frame(x=x,y=y),32)
You can’t perform that action at this time.