When plotting 3 model metrics (RMSE, MAE, Rsquared) from 3 trained models to a test set metrics, i'm trying to show that Neural Network model is the best as
- there is least distance between train and test metrics
- it also has low enough RSME/MAE and high Rsquared
Now it is not that obvious from the attached plot. Also, metrics are on the different scale as Rsquared is in [0,1] interval. Is there a way to plot it better, preferably on the same plot?
> trn
model RMSE Rsquared MAE dataType
1 Linear Reg 9.17 0.51 6.03 train
2 SVM Radial 7.86 0.64 4.86 train
3 Neural Networks 8.55 0.57 5.59 train
> tst
model RMSE Rsquared MAE dataType
1 Linear Reg 9.40 0.53 5.95 test
2 SVM Radial 9.16 0.55 5.50 test
3 Neural Networks 8.66 0.60 5.48 test
>
reproducible code:
trn <- structure(list(model = c("Linear Reg", "SVM Radial", "Neural Networks"),
RMSE = c(9.17, 7.86, 8.55), Rsquared = c(0.51, 0.64, 0.57),
MAE = c(6.03, 4.86, 5.59)),
row.names = c(NA, -3L), class = "data.frame")
tst <- structure(list(model = c("Linear Reg", "SVM Radial", "Neural Networks"),
RMSE = c(9.4, 9.16, 8.66), Rsquared = c(0.53, 0.55, 0.6),
MAE = c(5.95, 5.5, 5.48)),
row.names = c(NA, -3L), class = "data.frame")
trn['dataType'] = 'train'
tst['dataType'] = 'test'
long_tbl <- rbind(trn, tst) %>%
pivot_longer(cols =!c('model', 'dataType'), names_to = 'metric', values_to='value')
ggplot(long_tbl, aes(x=model, y=value, shape = dataType, colour = metric )) +
geom_point()