library(caret) models <- names(getModelInfo()) head(models, 20) length(models)
set.seed(123) x <- matrix(rnorm(50*5), ncol = 5) y <- factor(rep(c(“A”, “B”), 25))
plot_types <- c(“box”, “strip”, “density”, “pairs”, “ellipse”) for (p in plot_types) { jpeg(filename = paste0(“feature_plot_”, p, “.jpg”), width = 800, height = 600) print(featurePlot(x = x, y = y, plot = p, main = paste(“Тип:”, p))) dev.off() } featurePlot(x, y, plot = “box”, main = “Box plot по классам”)
library(FSelectorRcpp) weights <- information_gain(Species ~ ., data = iris) print(weights) weights[order(-weights$importance), , drop = FALSE]
library(arules) data(iris) x_len <- iris$Sepal.Length x_interval <- discretize(x_len, method = “interval”, breaks = 3, labels = c(“Low”, “Mid”, “High”)) x_freq <- discretize(x_len, method = “frequency”, breaks = 3) x_cluster <- discretize(x_len, method = “cluster”, breaks = 3) x_fixed <- discretize(x_len, method = “fixed”, breaks = c(4, 5.5, 7, 8), labels = c(“Small”, “Medium”, “Large”))
table(x_interval) table(x_freq) table(x_cluster) table(x_fixed)
library(Boruta) library(mlbench) data(“Ozone”) ozone_clean <- na.omit(Ozone) set.seed(123) boruta_output <- Boruta(V4 ~ ., data = ozone_clean, doTrace = 0, maxRuns = 100) print(boruta_output) plot(boruta_output, cex.axis = 0.7, las = 2, xlab = ““, main =”Важность признаков (Boruta)“) dev.off()