make_boxplot.R 3.37 KB
Newer Older
Masaki Ban's avatar
Masaki Ban committed
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
library(tidyverse)

#パス成功率
# CSVファイルの読み込み
df_epv <- read_csv("~/Desktop/logs/epv2base30half/pass_prob.csv") |>
  select(pass_success_rate) |>
  rename(epv = pass_success_rate)

df_base <- read_csv("~/Desktop/logs/base2base30half/pass_prob.csv") |>
  select(pass_success_rate) |>
  rename(base = pass_success_rate)

# データフレームの結合
df <- bind_cols(df_epv, df_base)

long_data <- df %>%
  gather(key = "Category", value = "Value", epv, base)

p <- long_data %>%
    ggplot(aes(x = Category, y = Value)) +
    geom_boxplot() +
    scale_x_discrete(labels = c("HELIOS Base", "EPVエージェント")) + 
    scale_y_continuous(limits = c(0.65, 1)) + 
    stat_summary(fun = mean, geom = "point", shape = 20, size = 3, color = "red") +
    xlab("エージェント") +
    ylab("パス成功率")

ggsave("prob.pdf", p, device = cairo_pdf, width = 3, height = 3)


# ボール保持率
# CSVファイルの読み込み
df_epv <- read_csv("~/Desktop/logs/epv2base30half/EPV.csv") |>
  select(our_possession) |>
  rename(epv = our_possession)

df_base <- read_csv("~/Desktop/logs/base2base30half/HELIOS_base.csv") |>
  select(our_possession) |>
  rename(base = our_possession)

# データフレームの結合
df <- bind_cols(df_epv, df_base) 

long_data <- df %>%
  gather(key = "Category", value = "Value", epv, base)

p <- long_data %>%
    ggplot(aes(x = Category, y = Value)) +
    geom_boxplot() +
    scale_x_discrete(labels = c("HELIOS Base", "EPVエージェント")) + 
    scale_y_continuous(limits = c(0.3, 0.9)) + 
    stat_summary(fun = mean, geom = "point", shape = 20, size = 3, color = "red") +
    xlab("エージェント") +
    ylab("ボール保持率")

ggsave("possession.pdf", p, device = cairo_pdf, width = 3, height = 3)

# 得点
# CSVファイルの読み込み
df_epv <- read_csv("~/Desktop/logs/epv2base30half/EPV.csv") |>
  select(our_point) |>
  rename(epv = our_point)

df_base <- read_csv("~/Desktop/logs/base2base30half/HELIOS_base.csv") |>
  select(our_point) |>
  rename(base = our_point)

# データフレームの結合
df <- bind_cols(df_epv, df_base)

long_data <- df %>%
  gather(key = "Category", value = "Value", epv, base)

p <- long_data %>%
    ggplot(aes(x = Category, y = Value)) +
    geom_boxplot() +
    scale_x_discrete(labels = c("HELIOS Base", "EPVエージェント")) + 
    scale_y_continuous(limits = c(0, 4.5)) + 
    stat_summary(fun = mean, geom = "point", shape = 20, size = 3, color = "red") +
    xlab("エージェント") +
    ylab("得点")

ggsave("point.pdf", p, device = cairo_pdf, width = 3, height = 3)


# 失点
# CSVファイルの読み込み
df_epv <- read_csv("~/Desktop/logs/epv2base30half/EPV.csv") |>
  select(opp_point) |>
  rename(epv = opp_point)

df_base <- read_csv("~/Desktop/logs/base2base30half/HELIOS_base.csv") |>
  select(opp_point) |>
  rename(base = opp_point)

# データフレームの結合
df <- bind_cols(df_epv, df_base)

long_data <- df %>%
  gather(key = "Category", value = "Value", epv, base)

p <- long_data %>%
    ggplot(aes(x = Category, y = Value)) +
    geom_boxplot() +
    scale_x_discrete(labels = c("HELIOS Base", "EPVエージェント")) + 
    scale_y_continuous(limits = c(0, 4.5)) + 
    stat_summary(fun = mean, geom = "point", shape = 20, size = 3, color = "red") +
    xlab("エージェント") +
    ylab("失点")

ggsave("opp_point.pdf", p, device = cairo_pdf, width = 3, height = 3)