Loading amex_submission.rds +127 KiB (153 KiB) File changed.No diff preview for this file type. View original file View changed file amex_validation.rds −380 KiB (5.03 MiB) File changed.No diff preview for this file type. View original file View changed file data_prep.R +7 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,8 @@ datraw <- readRDS("01_data_raw/dat_fa.rds") %>% #select all the variables with no NAs and the cat vars select( names(colSums(is.na(.))[colSums(is.na(.))==0]), catvars catvars, -customer_ID )%>% tidyr::drop_na() %>% select(sort(names(.))) %>% mutate(ID=1:nrow(.)) %>% Loading @@ -33,14 +34,19 @@ train <- datraw_small[1:20000,] train mean(train$target) saveRDS(train, "amex_train.rds") write.csv(train, "amex_train.csv") # validation set (comes without info on target) validation <- datraw_small[20001:30000,] %>% select(-target) #mean(validation$target) validation saveRDS(validation,"amex_validation.rds") write.csv(validation, "amex_validation.csv") # submission (submit the PD for the clients) submission <- validation %>% select(ID) %>% mutate(PD = NA) saveRDS(submission,"amex_submission.rds") write.csv(submission, "amex_submission.rds") naive_example.R 0 → 100644 +24 −0 Original line number Diff line number Diff line rm(list=ls()) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) library(tidyverse) # Local path to save the file url_train <- "https://aidaho-edu.uni-hohenheim.de/gitlab/mariuspuke/sl2024_classificationcompetition/-/raw/main/amex_train.csv?ref_type=heads" train <- read.csv(url_validation) library(httr) response <- GET(url_submission) response$url readRDS(rawConnection(content(response, "raw", encoding = "ISO-8859-1"))) readRDS(rawConnection(content(response, "raw"))) readRDS(rawConnection(content(submission, "raw"))) # Local path to save the file destination <- "amex_submission_dl.rds" # Download the file download.file(url, destination, mode = "wb") No newline at end of file Loading
amex_submission.rds +127 KiB (153 KiB) File changed.No diff preview for this file type. View original file View changed file
amex_validation.rds −380 KiB (5.03 MiB) File changed.No diff preview for this file type. View original file View changed file
data_prep.R +7 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,8 @@ datraw <- readRDS("01_data_raw/dat_fa.rds") %>% #select all the variables with no NAs and the cat vars select( names(colSums(is.na(.))[colSums(is.na(.))==0]), catvars catvars, -customer_ID )%>% tidyr::drop_na() %>% select(sort(names(.))) %>% mutate(ID=1:nrow(.)) %>% Loading @@ -33,14 +34,19 @@ train <- datraw_small[1:20000,] train mean(train$target) saveRDS(train, "amex_train.rds") write.csv(train, "amex_train.csv") # validation set (comes without info on target) validation <- datraw_small[20001:30000,] %>% select(-target) #mean(validation$target) validation saveRDS(validation,"amex_validation.rds") write.csv(validation, "amex_validation.csv") # submission (submit the PD for the clients) submission <- validation %>% select(ID) %>% mutate(PD = NA) saveRDS(submission,"amex_submission.rds") write.csv(submission, "amex_submission.rds")
naive_example.R 0 → 100644 +24 −0 Original line number Diff line number Diff line rm(list=ls()) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) library(tidyverse) # Local path to save the file url_train <- "https://aidaho-edu.uni-hohenheim.de/gitlab/mariuspuke/sl2024_classificationcompetition/-/raw/main/amex_train.csv?ref_type=heads" train <- read.csv(url_validation) library(httr) response <- GET(url_submission) response$url readRDS(rawConnection(content(response, "raw", encoding = "ISO-8859-1"))) readRDS(rawConnection(content(response, "raw"))) readRDS(rawConnection(content(submission, "raw"))) # Local path to save the file destination <- "amex_submission_dl.rds" # Download the file download.file(url, destination, mode = "wb") No newline at end of file