Skip to content

Instantly share code, notes, and snippets.

View kkraoj's full-sized avatar

Krishna Rao kkraoj

View GitHub Profile
order_id fulfillment_time_seconds
0 2.9509841658615305e-08
1 0.019505169765189057
2 7.303478954872057e-16
3 1.9101714003472088e-24
4 0.0003794473081403896
5 1.865537747211439e-33
6 0.2553208994364204
7 1.5598051802319622e-14
8 4.6173232860197476e-10
@kkraoj
kkraoj / order_value.csv
Last active June 3, 2024 04:50
p99_example_order_value
order_id order_value_usd
0 0.7395043833099897
1 1.0355865556717134
2 0.6764152559872895
3 0.3446415677127145
4 1.1726401061050669
5 1.3904307829698468
6 0.4426054505368791
7 0.6919847590849365
8 1.2532877991500495
```{r first separate data into folds before choosing features}
# train the model on training set
# Leave out fold
accuracy.rates <- c()
for (itr in seq_len(folds)){
# Note: since input features are already random, no need to shuffle the data
# before creating folds. But ideally, examples need to be shuffled before
# creating folds to get rid of recording/data collecting bias
@kkraoj
kkraoj / cv_wrong.rmd
Last active July 11, 2019 07:28
Wrong and right way to do CV
```{r setup, include=FALSE}
rm(list=ls())
knitr::opts_chunk$set(echo = TRUE)
library(caret)
library(ggplot2)
```
# Cross validation Example: The wrong way and the right way