<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Annelise Holverstott on Medium]]></title>
        <description><![CDATA[Stories by Annelise Holverstott on Medium]]></description>
        <link>https://medium.com/@annelise.uhlig?source=rss-2aa48dc1dc2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*I7-322uPVS1uFG9h</url>
            <title>Stories by Annelise Holverstott on Medium</title>
            <link>https://medium.com/@annelise.uhlig?source=rss-2aa48dc1dc2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:30:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@annelise.uhlig/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[K-Means Clustering for Marketing Personas]]></title>
            <link>https://medium.com/@annelise.uhlig/k-means-clustering-for-marketing-personas-7ed31ea2001d?source=rss-2aa48dc1dc2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ed31ea2001d</guid>
            <dc:creator><![CDATA[Annelise Holverstott]]></dc:creator>
            <pubDate>Sat, 27 Nov 2021 03:13:08 GMT</pubDate>
            <atom:updated>2021-11-27T03:13:08.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="four cartoon people of different races, genders, religious garb, etc." src="https://cdn-images-1.medium.com/max/1024/1*8UqCF97CZIV2Gvm5vGSuWg.png" /></figure><p>When I worked in fundraising marketing for nonprofit organizations, I would often hear about marketing personas, which help you to market toward actual people, rather than a set of behaviors. Each persona is a semi-fictional prototypical customer culled from everything you know about your customer base.</p><p><a href="https://digitalagencynetwork.com/how-to-create-personas-for-marketing/">This article from Digital Agency Network</a> has more details, and also inadvertently introduces a huge obstacle for many organizations interested in developing personas: defining them from your data and assigning every single customer to one of them.</p><p>If the suggestion to do it in Excel sends your blood-pressure soaring, you’re in the right place. Though technically possible to do it in Excel (or even on index cards, if you’re really masochistic), the process would be tedious, time-consuming, and unsustainable.</p><figure><img alt="Man slumped on his desk at work. Text reads: Cause of death, Microsoft Excel" src="https://cdn-images-1.medium.com/max/460/1*M1O8M8OrwV63rtZqHJSFpg.jpeg" /><figcaption>Don’t get me wrong — I love Excel for some things. But not persona clustering!</figcaption></figure><p>There is a better way! Today I am going to demonstrate how to create basic clusters in Python using <a href="https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html">K-Means Clustering</a> from sklearn. I’m using the <a href="https://www.kaggle.com/shwetabh123/mall-customers">mall customers data set</a> which is widely available around the internet, including on Kaggle.</p><p>First, here are the imports that I will use:</p><pre>from sklearn.cluster import KMeans<br>from sklearn.preprocessing import StandardScaler<br>from sklearn.metrics import silhouette_score</pre><pre>import numpy as np<br>import pandas as pd<br>import seaborn as sns<br>import matplotlib.pyplot as plt</pre><p>Read in the data file and ensure that all columns are numeric. In my data, all I had to do was binarize the Gender column, which I did like so:</p><pre>df[&#39;Gender&#39;] = df[&#39;Gender&#39;].map(lambda x: 0 if x == &#39;Male&#39; else 1)</pre><p>Now let’s take our first look at this data. We have an id column and four customer characterstics: gender, age, income, and spending score.</p><figure><img alt="First 5 rows of the mall customers dataset" src="https://cdn-images-1.medium.com/max/517/1*XX8fS_7crB0_xY4iOwj1hA.png" /><figcaption>First 5 rows of the mall customers dataset</figcaption></figure><p>Before doing a cluster analysis on any data, it is extremely helpful to have some visualizations of the data. Data that is amenable to cluster analysis often reveals at least some clusters simply by visual inspection. I’ll do a pairplot for the four columns that contain the customer characteristics I’m interested in.</p><pre>sns.pairplot(df, vars = df.columns[1:5]);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*IfcCRkEeOIL6j956lLpEow.png" /><figcaption>Pairplots of four of the columns in the mall customers data</figcaption></figure><p>From these pairplots, I can already see a few cluster-like patterns emerging. There are two distinct clusters based on gender, not too surprising since there are only two genders represented in the data.</p><p>Looking at the bottom right, I can also see that when comparing annual income to spending score, there are five noticeable groups arranged in a sort of X-shape, with a high concentration in the center. It looks like for about half the people, there is a positive relationship between income and spending, while for the other half it’s a negative relationship.</p><p>Finally, there may be two or three loose clusters when comparing age and spending score.</p><p>After looking at the visualizations, I decided to use K-Means instead of DBSCAN (another common clustering algorithm), for a couple of reasons:</p><p>1. <strong>K-Means handles clusters of varying density better than DBSCAN. </strong>As we can see, the gender data is more tightly clustered than the age vs spending score data. And within the income vs spending score plots, the center cluster is much denser than the outer clusters. <br>2. <strong>I have an idea of how many clusters I want to end up with.</strong> KMeans requires us to specify a number of clusters, which is a disadvantage if we don’t know very much about our data. But in this case, the visualizations show us that we probably want five unique groups. Sometimes it is hard to tune the hyperparameters of DBSCAN to end up with number of clusters that we expect.</p><p>Let’s start modeling! When using clustering algorithms, it is essential to scale your data, because distance between points plays a large role. You wouldn’t want your clusters skewed just because some of your data is on a much larger scale.</p><pre>data = df.drop(columns = &#39;CustomerID&#39;)<br>ss = StandardScaler()<br>data = ss.fit_transform(data)</pre><p>As discussed, I’m going for five clusters with this data based on the visualizations. You may already have a deep understanding of your data that allows you to make a good guess, or you may have practical limitations — your boss has asked for exactly three personas based on some webinar they sat through. Five personas seems a bit higher than ideal, but still manageable.</p><pre>km = KMeans(n_clusters = 5, random_state = 42)<br>km.fit(data)</pre><p>Now I’ll bring in the K-Means label as a new column in my original data frame. That will allow me to look at the pairplot again, this time with each cluster in a different color, to visually confirm that the clustering makes sense.</p><pre>df[&#39;cluster_km&#39;] = km.labels_<br>sns.pairplot(df, vars = df.columns[1:5], palette=&#39;bright&#39;, hue=&#39;cluster_km&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*Uy4YZWwX25mkDOVOm0TApA.png" /><figcaption>Pairplots for four columns of the mall customers dataset, by cluster</figcaption></figure><p>Interesting! This isn’t exactly what I had in mind, but it does seem fairly sensible. Clusters 0 and 2 seem to be one gender. Clusters 1 and 3 seem to be the other gender, and Cluster 4 seems to be a mix. Clusters 0 and 1 overlap each other sometimes, and so do Clusters 2 and 3, but we see very little overlap of, say, 1 and 2. That may indicate that we have a couple of groups with a lot of similar characteristics, but different gender.</p><p>I’ll also look at the average <a href="https://towardsdatascience.com/silhouette-coefficient-validating-clustering-techniques-e976bb81d10c">silhouette score</a> for my clusters, which essentially tells you how close together each point in the cluster is, and how far apart the clusters are from each other. This metric is not necessarily more reliable than simply eyeballing your data plots, but I’d be concerned about a particularly low score.</p><pre>print(silhouette_score(data,km.labels_))</pre><pre>0.31709067955763137</pre><p>The lowest possible silhouette score is -1 and the highest is 1, so this score is pretty good.</p><p>Finally, I think I am ready to begin to define each of the buyer personas. I can now use groupby to look at all the characteristics for each cluster.</p><pre>display(df.groupby(&#39;cluster_km&#39;).mean())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*7SayQBkaA3x1EJQ55S6jBA.png" /><figcaption>Mean values of each column, grouped by cluster</figcaption></figure><p>Here’s my first pass at describing a persona for each of these five clusters:</p><p><strong>Cluster 0:</strong> A 28-year-old woman with a good professional job, who loves to shop. <br><strong>Cluster 1:</strong> A 28-year-old man with a good professional job, who loves to shop.<br><strong>Cluster 2:</strong> A 49-year-old woman with a low-wage job who will occasionally splurge on something special.<br><strong>Cluster 3:</strong> A 56-year-old man with a blue-collar job nearing retirement, who still likes to shop as long as it’s a good value. <br><strong>Cluster 4:</strong> A middle-aged person at the peak of their career, who doesn’t have much time to shop and only comes to the mall if there’s a great sale on.</p><p>Obviously there’s a lot of work to do still — some of those clusters could be combined, for example — but the gruntiest of the grunt work is done. It only took an hour, and now the interesting part can begin!</p><p>One last cool thing! Once you have KMeans set up and optimized perfectly for your customer data, you can use it to regularly categorize new customers. That’s because KMeans from sklearn has a <em>predict</em> method that you can use to guess which cluster new data belongs in.</p><pre>km.predict(new_customers)</pre><p>I hope clustering opens your eyes up to new customer segmentation possibilities and more customer-focused marketing approaches. Buyer Personas shouldn’t be a marketing strategy that’s only usable at giant corporations with large agency partners; any nonprofit organization or small business should be able to try clustering their customer base, and I hope you feel more empowered to try it!</p><p>P.S. If you don’t know very much Python, there are boatloads of free tutorials and videos available, including this excellent <a href="https://www.youtube.com/watch?v=kqtD5dpn9C8&amp;ab_channel=ProgrammingwithMosh">one-hour crash course from Progamming With Mosh</a>. Excel could be the best tool to clean your data if that’s what you’re most comfortable with, but do try clustering in Python. I promise you that the time spent learning Python will be much more enjoyable than refreshing 78 different pivot tables because you found a typo in one of your cells.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ed31ea2001d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On Starting Over]]></title>
            <link>https://medium.com/@annelise.uhlig/on-starting-over-b1775f33a5cc?source=rss-2aa48dc1dc2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1775f33a5cc</guid>
            <category><![CDATA[general-assembly]]></category>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Annelise Holverstott]]></dc:creator>
            <pubDate>Wed, 13 Oct 2021 22:49:48 GMT</pubDate>
            <atom:updated>2021-10-13T22:49:48.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="scrabble tiles spelling the word “CHALLENGE”" src="https://cdn-images-1.medium.com/max/1024/1*24VU8KTl8r6yA3QxCHuCZg.jpeg" /></figure><p>People keep asking me if I’m excited. Partly that might be because my face affords the expressive range of a welding helmet, but I actually do know why they’re asking.</p><p>I recently started an intense, full-time immersive course in Data Science through General Assembly. Since I’ll be posting throughout the course, I’ll get started with a little bit about my background, as well as whether or not anything about my life or work is even slightly exciting.</p><p>I’m a relative late-bloomer when it comes to data and tech careers. When I was in high school in the late 90’s, data science as we know it, like many of today’s tech jobs, didn’t really exist.</p><p>I went the liberal arts route, taught in the public schools in a few states, and finally decided I needed the kind of boring desk job that you can leave at the office at the end of the day. I ended up in the philanthropy department of a large non-profit.</p><p>It wasn’t long before a preponderance of my day-to-day tasks involved pulling complicated datasets and churning through them in Excel looking for actionable patterns that my supervisors could understand. Everyone agreed that this was very useful and that I had an uncommon aptitude for it. For several years, I hoped I might get a big promotion as a reward for being so useful and adept.</p><p>Spoiler alert: Didn’t happen. Cue sad trumpets.</p><p>So I moved on to another non-profit’s philanthropy department. And the exact same thing happened. I finally started to catch on. I was very good at <em>something</em>, but it wasn’t anything that my particular employers seemed to need much of.</p><p>But what exactly did I have to offer? And who would want it? How could I look for jobs that used a keyword I didn’t have a name for? These were questions I couldn’t answer yet.</p><p>Around that time, a friend of mine invited me to attend a free “Intro to Data Analysis” class with her at our local General Assembly campus. GA offers free workshops all the time on a wide variety of topics. I really expected it to be a sales pitch, but to my pleasant surprise, I learned a few new things and walked out empowered to learn more on my own.</p><p>Looking back, that was actually a pivotal moment in terms of my career development. I had figured out at least one name for my skills. I had learned from GA that in fact, a lot of employers wanted people to do data analysis and data science. And, I knew where I could go to get the additional training I would need to transform my career.</p><p>It took several years for my personal life and finances to align so that I could quit my job and go back to school full-time. Is it exciting? Maybe a bit, but mostly it’s a relief. I’m so relieved to have found a career path that makes sense for me at last.</p><p>I hope you will follow some of my other posts as I go through this program. If you’re still struggling to find your way through the workplace, don’t be afraid to try something new!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1775f33a5cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>