Biểu đồ thể hiện khả năng dự đoán điẻm

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(ggpubr)
## Warning: package 'ggpubr' was built under R version 4.0.5
all_dat = read.csv("SO LIEU DU DOAN_4.csv")
all_dat$Method_Setting = paste(all_dat$Method, all_dat$Setting)
names(all_dat)
##  [1] "SST"            "Output"         "Features"       "Setting"       
##  [5] "Tr..ng.h.p"     "INPUT"          "Method"         "MSE"           
##  [9] "RMSE"           "MAE"            "R2"             "Method_Setting"
feature_level = c( "TOP-5", "TOP-8", "TOP-10", "ALL")

# Chon du lieu cho kq cua HK7
mydat = all_dat[all_dat$Output=="TBHK7",]
mydat$Features = factor(mydat$Features, levels=feature_level)


r2p <- mydat%>% ggplot(aes(x=Features,  group = Method_Setting))+
  geom_line(aes(y=R2, color = Method, linetype = Setting)) +
  geom_point(aes(y=R2, color = Method, shape = Setting), size =1.8)+
  scale_y_continuous(name= "R2",breaks=seq(0,1,0.1))+
  xlab("Feature selection")+
  theme_bw()

rmsep <- mydat%>% ggplot(aes(x=Features,  group = Method_Setting))+
  geom_line(aes(y=RMSE, color = Method, linetype = Setting)) +
  geom_point(aes(y=RMSE, color = Method, shape = Setting), size =1.8)+
  scale_y_continuous(name= "RMSE",breaks=seq(0,1,0.1))+
  xlab("Feature selection")+
  theme_bw()

msep <- mydat%>% ggplot(aes(x=Features,  group = Method_Setting))+
  geom_line(aes(y=MSE, color = Method, linetype = Setting)) +
  geom_point(aes(y=MSE, color = Method, shape = Setting), size =1.8)+
  scale_y_continuous(name= "MSE",breaks=seq(0,1,0.1))+
  xlab("Feature selection")+
  theme_bw()

maep <- mydat%>% ggplot(aes(x=Features,  group = Method_Setting))+
  geom_line(aes(y=MAE, color = Method, linetype = Setting)) +
  geom_point(aes(y=MAE, color = Method, shape = Setting), size =1.8)+
  scale_y_continuous(name= "MAE",breaks=seq(0,1,0.1))+
  xlab("Feature selection")+
  theme_bw()

ggarrange(r2p, maep, rmsep, msep, ncol=2, nrow=2,common.legend=TRUE)