Showing posts with label context decision tree. Show all posts
Showing posts with label context decision tree. Show all posts

Monday, August 18, 2014

Deb's Whiskey Recommender

Earlier posts have described the processes, both mental and physical, that I went through to create the knowtifacts necessary for generating a Whiskey Recommender. I used basic Excel skills to create the Options table. I used KnowtShare to generate the Context Decision Tree. I used Google and Bing's image search tools to find suitable images and placed them in a folder. I uploaded these three components into the Recommender Apperator, and it generated "Deb's Whiskey Recommender" for me.

For each of these steps I needed some basic computer skills, but I never needed to write computer code. What was most essential for me to provide was the knowledge of whiskey and an opinion about which type of whiskey was the best choice in different contexts. 

Since I wasn't an actual whiskey expert, I had to use the internet to educate myself. I also realized, too late, that I had taken on a really, really complicated subject for what was supposed to be a simple tutorial! This forced me to make several compromises between completeness and manageability. I had to cut corners. Each time I did, I noted that if I were building a real application I might have made different choices, and suggested how a more complete approach might be pursued.

So what did my efforts get me? Here are some screenshots of Deb's Whiskey Recommender, the app generated by the Recommender Apperator:

The logic I embedded in the Context Decision Tree is transformed into a simple wizard.





As the user makes choices, those choices are placed into the 'breadcrumbs' at the top of the page. This navigation device not only makes it clear which path has been taken through the tree, it makes it simple to backtrack to any one of the decisions and change it. When a user clicks on a prior choice, he or she will be taken to that spot in the wizard.

From a 'Shape of Knowledge' perspective, it is worth noting that the Context Decision knowledge is captured in a triangle shape, a tree, but the user interface serves that knowledge up in a linear fashion. This is an example of one of the best practices I talk about in my book: use the best knowledge shape for capturing the knowledge, but use the simplest shape possible when presenting it to a user. In this case, the triangular knowledge is flattened to a line by the wizard-like UI.

Based on this particular set of decisions, a long list of whiskeys is recommended. This path takes the user to the bourbons, both Tennessee Whiskey and Kentucky Straight Bourbon. Here is a sample of the recommended list:


The baseball card format lays out information from the Options Table. Shown are three of the many Kentucky Straight Bourbons in the Whiskey Table. At this point, the implications of the compromises I made become clear: everything on these three cards is identical, except for the brand name. Because all three whiskeys are from the same manufacturer, they have the same image. Because they are all the same type of whiskey, they have the same taste profile. Even though the price levels were calculated individually, they all happen to fall into the same price group. It would have been nicer if I had documented this information down to the individual brand level, but with 450 brands in the data table that wasn't feasible.

The options for knowledge authors building future Recommenders are these: pick a simpler topic, with fewer options; crowd-source the information in the Options Table; or be prepared to do a whole lot of work yourself, which is worth it if you are creating a Recommender to sell, establish your expertise, or to create competitive advantage. 

Meanwhile, it is important to remember that the amount of effort required to create a complete data table is minor compared to the effort required to build this sort of application from scratch! The data has to be there, in any case -- there's no avoiding that work. But the ease of building the decision logic in KnowtShare is unparalleled, and the user interface and the computer logic that knits the pieces together comes for free. 

This demo application achieved my goals: to document the process of building a Recommender, and to demonstrate that a potentially sophisticated application can be created based solely on domain expertise, no computer code required.

Tuesday, August 5, 2014

Creating the Whiskey Context Decision Tree - Part Two

My last post described the general challenges of building a context decision tree, and the specific challenges surrounding my search for expertise regarding whiskey selection. In the end, I decided I would have to rely on my own ideas, developed during the many hours of research I conducted while building the other inputs to the Whiskey Recommender. My immediate need was to create a context decision tree so the Recommender Apperator could generate a Whiskey Recommender app. Once that example is published, I hope to find some real, live whiskey experts that can help me build other, alternative Whiskey Recommenders.

I created my decision tree using our free KnowtShare web application. KnowtShare was designed to make it easy to build tree-shaped models. We, at Apprentice Systems, know from our many years of building intelligent systems that trees - hierarchical, non-cyclical models - are essential for capturing several modes of reasoning. Classification, composition and multi-pronged evaluation are all best described using trees. The branching behavior of a decision tree is also easy to document with this sort of model.

