## Friday, October 22, 2010

### Pareto Distribution

I didn't realize that the standard heavy-tailed distribution is the Pareto Distribution. It's a Heavy-tailed distribution which follows the Power Law. It is commonly used to describe wealth distributions.

Update (10/25/10): Another distribution I didn't know about is the negative multinomial distribution. Seems like I would have come across this with all of my work in text classification. Then again, length never seemed to be that useful in determining classification (esp. compared to words). And, I bet even the single failure negative multinomial had too-light of a tail to model actual document lengths accurately.

## Wednesday, October 20, 2010

### Open Source Machine Learning Software

I've just learned about mlpy which is open source python machine learning software. It includes a good variety of machine learning algorithms including SVM, k-NN, LASSO, ridge regression, k-mean clustering, k-median clustering, wavlet transforms, and resampling methods. It uses numpy as one would expect. But, I see no mention of the use of sparse matrices, so I suspect that the library would not scale well to large feature matrices, which is typically essential in my work.

It looks like a good resource for open source ML software is MLoss, which organized a NIPS workshop.

## Wednesday, October 13, 2010

### A Better Lady Tasting Tea?

I recently learned of the famous Lady Tasting Tea hypothesis test experiment. When I read of Rod Sturdivant's account of the experiment, it struck me that the experiment was not designed to maximize the amount of learned information for a fixed number of cups.

The designer of the experiment, R. A. Fisher, was trying to determine whether a lady could tell whether milk was poured before or after tea was poured into a cup. To test, he presented her with four cups poured milk-first and four cups poured tea-first in random order. This results in 70 possibilities and a 1.4%-chance of correctly determining the order given no ability. A single mistake on the part of the lady would make it impossible to reject the no-ability hypothesis with reasonable (p=0.05) confidence.

If Fisher had instead flipped 8 coins, filling milk first if head and tea first if tails, then there would have been 256 possibilities with a 0.4%-chance (1/256) of guessing all 8 correct given no ability and a 3.9%-chance (9/256) of guessing 7-or-8 correct with no ability. So, with this method, a single mistake would have still allowed one to reject the no-ability hypothesis.

Of course, the coin-flip test is technically more difficult because of the need to make absolute determinations, rather than merely determining an ordering of the cups, as is the case in the permutation test.

## Friday, August 6, 2010

### Drawing Points from a Uniform Distribution

Everyone know how to draw points from a uniform distribution, right? Well, what if you want to draw points uniformly over a circle? You can draw from the bounding square and discard points outside the circle. But, this doesn't work for the n-sphere as n grows large (since the expected number of pseudo-draws increases without bound). The question of drawing uniformly from an elipse recently arose on the scipy mailing list and one participant posted an excellent discussion of how to make it work without discarding any draws. One of the key points is that you need (1) a parameterization, and (2) a transformation of that parameterization which yields a constant Jacobian.

## 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

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.

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...