This repository has been archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ntbk_eda_hard.Rmd
141 lines (124 loc) · 3.81 KB
/
ntbk_eda_hard.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
title: "GRAPHS-2015 Hard Instances EDA"
nocite: |
@kotthoff_portfolios_2016
output:
html_document:
df_print: paged
toc: yes
html_notebook:
theme: united
toc: yes
bibliography: GRAPHS-2015/citation.bib
---
## Description
EDA on hard instances of [GRAPHS-2015](https://github.com/coseal/aslib_data/tree/master/GRAPHS-2015) dataset
```{r results='hide', message=FALSE, warning=FALSE}
library(ggplot2)
library(tidyr)
library(dplyr)
library(purrr)
library(magrittr)
library(aslib)
library (llama)
```
```{r load_dataset}
# Load dataset from file and convert to LLAMA object
dataset_raw <- parseASScenario("GRAPHS-2015")
dataset_structured <- convertToLlamaCVFolds(dataset_raw)
#Presolver 1: Filter instances solved by IncompleteLAD
dataset_notPresolved <- dataset_structured
presolved_ids <- dataset_raw$feature.runstatus$instance_id[dataset_raw$feature.runstatus$lad_features == "presolved"]
dataset_notPresolved$data <- subset(dataset_structured$data, !(dataset_structured$data$instance_id %in% presolved_ids))
dataset_notPresolved$best <- subset(dataset_structured$best, !(dataset_structured$data$instance_id %in% presolved_ids))
# Presolver 2: Filter instances solved by VF2 within 50 ms
dataset_hard <- dataset_notPresolved
dataset_hard$data <- subset(dataset_notPresolved$data, dataset_notPresolved$data$vf2 > 50)
dataset_hard$best <- subset(dataset_notPresolved$best, dataset_notPresolved$data$vf2 > 50)
dataset_hard <- cvFolds(dataset_hard)
cat("Count of all instances =", nrow(dataset_structured$data), ", Count of hard instances =", nrow(dataset_hard$data)) # should be 5725 and 2336
```
## Samples data
```{r sample_feature_data}
head(dataset_hard$data[,c("instance_id",dataset_hard$features)],10)
```
```{r sample_algo_data}
head(dataset_hard$data[,c("instance_id",dataset_hard$performance)],10)
```
## Histograms
### Features
```{r message=FALSE}
dataset_hard$data %>%
subset(select = c(2:17)) %>%
keep(is.numeric) %>%
gather() %>%
group_by(key) %>%
mutate(med = median(value)) %>%
ggplot(aes(value)) +
geom_histogram() +
facet_wrap(~ key, scales = "free", ncol = 4) +
geom_vline(aes(xintercept= med, group = key),
color = "red", linetype = "dashed",
size = 1)
```
```{r message=FALSE}
dataset_hard$data %>%
subset(select = c(18:31)) %>%
keep(is.numeric) %>%
gather() %>%
group_by(key) %>%
mutate(med = median(value)) %>%
ggplot(aes(value)) +
geom_histogram() +
facet_wrap(~ key, scales = "free", ncol = 3) +
geom_vline(aes(xintercept= med, group = key),
color = "red", linetype = "dashed",
size = 1)
```
```{r message=FALSE}
dataset_hard$data %>%
subset(select = c(33:37)) %>%
keep(is.numeric) %>%
gather() %>%
group_by(key) %>%
mutate(med = median(value)) %>%
ggplot(aes(value)) +
geom_histogram() +
facet_wrap(~ key, scales = "free", ncol = 3) +
geom_vline(aes(xintercept= med, group = key),
color = "red", linetype = "dashed",
size = 1)
```
### Algorithm runtimes
```{r message=FALSE}
dataset_hard$data %>%
subset(select = dataset_hard$performance) %>%
keep(is.numeric) %>%
gather() %>%
group_by(key) %>%
mutate(med = median(value)) %>%
ggplot(aes(value)) +
geom_histogram() +
facet_wrap(~ key, scales = "free", ncol = 2) +
geom_vline(aes(xintercept= med, group = key),
color = "red", linetype = "dashed",
size = 1)
```
### Algorithm runtimes, log-scaled
```{r message=FALSE}
dataset_hard$data %>%
subset(select = dataset_hard$performance) %>%
add(1) %>% log10() %>%
keep(is.numeric) %>%
gather() %>%
group_by(key) %>%
mutate(med = median(value)) %>%
ggplot(aes(value)) +
geom_histogram() +
facet_wrap(~ key, scales = "free", ncol = 2) +
geom_vline(aes(xintercept= med, group = key),
color = "red", linetype = "dashed",
size = 1)
```
## References
[Source Rmd file](https://github.com/kvrigor/algosel-rl/blob/master/ntbk_eda_hard.Rmd)