当前位置:网站首页>Visualization of wine datasets in R language

Visualization of wine datasets in R language

2022-06-22 20:53:00 Mrrunsen

The wine The data set contains the results of chemical analysis of wines grown in specific regions of Italy .178 Three samples represent three types of wine , Each sample is recorded 13 The results of this chemical analysis .

Whether there are missing values in the dataset

data(wine, package="rattle") 
library(VIM )
aggr(wine, prop=FALSE, numbers=TRUE)


There are no missing values in the dataset

Which of the variables in the dataset are relevant ?

library(ggcorrplot)
wine[,-1] %>%
  cor() %>%
  round(2) %>%
  ggcorrplot(hc.order = TRUE,lab = TRUE)

Hue, Proanthocyanins , Dilution Phenols Flavanoids These variables are highly correlated

Decision tree classification model visualization , What features will be used

library(rpart)
dtree <- rpart(Type ~ ., data=wine, method="class", 
 parms=list(split="information"))
library(rpart.plot)
rpart.plot( dtree)

原网站

版权声明
本文为[Mrrunsen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221917182392.html