While some trees are best built bottom-up, a decision tree is usually built top-down. In other words, you decide the first question you are going to ask, list the possible choices, then determine what choices will be presented based on that first choice, and so on. The tree will document all the possible paths through the context collection process, but users will only travel one of those paths each time they use the application. At the end of each path, a 'leaf' on the tree, will be a recommended option - in this case, a type of whiskey.

I decided, pretty easily in fact, what the first question in my decision tree would be: "Are you going to mix your whiskey or drink it straight up?" I think this is a good first question because most whiskey connoisseurs agree that if you are going to mix your whiskey with Coke, it really doesn't much matter what you drink! Just don't waste a good Scotch! Of course, there are those who will mix an expensive whiskey with Coke, and I need to allow for that possibility as well.

Here is the 'mix it' side of my whiskey decision tree:


The next set of choices I present are using a flavorless mixer (water or club soda) versus a flavored mixer. You can still be a whiskey purist, of sorts, if you only use water or club soda. If your whiskey is to become part of a cocktail, however, it will be difficult to taste the whiskey itself - which is perhaps one of the goals of drinking a cocktail.

I'm pretty comfortable with these first few questions; I think I am on safe ground. Now the going gets much more difficult. I knew the 'flavored mixer' path was taking me towards the cheaper whiskeys, such as Canadian and American blended whiskeys, so I created the next set of choices: do you care more about price or status? If the user selects 'status', I decided to recommend either a Kentucky Straight Bourbon (like Wild Turkey) or a Tennessee Whiskey (like Jack Daniels). Picking 'price' leads to a variety of inexpensive American and Canadian options.

The real puzzler is the next set of options for the non-flavored mixer path. Remember, choices have to be presented in a language that represents the user's perspective (this was covered in the last post). Waxing poetic about the process differences between Scotch, Irish Whiskey and Bourbon won't work here! The target audience of the Whiskey Recommender is someone who is new to the world of whiskey, not an expert. Newbies couldn't care less about the finer points of distilling whiskey, especially since their palates probably can't distinguish the taste differences that result. So I decided to keep things simple, and make the next set of choices "do you prefer American products, or not?"

Finally, at the next level, I reached a point in the tree where I relied on taste profiles to make a distinction. American products were split into 'spicy', which leads to American Rye, and 'sweet', which leads to the bourbons. The non-American choice was split into 'light and smooth' (Irish Blended and Canadian Single Malt) and 'smokey and robust' (Scotch Blended and Single Grain).

This is the point where I need to reiterate an important message from the last post: this is all subjective! Even if I were a whiskey expert, which I'm not, this would still just reflect my opinion. A recommendation, by definition, exists in the world of subjectivity. Otherwise, this would be an 'Answerer', not a Recommender.

The power of the Recommender pattern is that I can create "Deb's Whiskey Recommender" just by building this tree in KnowtShare and combining it with the Whiskey Data Table in the apperator. Then my friend Richard, a real whiskey expert, can generate "Richard's Whiskey Recommender" by creating his own decision tree. He can even reuse my Whiskey Data Table. Better yet, in the future we can crowd source a much more complete data table and make that a community asset we all tap into when we build our own unique Whiskey Recommenders. That's the vision.

Back to my Recommender. Let's take a look at the other major branch of my decision tree, the 'straight up' branch:


I reused the 'do you prefer American products' choice again, and early on in the question sequence, because I needed to account for American Single Malts and I can't do it through a taste profile. American Single Malts are all over the board, taste-wise, because American distillers are using a wide variety of processes to create their single malts. Some are following the Scottish methods, and beating high-end Scotches in blind taste tests. Some are creating their own unique processes that are leading to unique taste profiles. All that binds them together is their country of origin, and that American origin is important to some people, including me. I like our underdog status in the Single Malt arena, and I like to support these distillers when I can.

As for the rest of the 'straight up' branch, it is a taste-driven breakdown between Irish Whiskey and Scotch, and within Scotch, a breakdown into the various regions. While some regions have distinct flavor profiles (like Islay) and some are more diverse (like the Highlands), taste is still the easiest way to direct a Scotch drinker to a particular region.

A real Whiskey Recommender, as opposed to this demo application I am building, could recommend specific Scotch brands, like Laphroaig. To keep things manageable, I have decided to stop my recommendations at a type of whiskey, like Islay Single Malt Scotch. If you've read the other posts about building the Whiskey Recommender, you will know that this is one of many simplifying assumptions I have made during this process.

