Last active
August 29, 2015 14:19
-
-
Save dec100/44351d5cd16efa862a55 to your computer and use it in GitHub Desktop.
score.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RevoScriptTools) | |
revoPackage('party') | |
# load the model | |
if (!exists('iris.cf')) load('model.RData') | |
# provide some values for an observation to be scored: | |
revoInput('{"name": "Sepal.Length","render": "numeric","default": 150.1}') | |
revoInput('{"name": "Sepal.Width","render": "numeric","default": 5.9}') | |
revoInput('{"name": "Petal.Length","render": "numeric","default": 3.1}') | |
revoInput('{"name": "Petal.Width","render": "numeric","default": 1.8}') | |
# create a data.frame | |
obs<-data.frame(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) | |
# score the observation and report the predicted value | |
Prediction <- predict(iris.cf, obs, OOB=TRUE, type = "response") | |
Prediction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment