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
##install.packages("cranlogs") | |
library(data.table) | |
library(cranlogs) | |
##caret/models/file | |
## grep "library =" * | sed 's/.*=//' | sed 's/c(//' | sed 's/),/,/' | grep -v NULL | sed 's/,.*$/,/' | sort | uniq | tr -d '\n' | |
caret_pkgs <- c("rpart", "C50", "CHAID", "Cubist", "FCNN4R", "HDclassif", "HiDimDA", "KRLS", "LiblineaR", |
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
library(data.table) | |
library(rpart) | |
d_train <- fread("https://s3.amazonaws.com/benchm-ml--main/train-0.1m.csv") | |
md <- rpart(ifelse(dep_delayed_15min=="Y",1,0) ~ ., d_train, | |
control = rpart.control(cp = 0.001)) | |
plotcp(md) | |
printcp(md) |
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
library(data.table) | |
library(ROCR) | |
library(lightgbm) | |
set.seed(123) | |
d_train <- fread("/var/data/bm-ml/train-0.1m.csv") | |
d_test <- fread("/var/data/bm-ml/test.csv") | |
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
## partial credit :) to @earino for the idea | |
library(lightgbm) | |
library(data.table) | |
library(ROCR) | |
d0_train <- fread("/var/data/bm-ml/train-10m.csv") | |
d0_test <- fread("/var/data/bm-ml/test.csv") | |
d0 <- rbind(d0_train, d0_test) |
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
# OpenML Benchmarking Suites and the OpenML100 | |
# https://arxiv.org/abs/1708.03731 | |
# https://www.openml.org/s/14/data | |
library(OpenML) | |
ids <- getOMLStudy('OpenML100')$data$data.id | |
dsall <- listOMLDataSets() | |
sum(dsall$data.id %in% ids) ## 96??? | |
ds <- dsall[dsall$data.id %in% ids,] |
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://github.com/EpistasisLab/penn-ml-benchmarks | |
## pip install pmlb | |
import numpy as np | |
from pmlb import fetch_data | |
from pmlb import dataset_names | |
x = np.zeros(len(dataset_names)) | |
for i, dn in enumerate(dataset_names): |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define N 128 | |
#define B0 100 | |
#define R 1000000 | |
#define M 1000 | |
int cmpfunc (const void * a, const void * b) | |
{ |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define N 100 | |
#define B0 100 | |
#define R 1000000 | |
int main() { | |
int b[N], rec[N]; | |
for (int i=0; i<N; i++) b[i] = B0; |
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
## training a model | |
library(h2o) | |
h2o.init(nthreads = -1) | |
dx_train <- h2o.importFile("https://s3.amazonaws.com/benchm-ml--main/train-0.1m.csv") | |
md_rf <- h2o.randomForest(x = 1:(ncol(dx_train)-1), y = ncol(dx_train), training_frame = dx_train, | |
model_id = "h2o_RF", | |
ntrees = 100, max_depth = 10, nbins = 100) |
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
library(caret) | |
library(readr) | |
library(ROCR) | |
set.seed(123) | |
d <- read_csv("https://raw.githubusercontent.com/szilard/teach-data-science-UCLA-master-appl-stats/master/wk-06-ML/data/airline100K.csv") |
NewerOlder