Skip to content

Instantly share code, notes, and snippets.

@zachmayer
Created August 10, 2011 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachmayer/1137637 to your computer and use it in GitHub Desktop.
Save zachmayer/1137637 to your computer and use it in GitHub Desktop.
R googlepredictionapi
install.packages("googlepredictionapi_0.1.tar.gz", repos=NULL, type="source")
## Load googlepredictionapi and dependent libraries
library(rjson)
library(RCurl)
library(googlepredictionapi)
#Save dataframe to a file, upload to google storage, and train a model
write.csv(iris,'iris.csv')
model <- PredictionApiTrain(data='iris.csv', remote.file="gs://rdata/iris")
#Summarize model and predict for new data
summary(model)
predict(model, iris[10,])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment