Задание 1 Разведочный анализ с featurePlot
library(caret)
set.seed(123)
x <- matrix(rnorm(50*5), ncol = 5)
y <- factor(rep(c("A", "B"), 25))
featurePlot(x, y, "box")
Задание 2 Важность признаков
library(FSelector)
data(iris, package = "datasets")
w <- information.gain(Species ~ ., iris)
w
## attr_importance
## Sepal.Length 0.4521286
## Sepal.Width 0.2672750
## Petal.Length 0.9402853
## Petal.Width 0.9554360
Задание 3 Дискретизация
library(arules)
sl <- iris$Sepal.Length
table(arules::discretize(sl, method = "interval", breaks = 3))
##
## [4.3,5.5) [5.5,6.7) [6.7,7.9]
## 52 70 28
table(arules::discretize(sl, method = "frequency", breaks = 3))
##
## [4.3,5.4) [5.4,6.3) [6.3,7.9]
## 46 53 51
table(arules::discretize(sl, method = "cluster", breaks = 3))
##
## [4.3,5.45) [5.45,6.46) [6.46,7.9]
## 52 63 35
table(arules::discretize(sl, method = "fixed", breaks = c(4, 5.5, 7, 8)))
##
## [4,5.5) [5.5,7) [7,8]
## 52 85 13
library(Boruta); library(mlbench)
data("Ozone"); oz <- na.omit(Ozone)
set.seed(123)
b <- Boruta(V4 ~ ., data = oz, doTrace = 0)
plot(b, cex.axis = 0.7, las = 2)