Caret Model random forest into PMML error

前端 未结 2 1770
予麋鹿
予麋鹿 2021-01-20 15:36

I would like to export a Caret random forest model using the pmml library so I can use it for predictions in Java. Here is a reproduction of the error I am getting.

2条回答
  •  抹茶落季
    2021-01-20 16:09

    You can use the r2pmml package to do the job:

    library("caret")
    library("r2pmml")
    
    data(iris)
    
    train.rf = train(Species ~ ., data = iris, method = "rf")
    print(train.rf)
    r2pmml(train.rf, "/tmp/train-rf.pmml")
    

提交回复
热议问题