1 - You must first create the bucket you want to use. This can be done
with the gsutil function or via the web UI (Storage Access) in the Google
APIs Console. i.e.
-`$ gsutil mb gs://BUCKET`
+
+ $ gsutil mb gs://BUCKET
OR
2 - We now load the data you want to use to Google Storage. We have supplied a
basic language identification dataset in the sample for testing.
-`$ chmod 744 setup.sh`
-`$ ./setup.sh BUCKET/OBJECT`
+ $ chmod 744 setup.sh
+ $ ./setup.sh BUCKET/OBJECT
Note you need gsutil in your path for this to work.
If you have your own dataset, you can do this manually as well.
-`$ gsutil cp your_dataset.csv gs://BUCKET/your_dataset.csv`
+
+ $ gsutil cp your_dataset.csv gs://BUCKET/your_dataset.csv
In the script, you must then modify the datafile string. This must correspond with the
First, run the google-api script to generate access and refresh tokens. Ex.
-`$ cd google-api-ruby-client`
-`$ ruby bin/google-api oauth-2-login --scope=https://www.googleapis.com/auth/prediction --client-id=NUMBER.apps.googleusercontent.com --client-secret=CLIENT_SECRET`
+ $ cd google-api-ruby-client
+ $ ruby bin/google-api oauth-2-login --scope=https://www.googleapis.com/auth/prediction --client-id=NUMBER.apps.googleusercontent.com --client-secret=CLIENT_SECRET
Fill in your client-id and client-secret from the API Access page. You will
probably have to set a redirect URI in your client ID
loading the generated .yaml file
We can now run the service!
-`$ ruby prediction.rb`
+
+ $ ruby prediction.rb
This should start a service on `http://localhost:4567`. When you hit the service,
your ruby logs should show the Prediction API calls, and print the prediction
as streaming training, hosted models or class weights. If there are any
questions or suggestions to improve the script please email us at
prediction-api-discuss@googlegroups.com.
-