Skip to content

Error in function svm () #20

@Mao-young

Description

@Mao-young

I followed Rgtsvm-vignette.pdf and to test the function svm(), and sometimes they didn't work.

The following is not working correctly::: It also happens when I try the example ( model <- svm(Species ~ ., data = iris) )

model.gpu=svm(x[i.training,],y[i.training],type="C-classification")
Error in if (class(x) == "data.frame") x <- as.matrix(x) :
the condition has length > 1
此外: Warning message:
In !sparse && (class(x) %in% c("matrix", "data.frame")) :
'length(x) = 2 > 1' in coercion to 'logical(1)'

The following is working correctly:::

gt.svm=svm( dat[i.train,-c(1,2)],dat[i.train,1],gamma=as.numeric(0.0625),cost=as.numeric(10,sacle=F))
show(gt.svm)
Call:
svm.default(x = dat[i.train, -c(1, 2)], y = dat[i.train, 1], gamma = as.numeric(0.0625),
cost = as.numeric(10, sacle = F))
Parameters:
SVM-Type: C-classification
SVM-Kernel: radial
cost: 10
gamma: 0.0625
tolerance: 0.001
time elapsed: 48.922
Number of Support Vectors: 22093

This problem needs to be solved because I seem to get stuck in Rgtsvm when using dREG.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions