Skip to content

Instantly share code, notes, and snippets.

@flxw
Created January 23, 2018 20:10
Show Gist options
  • Save flxw/4301acf00145da268d078b5f64927a8f to your computer and use it in GitHub Desktop.
Save flxw/4301acf00145da268d078b5f64927a8f to your computer and use it in GitHub Desktop.
source('load_data.R')
d = read_and_preprocess_data_file('data/BADS_WS1718_known.csv')
n = nrow(d)
ratio = sum(d$return) / n
set.seed(1)
accuracy = 100000
randomized_returns = sample(accuracy, n, replace=TRUE)/accuracy
randomized_returns = ifelse(randomized_returns > ratio, 1, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment