67
правок
Изменения
→SVM
=== Кластеризация ===
=== SVM ===
<pre>
#$$ importing package and its' dependencies
library(caret)
#reading data
data <- read.csv("input.csv", sep = ',', header = FALSE)
#splitting data into train and test sets
index <- createDataPartition(y = data$target, p=0.8, list = FALSE)
training <- data[index,]
testing <- data[-index,]
#defining training function
ctrl <- trainControl(method = "repeatedcv", number = 10, repeats = 3)
#evaluating model
fit <- train(target ~ x + y + z,
data = train_flats,
method = "svmRadial",
trControl = ctrl)
#printing parameters
print(fit)
</pre>