Skip to content

Posts tagged ‘algorithms’

Suggestive Selling and Recommendation Engines

Sometime back I blogged about the challenges of building recommendation engines. It is very difficult to come up with an algorithm that can predict what you may be interested in. If you look at your recommendations on, you will typically notice a pattern based on an author or particular subject. Good luck finding something that was recommended because you liked John Grisham and Nuclear Physics – it simply seems this type of intersection is not in their algorithm.

If you look at Netflix on the other hand, this is exactly what they do. Based on the genre, actors, etc. and how other people who have rated other movies the same as you, Netflix takes a guess at how much you will like the movie. And they simply don’t recommend it – they say ‘we think you’ll give this 3.5 stars.’ Pretty cool stuff.

Why do I bring this up now? Because today is the launch of Windows 7 and I had a flashaback to a visit I paid to a short time ago. I was presented with the recommendation shown below.

Why on earth I should consider Cake Mania because I looked at Windows 7 is beyond me.

And no, I didn’t consider it – in case you were wondering.

Operation Aborted Message in Internet Explorer

After rolling out McKNet Connections and integrating social and traditional search platforms, some of our users began seeing the message “Operation Aborted” in Internet Explorer 6 and 7. If they had “Friendly HTTP Errors” enabled, they would then see the friendly page for a 404 error. If not, they would remain on the search results page looking at a normal body of output.

This took several months to diagnose and fix because:

a) It was intermittent. Most of the people who reported it could not reliably reproduce the scenario every time.

b) Inspection of page elements being returned across the HTTP stream were identical whether the “operation aborted” message appeared or not.

c) We weren’t doing anything very fancy – just launching a bunch of AJAX HTTP calls to get metadata about the search results.

Finally, I had a breakthrough last Friday when I read Microsoft KB article #927917. It indicated a possible occurrence was because a child container HTML element tries to modify a parent container that was not yet closed. The solution Microsoft proposed was upgrading to IE 8. Back in reality-land, I had to come up with another option.

Upon inspecting the code, I noted that we were updating the innerHTML property of various elements as a result of several web service calls. To increase performance, we began triggering these calls as they were realized on the page. These calls were nested in various DIV containers and it dawned on me that perhaps some of our clients were getting responses back from the asynchronous call before the calling block’s DOM element was closed.

As a test, we removed the 10 calls that were taking place and found that users with the issue continued to experience it in Production, but not in this new test code. The next step was to build an array of calls and then trigger them once the DOM section was closed. Again, we tested this with our users and found that the full functionality had been restored and no errors were experience.

The lesson learned here was to defer AJAX calls until the DOM blocks they would be updating has completely loaded.

links for 2009-06-01

  • Companies are working fast to figure out how to make money from the wealth of data they’re beginning to have about our online friendships
  • Lotus Connections is a little bit screwy when it comes to profile pictures IMHO as they are being forced to be square in Profiles (115×115 pixels). In profiles search results however they are scaled to 55 pixel in width and height is automatic. This post contains code to fix that.
    (tags: connections)
  • The core of any great race starts with your training. And, of course, what you do just prior to your race and then during the event itself will have a tremendous impact on your performance. Spelling out the details of these two areas could fill the pages of Triathlete magazine for the next 10 years, but there are a few steps you can take regardless of the training program you are following right now to help boost your chances of achieving your goals.
  • In the Traveling Salesman Problem, the goal is to find the shortest distance between N different cities. The path that the salesman takes is called a tour. Testing every possibility for an N city tour would be N! math additions. A 30 city tour would have to measure the total distance of be 2.65 X 1032 different tours. Assuming a trillion additions per second, this would take 252,333,390,232,297 years. Adding one more city would cause the time to increase by a factor of 31. Obviously, this is an impossible solution. A genetic algorithm can be used to find a solution is much less time. Although it might not find the best solution, it can find a near perfect solution for a 100 city tour in less than a minute. There are a couple of basic steps to solving the traveling salesman problem using a GA.

Recommendation Engines

Some time back I started pondering the challenges of automating affinity in the enterprise – that is determining people you should know based on your digital footprint. Part of my exercise has had me looking into the recommendation engines that others have implemented and seeing what makes them tick.

When I first started to really look at the Amazon recommendation engine, noticed a pattern. The fiction books recommended to me – all seemed to be same authors I've already indicated interest in (either by buying or rating). No new authors were coming up. I thought this was odd – I certainly did not need to be recommended a book from Grisham, Clancy, or Ludlum. In exploring the non-fiction books, the recommendations better – but really seemed too topical. Just because I bought a book on corporate governance a few years ago during my MBA program studies does not mean that I am interested in it now. That situation is easily rectified by telling Amazon to ignore that purchase for recommendations, so I really won't gripe about it.

An interesting thing happened the other day though when I cranked up my Kindle. I started getting recommendations for fiction books from other authors. What was the difference? I purchased The Hitchhiker's Guide to the Galaxy on my Kindle. Apparently, Grisham / Clancy / etc. aren't good connectors or predictors. But buy something from Douglas Adams and whammo!, you get recommendations. So now I've uncovered many authors and books I may be interested in, and am sorely in need of some free time to discover them.

The unfortunate side effect to this discovery is that I no longer have an out based on my initial observations of Amazon. My guess is that when you only buy and rate the highly popular authors, the ranking algorithm becomes skewed toward those large pools and does not uncover the books/authors that may be equally good but less purchased. So, my investigation continues.