<?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 Adrian Campos on Medium]]></title>
        <description><![CDATA[Stories by Adrian Campos on Medium]]></description>
        <link>https://medium.com/@adriancampos?source=rss-6a836f0a8c9c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*oIdJyDqK0qabHnh9QFRFew.jpeg</url>
            <title>Stories by Adrian Campos on Medium</title>
            <link>https://medium.com/@adriancampos?source=rss-6a836f0a8c9c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:20:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adriancampos/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[Enron Email Analysis — A K-Means Clustering Approach]]></title>
            <link>https://medium.com/@adriancampos/enron-email-analysis-a-k-means-clustering-approach-3324afc65d5?source=rss-6a836f0a8c9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3324afc65d5</guid>
            <category><![CDATA[natural-language-process]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[k-means-clustering]]></category>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Adrian Campos]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 15:52:33 GMT</pubDate>
            <atom:updated>2019-08-26T15:53:59.225Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GVVLOVfvEwj69fom" /><figcaption>Photo by <a href="https://unsplash.com/@shlomo99?utm_source=medium&amp;utm_medium=referral">Shlomo Shalev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Enron Email Analysis — A K-Means Clustering Approach</h3><p>Earlier this year, I decided to dive into machine learning and find out what all the hype was about. A good starting point seemed to be K-means clustering as my unsupervised machine learning algorithm.</p><p>Ok, so I have the tools, now what? I knew I wanted to work with text (i.e., corpus). Somehow classifying documents into sentiment analysis. Something that I can talk with other Data Scientist and get there input on. Through my search, I happened to land on the Enron Email Corpus, which I ended up working on. It’s the largest public data source of it’s kind. Rumor has it, it’s the set that Siri was trained on from DARPA? I couldn’t find anything else publically available to me. However, this wasn’t the reason why I delved into it.</p><p>As I mentioned my project to friends (several — way too young to remember), it dawned on me, they have no idea. Most of them were baby’s during this time (really, they were like 10–12 years old). This is a great time to work on this project, bring this former mainstay to light. If anything — get a better understanding of K-means clustering.</p><p><strong>The Data</strong></p><p>All research I did landed on the Carnegie Mellon University — School of Computer Science.</p><p><a href="https://www.cs.cmu.edu/~enron/">https://www.cs.cmu.edu/~enron/</a></p><p>Evidently, they worked on this quite a bit back in the mid-2000s. The number of emails was staggering. Over 500,000 emails. That’s a ton. However, I did not want to spend my time cleaning, organizing, or categorizing them. Luckily, CMU students did most of that, but I won’t be using their categorized emails. I won ‘t be classifying — simply finding correlations between words throughout the corpus — clusters.</p><p>Through further online research, I found Brian Ray’s work the Enron Corpus. He actually placed them in a beautifully laid out, over 2 gigs, CSV files. That’s a ton of data. Better get to work.</p><p><strong>Data Cleaning</strong></p><p>I’m not classifying but letting my model determine the cluster of most interesting words. To be able to explore the data further. I ended up dropping most of my categories, except for the body of the text and the date. Don’t get me wrong, there was still data cleaning that I had to perform. Typical cleaning, duplicates, NaN’s, etc.…</p><p><strong>Vectorizing</strong></p><p>To use my clustering algorithm, I found the need to vectorize my corpus. I started using TFIDF (<em>term frequency-inverse document frequency). </em>However, for the end presentations, it was easier for me to present “counts” and not term-frequencies. So, I switched to CountVectorizing instead in my pre-processing.</p><p><strong>Model</strong></p><p>As I mentioned earlier, I knew I would be clustering my corpus, and K-means clustering was an easy entreé into machine learning. Pretty straight forward. I won’t bore you with the details here, but I’ve provided a link to the Enron Email Analysis public GitHub repo below:</p><p><a href="https://github.com/adriancampos1/Enron_Email_Analysis">https://github.com/adriancampos1/Enron_Email_Analysis</a></p><p><strong>Resources</strong></p><p>You can find my Jupyter Notebooks there as well as the end data source that I used for the project. Also, links to the complete undoctored email set, if that’s your jam.</p><p><a href="https://data.world/brianray/enron-email-dataset">https://data.world/brianray/enron-email-dataset</a></p><p><strong>Findings</strong></p><p>My K-means algorithm brought out some interesting, but not surprising clusters. For example, I found a cluster with California, Cali, CA, and trade, traders, trading in one cluster. This would make sense as Enron executives encouraged market engagement with specific traders to drive the cost of energy higher. Its effect was the 2001 California energy crises, causing high energy prices and blackouts throughout the state.</p><p>Other clusters found legislature, know, knowing, knowledge, investigation, commodities, etc.. A cluster worthy of further investigation.</p><p><strong>Wrap</strong></p><p>My Enron Email Analysis project was short work on the exploration of Machine Learning through unsupervised K-means clustering. Further investigation on the dataset can definitely bring forth additional findings. This corpus is still utilized today to train NLP models. If you’re looking to work on text or sentiment analysis, I will steer you in the direction of this corpus. You’ll find it challenging.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3324afc65d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tableau / Data Science Workflow Integration]]></title>
            <link>https://medium.com/@adriancampos/tableau-data-science-workflow-integration-8fd5a62a1664?source=rss-6a836f0a8c9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fd5a62a1664</guid>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[tableau-integration]]></category>
            <category><![CDATA[tableau-consulting]]></category>
            <category><![CDATA[data-science-workflow]]></category>
            <dc:creator><![CDATA[Adrian Campos]]></dc:creator>
            <pubDate>Fri, 23 Aug 2019 14:42:57 GMT</pubDate>
            <atom:updated>2019-08-23T14:42:57.404Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RJ8jRoREw0UF38_X" /><figcaption>Photo by <a href="https://unsplash.com/@franki?utm_source=medium&amp;utm_medium=referral">Franki Chamaki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A few months ago, I decided to take my “Python” based graphics to the next level. Not so much for my EDA, Jupyter Notebook, or typical Data Science workflow, but the presentation to stakeholders. Don’t get me wrong we all love matplotlib; it’s the best (breaths a giant sigh of contempt). Now, Seaborn and Bokeh are a significant step up as you begin to advance your visualizations, but I’m a firm believer in Tableau for stakeholder visualizations.</p><p>There’s been a significant advancement in Python-based visualization, notably Plotly and other similar visualization workflows. However, these center around a Python-based workflow. Working through these utilities are great during our day to day workflow. They help bring to light relationships or correlations that may be overlooked by only viewing the data. Well, at least for me. I’m a very visual person.</p><p>Early this year, I decided to embrace visualizations through Tableau for all my stakeholder presentations. It’s an extra step if you’re the lone wolf in your tribe (only data scientist on staff), and, actually, it’s a few more steps. Now, If you’re part of a team with data engineers, data scientists, and analysts or maybe business intelligence analysts, you’re probably used to getting your findings and data set to the next person in line. Chances are they’re using some dedicated visualization software for their presentations.</p><p>However, what if you’re the lone wolf? One more cog in the process. You know more cogs = more work. Why not integrate Tableau as part of your workflow and avoid some of those extra steps. Adrian, you should have lead with “save me time and make my graphs look amazing.” Yup, I agree. Let me give you a couple of options.</p><p><strong>Tableau / Google Sheet Integration (not best, but fun to get to work)</strong></p><p>By far, not the best workaround was integrating Tableau in your DS workflow. However, this was my initial forea into my new Tableau DS workflow. I knew that Tableau connects with google sheets and that google sheets take in CSV files. Why then add another step, couldn’t I just read to a CSV file and then upload that to Tableau? Yup. However, what if I could write directly to google sheets w/ a command in Jupyter, at which point, Tableau would update in the background. Essentially, I would have freshly pressed and up to date info for Tableau to do its magic. Done. Here’s where I found how to do this.</p><p><a href="https://socraticowl.com/post/integrate-google-sheets-and-jupyter-notebooks/#targetText=Import%20the%20data%20from%20your,it%20into%20the%20following%20code.&amp;targetText=Enter%20the%20name%20of%20the,the%20above%20code%20as%20well.">https://socraticowl.com/post/integrate-google-sheets-and-jupyter-notebooks/#targetText=Import%20the%20data%20from%20your,it%20into%20the%20following%20code.&amp;targetText=Enter%20the%20name%20of%20the,the%20above%20code%20as%20well</a></p><p><strong>Tableau / Database Integration (the professional way of doing this)</strong></p><p>Really, this is the best kind. You’re probably working a model in a pipeline and writing your data to a SQL Database or Amazon Redshift. These connect with Tableau seamlessly and with much less headache than the google sheet integration. Here is a list of all the connections you can make with Tableau.</p><p><a href="https://help.tableau.com/current/pro/desktop/en-us/exampleconnections_overview.htm">https://help.tableau.com/current/pro/desktop/en-us/exampleconnections_overview.htm</a></p><p>I have no fancy graphs or dashboard visualizations for you in this article. I wanted to share my fondness for Tableau and an introduction to your DS workflow. Maybe the next article can showcase some of the dashboards created for work or clients? What are you’re thoughts on Tableau or possible concerns on integrating it into your daily workflow?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fd5a62a1664" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FEMA Lifelines]]></title>
            <link>https://medium.com/@adriancampos/fema-lifelines-eb3d5cd8311e?source=rss-6a836f0a8c9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb3d5cd8311e</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[fema]]></category>
            <category><![CDATA[tableau]]></category>
            <dc:creator><![CDATA[Adrian Campos]]></dc:creator>
            <pubDate>Fri, 09 Aug 2019 16:28:46 GMT</pubDate>
            <atom:updated>2019-08-15T17:27:38.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6MJobb6jLAZerJln" /><figcaption>Photo by <a href="https://unsplash.com/@erikkroon?utm_source=medium&amp;utm_medium=referral">Erik Kroon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A FEMA end to end solution for situational awareness project jump-started a daisy-chained workflow that was something to gawk over. In July 2019, we worked with Light Technologies to present a proof of concept regarding a project they’re working on with FEMA (Federal Emergency Management Agency).</p><p><em>Utilizing Yelp data to estimate the number of businesses in a given locality and categorizing them according to FEMA’s seven lifelines</em></p><p><em>Problem Statement: Prior to and during a disaster, it is important to understand the projected and actual effects of the event on the community, including its economic effects on critical services. FEMA has identified seven “lifelines” that require attention during a disaster:</em></p><p><em>· Safety and Security<br>· Food, water, sheltering<br>· </em>Health and Medical<br><em>· Energy (power, fuel)<br>· Communications<br>· Transportation<br>· Hazardous Waste</em></p><p><em>This tool will utilize Yelp to estimate the effects of the event on each of the seven lifelines. This can include the number of businesses or services in each category or even, if available, their status (if provided by users and reviews on Yelp). The tool will search for relevant data and categorize it according to a list of impacted neighborhoods or a list of affected zip codes. It will provide an estimation of the potential impact of the event, at least according to the data available on Yelp.</em></p><p>Above you’ll find the project statement. Seems simple enough. Scrape the web, aggregate the results, and display the results. However, with every simple solution, there is always a different layer that we must explore.</p><p>As we worked on this project, we quickly realized that it was more involved than we previously anticipated. Several days were spent looking through the project requirements and then another few on what the data capture entailed <em>(completed project: presentation, code, &amp; live visualizations are available at the end of this article). </em>None the less, the complexity of the problem likes on the three action item mentioned earlier: scraping the web, aggregating/cleaning the results, and displaying the final data. Let me give you a quick premise on the Lifelines Project.</p><p><strong>Scraping the Web</strong></p><p>During our discovery stage, we learned more about what a FEMA Lifeline is, and it’s corresponding components.</p><p>Lifelines: <em>A lifeline enables the continuous operation of government functions and critical business, and is essential to human health and safety or economic security.</em></p><p>Lifeline Components: <em>Each lifeline is comprised of multiple components and essential elements of information needed to stabilize the incident</em></p><p>Not only did we scrape the web for Lifelines, but primarily they’re corresponding components to get the Lifelines. In total, seven Lifelines were scraped through their 31 corresponding components. A detailed list of components scraped is available in the project repository below. During discovery, we decided to expand our search from Yelp to include Google Places. We utilized both Yelp and Google API’s for our scraping. The Yelp API returned locations with some matching comment on the location contrasting to the Google API, which returned locations regardless of comments or not.</p><p>A complete and detailed description of FEMA Lifelines is found at the link below:</p><p><a href="https://www.fema.gov/media-library-data/1550596598262-99b1671f270c18c934294a449bcca3ce/Tab1b.CommunityLifelinesResponseToolkit_508.pdf">https://www.fema.gov/media-library-data/1550596598262-99b1671f270c18c934294a449bcca3ce/Tab1b.CommunityLifelinesResponseToolkit_508.pdf</a></p><p><strong>Aggregating &amp; Cleaning the Data</strong></p><p>During our discovery period, we did some preliminary Exploratory Data Analysis (E.D.A.) After all, both API’s were excellent and allowed us to capture essential data that was pretty much ready to use. We brought in some sample data and looked through our results. Not much E.D.A was needed as the API’s are pretty well fleshed out.</p><p>Python (&amp; relevant libraries) through Jupyter Notebooks were utilized to scrape, clean, and organize our data. The scraping proved the easiest step, and now our efforts turned to display the data or our results.</p><p><strong>Displaying our findings</strong></p><p>This final step was straight forward. Develop a few useful-looking diagrams along with eye-catching text to grab the viewers attention. However, we decided to take a bit further:</p><p><em>If FEMA needs situational awareness during a given disaster/emergency, they need to enter a location and find all the Lifelines available to the community.</em></p><p>With this in mind, we decided to explore what else we can do with our solution.</p><p><strong>Findings</strong></p><p>We revisited our findings with a different angle. The conclusion was made to design our solution to allow the input of a city; thus, the lifeline components’ location displays immediately afterward. The results are available below.</p><p><strong>Additional</strong></p><p>The final solution came in this form for end-user use:</p><ol><li>Enter a city, st (e.g., Houston, TX)</li><li>View Lifeline Components on the city’s map online</li></ol><p>Entering of target city was done on a local machine w/ scraping and processing of data. Findings (locations tagged with their corresponding lifeline components) were categorized, along with their Long. &amp; Lat., and saved to a Google Sheet. At which point, this same data was connected with Tableau to visualize the results.</p><p>Feel free to play around with our findings at the link below. You may also find the complete project, presentation, and code at the public repository below.</p><p>Visualization: <a href="https://ovrflw.digital/femalifelines/">https://ovrflw.digital/femalifelines/</a></p><p>Github: <a href="https://github.com/adriancampos1/GA_DSI8_FEMA_Lifelines">https://github.com/adriancampos1/GA_DSI8_FEMA_Lifelines</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb3d5cd8311e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>