R中的脱字符号训练中的SVM重复名称错误

时间:2018-06-21 08:41:55

标签: r svm r-caret

在为SVM运行我的代码时,出现错误。

  

terms.formula(formula,data = data)中的错误:     在数据框中使用“。”重复名称“文档”。

svm_Linear <- train(Category.Level.2 ~ ., data = train.tokens.df, method = "svmLinear", trControl = cv.cntrl, tuneLength = 7)

dput(head(train.tokens.df))

structure(list(Category.Level.2 = structure(c(12L, 52L, 5L, 30L,
25L, 47L), .Label = c("Accessories", "Alcoholic Drinks", "Art and Craft Supplies ",
"Baby Bath, Skin and Grooming", "Bags and Belts", "Bath and Body",
"Camera and Accessories"), class = "factor"), document = c("text1",
"text2", "text3", "text4", "text5", "text6"), gamt = c(1, 0,
0, 0, 0, 0), pokemon = c(1, 0, 0, 0, 0, 0), plush = c(1, 0, 0,
0, 0, 0)), .Names = c("Category.Level.2", "document", "gamt",
"pokemon", "plush"), row.names = c(NA, 6L ), class = "data.frame")

0 个答案:

没有答案