PMML evaluator library for R.
This package provides R wrapper classes and functions for the JPMML-Evaluator library.
- Java Platform, Standard Edition 8 or newer.
- R 3.3, 4.0 or newer.
This package has not been released to CRAN yet.
Installing the latest snapshot version from GitHub using the devtools
package:
library("devtools")
install_github("jpmml/jpmml-evaluator-r")
Building a verified model evaluator from a PMML file:
library("jpmml")
library("magrittr") # Defines the `%>%` operator
evaluator = newLoadingModelEvaluatorBuilder() %>%
loadFile("DecisionTreeIris.pmml") %>%
build()
evaluator = evaluator %>%
verify()
Evaluating a single data record:
arguments = list(
"Sepal.Length" = 5.1,
"Sepal.Width" = 3.5,
"Petal.Length" = 1.4,
"Petal.Width" = 0.2
)
results = evaluator %>%
evaluate(arguments)
print(results)
Evaluating a collection of data records:
data(iris)
argumentsDf = iris
resultsDf = evaluator %>%
evaluateAll(argumentsDf)
print(resultsDf)
Removing the package:
remove.packages("jpmml")
JPMML-Evaluator-R is licensed under the terms and conditions of the GNU Affero General Public License, Version 3.0.
JPMML-Evaluator-R is developed and maintained by Openscoring Ltd, Estonia.
Interested in using Java PMML API software in your company? Please contact [email protected]