Skip to main content

Classification and Clustering

In order to write a tutorial about classification, it was necessary to find an example that was broad enough that it would need to be sub-divided. Since I actually care about whether you remember this stuff, it needed to be something that a lot of people like and would relate to. And since I have a lot of international subscribers, it needed to be cross-cultural as well. So what is universal, cross-cultural, and dearly loved?
Beer.
Beer. Heck yeah.
There’s American beer, Mexican beer, German beer, Belgian beer….hell, even the Japanese make beer. There’s IPA, Lager, Pilsner. Dark, light, stout. There are so many ways to classify beer that we could spend weeks doing it (so naturally, I did).
Now, before you can classify anything you have to determine the characteristics that you’re going to use. For beer you could use country of origin, color, alcohol content, type of hops, type of yeast, and calorie count among other things. That way you could sort based on any of those characteristics to judge similarities between the various brews.
And just like that, you’ve done classification. Simple, right?
To take the example further, let’s assume that my favorite beer is Sweetwater “Take Two” (a pilsner made here in Atlanta) but I’m in Santiago, Chile this week for a conference.  The Chileans are a lovely people, but the management at my hotel doesn’t know about the wonderful goodness made by Sweetwater and they don’t have it at the lobby bar. I explain my predicament (read: “impending crisis”) to the bartender. What would a good bartender do?
If he’s been in the business for any length of time, he’s already gone through the classification step for beers but probably didn’t realize it. He has them sorted by characteristics in his head. He starts asking me questions about Take Two: “How dark is it?”, “How ‘hoppy’ does it taste?”, and “How many can you drink before passing out?”. Based on my answers he knows that what I’m describing is basically a golden-blonde pilsner with spicy hops and an earthy tone.
He might also figure out that I’ll need help back to my room at the end of the night because of all this “field research”.
So now that he has the characteristics of my favorite brew figured out, he compares that against the beers he knows. The ones with the most matching criteria form a “cluster” that he can make recommendations (and hopefully free samples) from. My night is saved, and his tip is big. Everyone is happy.
And just like that, you understand clustering.
How does this apply to the business world? There are many potential applications of classification and clustering, but a common one is identifying the characteristics of a company’s best customers and then searching a pool of potential customers for ones that meet those characteristics. If your best customers have between 1000-2500 employees, are in the manufacturing and retail verticals, and are located in the New England area of the US, that’s good information to know.
What applications can you think of?

Comments

Popular posts from this blog

Python and Parquet Performance

In Pandas, PyArrow, fastparquet, AWS Data Wrangler, PySpark and Dask. This post outlines how to use all common Python libraries to read and write Parquet format while taking advantage of  columnar storage ,  columnar compression  and  data partitioning . Used together, these three optimizations can dramatically accelerate I/O for your Python applications compared to CSV, JSON, HDF or other row-based formats. Parquet makes applications possible that are simply impossible using a text format like JSON or CSV. Introduction I have recently gotten more familiar with how to work with  Parquet  datasets across the six major tools used to read and write from Parquet in the Python ecosystem:  Pandas ,  PyArrow ,  fastparquet ,  AWS Data Wrangler ,  PySpark  and  Dask . My work of late in algorithmic trading involves switching between these tools a lot and as I said I often mix up the APIs. I use Pandas and PyArrow for in-RAM comput...

How to construct a File System that lives in Shared Memory.

Shared Memory File System Goals 1. MOUNTED IN SHARED MEMORY The result is a very fast, real time file system. We use Shared Memory so that the file system is public and not private. 2. PERSISTS TO DISK When the file system is unmounted, what happens to it? We need to be able to save the file system so that a system reboot does not destroy it. A great way to achieve this is to save the file system to disk. 3. EXTENSIBLE IN PLACE We want to be able to grow the file system in place. 4. SUPPORTS CONCURRENCY We want multiple users to be able to access the file system at the same time. In fact, we want multiple users to be able to access the same file at the same time. With the goals now in mind we can now talk about the major design issues: FAT File System & Design Issues The  FAT File System  has been around for quite some time. Basically it provides a pretty good file structure. But I have two problems with it: 1. FAT IS NOT EXTENSIBLE IN PLAC...

Fetching Facebook Friends using Windows Azure Mobile Services

This tutorial shows you how to fetch Facebook Friends if you have Facebook accessToken. Here is the the code for Scheduled task called getFriends function getFriends() { //Name of the table where accounts are stored var accountTable = tables.getTable('FacebookAccounts'); //Name of the table where friends are stored var friendsTable = tables.getTable('Friends'); checkAccounts(); function checkAccounts(){ accountTable .read({success: function readAccounts(accounts){ if (accounts.length){ for (var i = 0; i < accounts.length; i++){ console.log("Creating query"); //Call createQuery function for all of the accounts that are found createQuery(accounts[i], getDataFromFacebook); } } else { console.log("Didn't find any account"); prepareAccountTable(); } }}); } function prepareAccountTable(){ var myAccount = { accessToken: "", //enter here you facebook accessToken. You can retrieve ...