Tuesday, January 26, 2010

Sort by Rating

A plea to Overstock (as well as any other web retailer which is willing to listen):

When I view a page of items from a category, I can select various "Sort By" options, such as "Top Sellers" and "Review Ratings". When I'm not looking for something specific, I would like to know what items are both popular and highly regarded by other customers. Neither "Top Sellers" nor "Review Ratings" does this. "Top Sellers" ignores ratings and a product with a single 5-star rating can be the top product according to "Review Ratings".

I would like to suggest an improvement to the "Review Ratings" sort which would make it more useful. Currently, you sort by average rating, i.e. sum-of-ratings divided-by number-of-rating. If you add a fictitious 3-star rating to this calculation (sum-of-ratings-plus-3 divided-by number-of-ratings-plus-1) the sort will be more valuable as only products which are popular AND receive top reviews would make it to the top of the list.

'course, anyone with a hint of machine learning background will recognize this as a very basic Bayesian posterior estimate. IMDB is one of the few sensible web sites which uses this sort of estimate for sorting based on rating.

Update (3/5/10): As Ashwin noted in the comments, the Wilson Score may be an even better solution.

Friday, January 15, 2010

Stochastic Gradient Descent

Most machine learning papers which evaluate an algorithm do so in a batch learning setting. Data is split into two. The first chunk is used to train the model; the second chunk is used to evaluate. But, the more I sit thinking about how to apply learning algorithms to the real world, the more I find this setting inapplicable. Typically, there is so much data and the "world" changes sufficiently often that it is difficult to construct a training set that would be appropriate for batch learning given the time constraints imposed in practice. Of course, there is an entire subdiscipline devoted to the problem of learning in an iterative fashion: online learning.

When text classification was my research topic in grad school, one of my favorite papers was Text categorization based on regularized linear classification methods by Tong Zhang and Frank J. Oles. I felt, and still feel, that this paper showed engineering acumen that is so often missing from research papers, many of which emphasize novel, yet fruitless ideas. The Zhang and Oles paper takes well-known, mathematically simple ideas and shows how they can be applied to achieve state-of-the-art performance.

My search for practical, effective online learning algorithms led me to Léon Bottou and his support of stochastic gradient descent. His style reminds me a bit of the Zhang and Oles paper. SGD has been around for decades, yet here he is showing that SGD trains multiple orders of magnitude faster than batch-style learners, with no loss on test performance. And, the theory supports the evidence. Traditionally, we consider two types of error: (1) the error due to limitations on our model class, and (2) error due to using a sample of data rather than the full joint distribution. Bottou points out a third error we should consider: optimization error (the difference between the empirical loss of our optimized parameter vector and the minimum empirical loss). SGD allows us to quickly find a parameter vector with empirical loss close to the minimum. What SGD cannot do is quickly find the parameter vector for the empirical loss minimum to a high degree of precision. But, since we are already making model class and sample approximations, there is no need to expend great effort trying to eliminate as much optimization error as possible.

The main caveat I see to using stochastic gradient descent for online learning is the setting of the learning schedule. Even for batch-style SGD, setting the learning rate sounds like it is not trivia. Bottou provides some tips in his Tradeoffs lecture:

  • Set the learning rate to η/(t + t0) where η = 1/λ (λ is the regularization parameter), t is the example index, and t0 is set so that initial updates are of the same magnitude as the final size of the weights.
  • If weight magnitudes are difficult to estimate, he suggests using a t0 to get the initial learning rate which would be chosen for the first step of gradient descent using a small batch of examples.
What the above tips do not address is the online/streaming scenario where one never wants the learning rate to become so small that the model would have difficulty reacting to changes in the underlying distribution. It seems that one could simply add a constant to the learning rate. Of course, selection of this constant is not trivial, but should neither be difficult to select by observing the magnitude of the per-example change in weights relative to the magnitude of the weights.

Wednesday, January 13, 2010

Sam Roweis Suicide

I'm speachless.

NYU Professor Jumps To Death

Update: (1/14) It sounds like the care of extremely premature 1 year old twin girls may have been the main reason for Sam's suicide. See fr_of_sams comment a page down in this NY Daily News thread:

Their children were twin girls. Born over one year ago. Severely premature: 24 weeks gestation. Severely disabled. Require 24-hour nursing care for their entire lives. Cannot eat, and will be on feeding tubes for the rest of their lives. Constant medical treatment and medical crises. Maybe someday they will walk. Maybe not. They will never really talk. The financial pressures on this couple were severe: they had already used up all insurance benefit limits, and burnt through their own personal savings with their retirement savings following rapidly. We should put the blame for Sam's death where it belongs. We have the technology to keep little girls like that alive. We have a society that pretty much insists upon doing so. But we put the financial and organizational and emotional burden entirely on the parents. We allow insurance companies to cap benefits, and we have no social system for rescuing people from these straights until they are literally homeless and bereft.
I had only met Sam a handful of times at conferences and certainly can't confirm or deny any of these details, but I don't know what else could have caused him to take his own life...

See John Lanford's post and the Sam Roweis memoriam blog.