I won’t go into all the details behind GymboreeDeals, but it is operated by my wife, and involves manually categorizing content. Maybe Google Prediction API can help speed up her work, or (if the gods of Olympus are smiling upon her) eliminate aspects of it.
With my newly acquired knowledge of Google Prediction API it was trivial to develop a prediction model.
Fortunately (for my data needs), she has manually categorized more than 10,000 eBay auctions since September (~50/day) which provides a fairly good example set for Google’s machine learning algorithms.
To review, the process to create the trained model was:
With that, I have a trained model that I can invoke:
./oauth-predict.sh gymb/prediction_models/genders \
"\"NWT GYMBOREE BURST OF SPRING LOVE SWEET STRAWBERRY SZ 2\""
Which returns:
{
"kind": "prediction#output",
"id": "gymb/prediction_models/genders",
"selfLink":
"https://www.googleapis.com/prediction/v1.2/training/gymb/prediction_models/genders/predict",
"outputLabel": "Girl",
"outputMulti": [
{
"label": "Girl",
"score": 0.999855
},
{
"label": "Boy",
"score": 1.45E-4
}
]
}
“Sweet” “Love” “Strawberry” were probably dead giveaways. How about a tougher one…
./oauth-predict.sh gymb/prediction_models/genders \
"\"NWT GYMBOREE WILD SAFARI BASIC ORANGE KNIT SHORTS 4 4T\""
Which returns:
"outputLabel": "Boy",
"outputMulti": [
{
"label": "Girl",
"score": 0.315243
},
{
"label": "Boy",
"score": 0.684757
}
]
Much closer score, but identified “Boy” correctly. Very cool. Must have been the word “Wild”.
Let’s try out the Ruby wrapper written by peeps @ Google. I add to the project’s Gemfile:
gem 'google_prediction', '0.0.1'
I run bundle, then try to startup the Rails app. (Rails 3, and Ruby 1.9.2 for the new hash syntax.)
The app won’t start, no such file to load -- jcode which means the gem isn’t updated for 1.9 compatibility.
And looking at the README, it’s using old ClientLogin methodology, not OAuth. So the Ruby wrapper is for API version 1.1, not 1.2.
Am I dead in the water? No.
I just need to write my first gem :)