Now that I've built my Whiskey Context Decision Tree and saved my KnowtShare file, I have all of the knowtifacts necessary to generate my app. The next step will be to enter them into the Recommender Apperator and generate my own custom web app.

Tuesday, July 29, 2014

Creating the Whiskey Context Decision Tree - Part One

Now that my Whiskey Data Table (or Whiskey Options Table) is complete, I can turn my attention to creating the context decision tree. The context decision tree in a Recommender contains a series of questions the user will be asked to determine his or her needs and gather any information about the current situation that may impact the decision being made. It also contains the link between each path through the decision tree and the options, or rows, in the data table.

Given these two important roles -- determining the user's needs and pointing to a particular set of options or solutions -- it is not surprising that the context decision tree is the knowtifact that contains the most critical 'expertise' in a Recommender application. In a complex subject like whiskey, there are hundreds of questions one might ask before making a recommendation, and even then it is not obvious what the best recommendation should be. In other words, creating a context decision tree is hard and full of subjectivity.

Because it is such a subjective exercise, if you ask ten different domain experts to build a context decision tree you are likely to get ten different results. This diversity of opinion reflects real life; if decisions were simple and obvious, we wouldn't need to consult with experts. The value of capturing expertise in a Recommender is multifaceted: it makes knowledge available to a wider audience by embodying it in a web app, it makes it possible to compare and contrast the decision processes of multiple experts, and multiple experts can leverage the same options table to build their own Recommender just by building different context decision trees.

The single biggest benefit of creating a context decision tree, however, is both subtle and surprising, and that is that it forces experts to actually articulate their knowledge. You might think getting experts to talk about what they know is not such a difficult thing to do, and that is true. But getting them to create a context decision tree can be very tough, and it raises issues like 'tacit vs explicit' knowledge and 'shallow vs deep' knowledge.

First, much of an expert's knowledge is typically tacit, especially when it comes to their decision making process. They just 'know' what to do, and they often can't explain why they do it. Building a context decision tree requires that they make this tacit decision process explicit.

Second, much of what passes for expertise is really 'shallow' knowledge like product and historical information, and rote process knowledge. This sort of expertise only requires a good memory. Building a good context decision tree often requires 'deep' knowledge, knowledge not only about what and how things are but why things are the way they are. It requires the ability to apply knowledge, not just repeat facts.

I've said from the beginning, I am not a whiskey expert. I started down the road on this demo application because I found a really cool classification chart for whiskies. I was able to take the next step and build the Whiskey Data Table because collecting data is more about diligence than expertise. But now I needed to find a whiskey expert.

Once again I turned to the internet, which is chock full of websites that claim to contain whiskey expertise. I started doing searches with phrases like "how to pick a whiskey" and "how to select the right whiskey". The search engines were able to pull up hundreds of links that purported to answer that question, but when I read what they had to say it was always a regurgitation of the same information over and over -- the differences between Irish whiskey and scotch, between Kentucky straight bourbon and Tennessee whiskey, between the bourbon process and the scotch process, between the mash bill for Canadian rye whiskey and American rye... The closest anyone came to providing useful information for the task at hand was the taste profiles for different scotch regions. Yes, taste is something a beginner whiskey drinker would care about. Mash bills? not so much.

Which brings us to a classic marketing problem. Users/consumers/customers are always looking for benefits -- touchy-feely, use-case specific benefits that will accrue to them as users. Manufacturers/sellers/retailers tend to want to talk about product features -- concrete, well-documented facts about the item or service they are selling. The marketing people are the ones who must make the connection between the two, and advertising and product literature exist to create that bridge.

In a similar fashion, a context decision tree, which is a series of questions that will be answered by the user, needs to be written in the language of benefits and use-cases. My web research surfaced very little knowledge that would help someone new to the world of whiskey decide where to begin. With so many choices, some of which are quite expensive, how can a relatively inexperienced drinker make a selection that is a good fit for his or her current needs? That is what I needed to know to create a good Whiskey Context Decision Tree.

After approximately 100 hours of total research time -- between building the classification tree, the data table, and general whiskey research -- I was going to have to use my own creativity and judgment to build the context decision tree. It was sure to have a lot of flaws, but at least I would be able to generate an initial version of a Whiskey Recommender.