热线电话:13121318867

登录
2019-01-26 阅读量: 697
R中如何实现SVM?(2)

特征缩放

# Feature Scaling

training_set[-3] = scale(training_set[-3])

test_set[-3] = scale(test_set[-3])

输出:

  • 特征缩放训练数据集

特征缩放测试数据集

# Fitting SVM to the Training set

install.packages('e1071')

library(e1071)

classifier = svm(formula = Purchased ~ .,

data = training_set,

type = 'C-classification',

kernel = 'linear')

0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子