Instructions for the Prediction V1.5 Command-Line Sample

Browse Online

Register Your Application

You will also need to Activate Google Storage, upload the training data required by the sample to Google Storage. And then edit OBJECT_PATH in PredictionSample.java to point to the training data. Otherwise, you will get a 400 error "Training data file not found".

Checkout Instructions

Prerequisites: install Java 6, Mercurial, and Maven. You may need to set your JAVA_HOME .

cd [someDirectory]
hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples
cd google-api-java-client-samples/prediction-cmdline-sample
cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json
[editor] src/main/java/com/google/api/services/samples/prediction/cmdline/PredictionSample.java
mvn compile
mvn -q exec:java
  

To enable logging of HTTP requests and responses (highly recommended when developing), please take a look at logging.properties.

Setup Project in Eclipse

Prerequisites: install Eclipse, the Mercurial plugin, and the Maven plugin.