R client library for the Openscoring REST web service.
Install from GitHub using the devtools package:
library("devtools")
install_git("git://github.com/openscoring/openscoring-r.git")Creating an Openscoring S4 object:
library("openscoring")
os = new("Openscoring", base_url = "http://localhost:8080/openscoring")Deploying a PMML document DecisionTreeIris.pmml as an Iris model:
deployFile(os, "Iris", "DecisionTreeIris.pmml")Evaluating the Iris model with a data record:
arguments = list(
Sepal_Length = 5.1,
Sepal_Width = 3.5,
Petal_Length = 1.4,
Petal_Width = 0.2
)
result = evaluate(os, "Iris", arguments)
print(result)The same, but wrapping the data record into an EvaluationRequest S4 object for request identification purposes:
evaluationRequest = new("EvaluationRequest", id = "record-001", arguments = arguments)
evaluationResponse = evaluate(os, "Iris", evaluationRequest)
print(evaluationResponse@result)Evaluating the Iris model with data records from the Iris.csv CSV file, storing the results to the Iris-results CSV file:
evaluateCsvFile(os, "Iris", "Iris.csv", "Iris-results.csv")Undeploying the Iris model:
undeploy(os, "Iris")Uninstall:
remove.packages("openscoring")Openscoring-R is dual-licensed under the GNU Affero General Public License (AGPL) version 3.0, and a commercial license.
Openscoring-R is developed and maintained by Openscoring Ltd, Estonia.
Interested in using Openscoring software in your application? Please contact [email protected]