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 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.
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 intro.r
# reading and writing files
# press ctrl+enter to send
iris
fix(iris)
write.csv(iris,"c:/temp/iris.csv")
iris2 = read.csv("c:/temp/iris.csv")
nrow(iris2)
# get help
@xiaodaigh
xiaodaigh / server.r
Created Dec 16, 2013
Shiny callback mechanism
View server.r
#install.packages(c("devtools","svSockets")) # if not already installed
#devtools::install_github("gosocket","analytixware") # if not already installed
#devtools::install_github("shinysky","analytixware") # if not already installed
library(shiny)
library(shinysky)
library(gosocket)
# Define server logic required to generate and plot a random distribution
shinyServer(function(input, output,session) {
View A simple visual variable clustering algorithm
data <- read.csv("c:/bb2.csv")
cor.data <- cor(data[sapply(data,typeof)=="double"],method="spearman")
dist <- function(y,x) {
if(is.null(dim(x))) {
sqrt((x[1] - y[1])^2 + (x[2] - y[2])^2)
} else {
sqrt((x[,1] - y[1])^2 + (x[,2] - y[2])^2)
}
@xiaodaigh
xiaodaigh / server.r
Created Oct 25, 2013
R Shiny Password Input
View server.r
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Meh --- ")
print(input$myTextInput )
print(input$passInput )
})
@xiaodaigh
xiaodaigh / server.r
Last active Feb 2, 2016
R Shiny: An textInput that only gets invalidated upon losing focus or when enter is pressed shiny::runGist("7150112")
View server.r
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Press enter or focusout to update --- ")
print(input$myTextInput )
@xiaodaigh
xiaodaigh / README.md
Last active Feb 1, 2017
== actionButton styling == The Twitter Bootstrap allows for many class styles for buttons. http://getbootstrap.com/2.3.2/base-css.html#buttons Added support for these styles to the actionButton.
View README.md
@xiaodaigh
xiaodaigh / server.r
Created Oct 12, 2013
Shiny R - Re-initialise reactive values
View server.r
library(shiny)
shinyServer(function(input,output){
reval <- reactiveValues(a= 1,b=2,dummy= rnorm(1))
observe({
if(input$hello == 0) return()
random.number <- rnorm(1)
reval$dummy <- random.number
b <- reval$b
@xiaodaigh
xiaodaigh / server.R
Last active Apr 12, 2016
Shiny: Disable Button
View server.R
library(shiny)
disableActionButton <- function(id,session) {
session$sendCustomMessage(type="jsCode",
list(code= paste("$('#",id,"').prop('disabled',true)"
,sep="")))
}
shinyServer(function(input, output,session) {
You can’t perform that action at this time.