SVM for text classification in R

前端 未结 1 929
攒了一身酷
攒了一身酷 2021-01-01 07:13

I am using SVM to classify my text where in i don\'t actually get the result instead get with numerical probabilities.

Dataframe (1:20 trained set, 21:50 tes

相关标签:
1条回答
  • 2021-01-01 07:54

    What I usually do is

    ou <- cbind(ou$text, results)
    

    And to have the labels printed:

    ou$value <- "NONE"
    ou$value[results$SVM_LABEL=="1"]  <- "Access"
    ou$value[results$SVM_LABEL=="-1"] <- "Report/Data"
    ou 
    

    (assuming you used 1 and -1 when training the model)

    I know it's a little bit primitive but it's clear and works fine

    0 讨论(0)
提交回复
热议问题