Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for kernlab::ksvm models #1

Open
vruusmann opened this issue Mar 19, 2015 · 1 comment
Open

Support for kernlab::ksvm models #1

vruusmann opened this issue Mar 19, 2015 · 1 comment

Comments

@vruusmann
Copy link
Member

The standard pmml package can convert ksvm objects that have been trained using the kernlab::ksvm function. Unfortunately, the converter implementation is rather limited, because it fails to handle ksvm objects that have been trained using alternative means.

For example, it is impossible to convert a ksvm object that was trained using the caret package:

library("caret")
library("kernlab")
library("pmml")

iris.ksvm = ksvm(Species ~ ., data = iris)
class(iris.ksvm)

ksvm.pmml = pmml(iris.ksvm, dataset = iris)

iris_x = iris[, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")]
iris_y = iris[, c("Species")]

iris.train = train(x = iris_x, y = iris_y, data = iris, method = "svmRadial")
class(iris.train$finalModel)

# Error in if (field$class[[1]][1] == "numeric") { :
#   argument is of length zero
train.pmml = pmml(iris.train$finalModel, dataset = iris)
@vruusmann
Copy link
Member Author

Moved to jpmml/jpmml-converter/issues/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant