<?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 William Nicholas on Medium]]></title>
        <description><![CDATA[Stories by William Nicholas on Medium]]></description>
        <link>https://medium.com/@wiljnich?source=rss-6eb1ad52f778------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Fqt6VL-ee72eggv5T9k4sw.jpeg</url>
            <title>Stories by William Nicholas on Medium</title>
            <link>https://medium.com/@wiljnich?source=rss-6eb1ad52f778------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:11:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wiljnich/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[A Beginner’s Guide to Natural Language Processing for the Public Sector]]></title>
            <link>https://medium.com/@wiljnich/a-beginners-guide-to-natural-language-processing-for-the-public-sector-1d45e8e18d7a?source=rss-6eb1ad52f778------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d45e8e18d7a</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[public-policy]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[William Nicholas]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 19:04:28 GMT</pubDate>
            <atom:updated>2020-06-03T19:04:28.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6lUfMNSOywYoyjseLqLK-g.jpeg" /><figcaption><a href="https://pixabay.com/users/geisteskerker-1410564/">Jana Schneider</a> / Pixabay</figcaption></figure><p>The idea of computers understanding the written word is no longer the domain of science fiction or top-secret research laboratories. Natural Language Processing (NLP) has enabled large-scale analysis of everything from <a href="https://www.buzzfeednews.com/article/charliewarzel/these-charts-show-what-facebooks-media-backlash-looks-like">news coverage</a> to <a href="https://devblogs.microsoft.com/cse/2017/12/04/predicting-stock-performance-deep-learning/">stock trading</a>. Advancements in the open-source community have made high-powered tools for text analysis freely available, and these capabilities can empower groups in the public sector to grow their capacity without stretching budgets. Today, I’ll explore a slice of what NLP can offer government workers as well as the major limitations, and explore some case examples.</p><p><strong><em>NLP in a Nutshell</em></strong></p><p>Natural Language Processing refers to a wide range of information analysis techniques employing computing programs to compare and assess human languages. These can be as simple as counting unique words to identify if you’ve truly encountered a new Vronsky family member in this chapter of <em>Anna Karenina</em>, or as complex as <a href="https://automatedinsights.com/white-papers/ap-report-news-automation-and-nlg-increases-trading/">automating the process of writing entirely</a>.</p><p>We’ll explore two forms of NLP that have become most accessible to regular users: sentiment analysis and text classification. In both cases, what has made these tools accessible to the civil service is open-source software packages and self-contained development environments like the Jupyter Notebook. While deploying a robust data science pipeline in your organization requires extensive technical expertise, a great beachhead when demonstrating the value of NLP begins with the ubiquitous Python package <strong>sklearn</strong>.</p><p>Simple starter projects like these can automate complicated tasks, enabling you to spend less time sorting and more time analyzing. For more information on how to introduce these tools to your organization for the first time, check out my post on <a href="https://medium.com/@wiljnich/the-mini-data-lab-building-your-proof-of-concept-for-free-d08db0690290?source=friends_link&amp;sk=27bbde0fa9c2d791e6c513f9901c1d1a">Building Your Proof of Concept for Free</a>.</p><p><strong><em>Sentiment Analysis: A Thermometer for Language</em></strong></p><p>Sentiment analysis is the process of evaluating the emotional impact in words and phrases to develop an estimate of the writer’s sentiment. This can be as lighthearted as <a href="https://medium.com/@wiljnich/the-battle-of-the-bubbles-which-sparkling-water-should-be-your-vanity-post-this-summer-16e02412e1ca?source=friends_link&amp;sk=41fa2547049ae78101cf53d20a07d25f">comparing the popularity of sparkling water brands on Twitter</a> or far more complex. At the <a href="http://policyinnovation.org/">Environmental Policy Innovation Center</a>, we were interested in evaluating public opinion as the EPA considers revisions to the Lead and Copper Rule governing contaminants in drinking water.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*et7JYSgYoJ_4V-txnNEtVA.png" /><figcaption>Evaluating Sentiment Data using Tableau</figcaption></figure><p>In this situation, sentiment analysis presents the opportunity to understand what topics represent the most pressing considerations and to identify areas of discourse that may be hidden among the large volume of comments. For an analysis focused on a single topic, such as this one, significant work is necessary to derive meaningful outcomes. While the number of comments provided to the EPA was sufficiently large, the highly esoteric nature of the topic means that traditional “good or bad” approaches to sentiment analysis are insufficient. As an example, it was important to look beyond subjects like lead exposure due to their ubiquity. We needed to look specifically for discussions about percentiles, changes to the action level, and other issues that didn’t stand out immediately. We’re continuing this work over at <a href="http://policyinnovation.org/">policyinnovation.org</a>, so keep an eye out for our findings.</p><p>There are, of course, other challenges to a successful implementation of sentiment analysis tools in the public sector.</p><p>Michael Livermore at UVA and researchers at FiscalNote <a href="https://scholarship.law.nd.edu/cgi/viewcontent.cgi?article=4771&amp;context=ndlr">describe two main problems</a> in digitally processing public comments at scale: first, the <strong>needle in the haystack</strong> challenge, where agencies cannot find substantive recommendations among less useful comments; second, the <strong>forest-for-the-trees</strong> problem in which clustered topics cannot be readily identified from the large volume of information. Both of these require technical skill and subject matter expertise to overcome, or else you’re left with little more than a list of the top ten words used in your text.</p><p>Sentiment analysis is also limited by the credibility of the underlying text. While Twitter is an popular platform from which to source public opinion data, <a href="https://www.pewresearch.org/internet/2018/04/09/bots-in-the-twittersphere/">a large volume of its user accounts are bots</a>, rather than real people, and this can damage your results.</p><p>Despite these challenges, sentiment analysis presents you with the chance to review large volumes of information extremely quickly. Better understanding of the demands of your constituents enables you to deliver more effective services and secure better public participation.</p><p><strong><em>Text Classification: Categorization at Scale</em></strong></p><p>Language is comprised of an effectively finite number of words, combined into patterns to construct meaning. Using mathematical concepts, these patterns can be analyzed and the contents classified. Several of these concepts, such as <strong>naive Bayes</strong> and <strong>support vector machines (SVM)</strong>, have been implemented in Python’s widely-utilized <strong>sklearn</strong> package. This has enabled broad implementation of basic NLP tasks, like classifying open-ended FOIA requests by the relevant agency</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*-HFrCgLoy_tBB3BGAOkDyg.png" /><figcaption><a href="https://github.com/wiljnich/FOIA-NLP">FOIA NLP on Github</a></figcaption></figure><p>In this example, we’ve used work from <a href="https://www.toptal.com/resume/shanglun-sean-wang">Shanglun Wang</a> to build a simple classification process using data from FOIA requests from federal agencies. To construct our model, I gathered approximately two thousand FOIA requests from federal agencies, and labeled them by their source. Next, I adapted Wang’s classification tool to our data and elected to use the Naive Bayes algorithm.</p><p>Even with just a small sample size and very little data cleansing, this method allows us to predict which agency a FOIA request is intended for nearly 75% of the time. If you wanted, you could improve the accuracy of this tool with additional data, more cleanup work, and by experimenting with other classification techniques like SVM. If you’d like to check out the data yourself, visit my repository on <a href="https://github.com/wiljnich/FOIA-NLP">Github</a>.</p><p>Technology is no substitute for good government, of course, and text classification is not without its limitations. Participatory government should ensure that technology enhances public engagement, rather than automate it, and civil servants should be wary of how solutions like this can <a href="https://www.cigionline.org/articles/artificial-intelligence-could-magnify-social-inequality">unwittingly reinforce racial or socioeconomic disparities</a>. Finally, the technical challenges of scaling and maintaining any NLP project represents a significant demand on talent and resources.</p><p>However, NLP tools that have been effectively designed and implemented present civil servants with the opportunity to do more at lower costs to taxpayers. In addition to sorting records requests, text classification can also be used to <a href="https://medium.com/@nasseri.keyan/using-nlp-to-enrich-findings-in-the-social-sciences-d861b04e6bfb">compare accident reports</a> and <a href="https://blogs.sas.com/content/hiddeninsights/2020/01/28/natural-language-processing-in-local-government/">deliver more targeted services</a>.</p><p><strong><em>What Comes Next?</em></strong></p><p>As NLP tools become increasingly accessible and analysts become more savvy, both sentiment analysis and text classification will find themselves widely employed in the public sector. Once merely the domain of <a href="https://www.semanticscholar.org/paper/Using-Artificial-Intelligence-to-Identify-State-Souza-Coelho/fe632e39a84a4d76ea819f6c49e03e44e856217c">intelligence agencies</a>, NLP stands to bolster the capacity of government organizations at every level.</p><p>If you’d like to learn more about the basics of Natural Language Processing, I recommend <a href="https://www.nltk.org/book/">Natural Language Processing with Python</a> by Steven Bird, Ewan Klein, and Edward Loper, as well as open course material from <a href="https://nlp.stanford.edu/IR-book/">Stanford</a> and <a href="http://people.ischool.berkeley.edu/~dbamman/nlp20.html">UC Berkeley</a>.</p><p>When evaluating your own pilot NLP implementation, focus on a project with a clear problem definition and well-understood data. To identify potential use cases, consider leveraging your organization’s Open Data Portal with a NLP-focused remote hackathon for college students without internships due to COVID-19.</p><p>Today’s governments face a web of challenges that were unimaginable a generation ago. Innovative technologies like NLP will enable civil servants to meet these challenges head on.</p><p><em>I’m a graduate student of public administration at the Indiana University O’Neill School of Public and Environmental Affairs. My work has focused on data science and resource systems analysis in the public sector, and I’m graduating in December 2020. If you’re hiring in the Washington, D.C. area, I’d love to learn more about your organization and how I can help. You can find me on </em><a href="https://www.linkedin.com/in/williamjnicholas"><em>LinkedIn</em></a><em> or view more of my work at </em><a href="http://wiljnich.github.io/"><em>wiljnich.github.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d45e8e18d7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Mini Data Lab: Building Your Proof of Concept For Free]]></title>
            <link>https://medium.com/@wiljnich/the-mini-data-lab-building-your-proof-of-concept-for-free-d08db0690290?source=rss-6eb1ad52f778------2</link>
            <guid isPermaLink="false">https://medium.com/p/d08db0690290</guid>
            <category><![CDATA[public-sector]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[project-management]]></category>
            <dc:creator><![CDATA[William Nicholas]]></dc:creator>
            <pubDate>Tue, 08 Oct 2019 19:29:59 GMT</pubDate>
            <atom:updated>2019-10-08T19:29:59.039Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tkW4QmxNUStiSZ7C" /><figcaption>Photo by <a href="https://unsplash.com/@isaacmsmith?utm_source=medium&amp;utm_medium=referral">Isaac Smith</a></figcaption></figure><p>I’ve written before about <a href="https://medium.com/coprocure/developing-public-data-pipelines-with-python-8a485be1cc85?source=friends_link&amp;sk=e521c16b1d4319f24dc95c6d4397fdc9">utilizing data pipelines</a> to update an outdated or error-prone process, as well as the value of tool sets like <a href="https://medium.com/coprocure/using-r-and-shiny-to-build-interactive-data-driven-web-apps-for-free-d3ad1a0ea351?source=friends_link&amp;sk=dc1495fdb57ca49c752ea03eeb477300">Shiny for R</a> for building fast, free web applications. Deploying these can save your organization time and money, while expanding your capacity without raising the head count.</p><p>This leads to a question: how do you demonstrate the value of an new idea if you don’t have the tech to showcase it?</p><p>Especially in the public sector, there are numerous reasons why you may not have access to the tools necessary to prove out your idea, including cost, existing contracts, or regulatory requirements. In a previous role, my company considered Amazon a direct competitor, sometimes requiring us to get creative to find non-AWS storage and batch processing.</p><p>The best tool for you depends on your use case, but these are some of my favorites for a wide range of projects:</p><p><strong>Scripting Repeatable Tasks</strong></p><p>If you know, you know — winning the U.S. Geological Survey <a href="https://twitter.com/usgsstore">#FreeMapMonday</a> Twitter contest is better than winning the lottery and half as likely. To make sure I’m entered every week, I use <a href="https://www.pythonanywhere.com/">Python Anywhere</a> as a free alternative to AWS Lambda to operate my <a href="https://github.com/wiljnich/USGS-Bot">weekly retweet bot</a>.</p><p>While it’s limited to one free task per account, this is a great option when you’re accessing data from websites that don’t offer an API or ensuring a process runs without manual intervention. If you need to store or update a file that should be remotely accessible to a wider audience, Github offers a raw file link that is easy to pass to an existing script.</p><p><strong>Building and Hosting an App</strong></p><p>If you’re running a generic app, you can’t do much better than Heroku. One of my favorite things about Heroku is the ability to push my code to Github and have the platform automatically build my app at a custom URL. Heroku offers an easier to navigate free tier than AWS, and requires a lot less platform-specific knowledge to operate. I’ve used it here for a <a href="https://glri-projects.herokuapp.com/">portfolio dashboard</a> on Great Lakes Restoration funding, but it can also be used for bulk scripts that are too big for Python Anywhere.</p><p>For those in the public and scientific sectors, R is king. To showcase a new R tool on the web, you can do no better than <a href="https://www.shinyapps.io/">ShinyApps</a>, which offers five free apps per user with custom URLs. Another bonus? You can publish directly to the web from within R Studio. I’ve used it for a multitude of projects, such as a <a href="https://wiljnich.shinyapps.io/GL-Water-Levels/">Great Lakes Water Level tracking app</a>, and love the extensive free tier.</p><p><strong>Documenting Your Work — without SharePoint!</strong></p><p>Emerging processes thrive when they’re well-documented. While Confluence and SharePoint have their value, you may be seeking to embed your documentation alongside your app or break from them entirely.</p><p>One of my favorite mechanisms for quick, easy site building is <a href="https://pages.github.com/">Github Pages</a>. Utilizing a free repository, you can edit your website code with HTML or Markdown before pushing to Github — where Github picks up your files, packages them as a website, and automatically publishes them to a personalized URL. I’m a big fan of Pages, and use it for my <a href="http://wiljnich.github.io/">personal website</a>.</p><p>If you’re looking to keep your documentation alongside the scripts themselves, the <a href="https://jupyter.org/">Jupyter Notebook</a> is a great option. This will enable you to showcase the code you’ve written, the outputs, and all the steps necessary to continue using it when you’re promoted to bigger and better things. I’ve used it to <a href="https://github.com/wiljnich/lmop-data">process and share data for an analysis</a> of the US EPA Landfill Methane program, and have appreciated the simplicity.</p><p>Regardless of what you’re seeking to improve at your organization, there’s no shortage of free resources to test your idea. Whether you’re refreshing a small data source or building the next company-wide app, these free options will get your foot in the door at the next funding meeting.</p><p><em>Disclaimer: I previously worked for Salesforce, the parent company of Heroku and Tableau. I am no longer affiliated with the organization in any capacity, and I do not receive compensation from any company mentioned herein.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d08db0690290" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Battle of the Bubbles: Which Sparkling Water Should Be Your Vanity Post This Summer?]]></title>
            <link>https://medium.com/@wiljnich/the-battle-of-the-bubbles-which-sparkling-water-should-be-your-vanity-post-this-summer-16e02412e1ca?source=rss-6eb1ad52f778------2</link>
            <guid isPermaLink="false">https://medium.com/p/16e02412e1ca</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[William Nicholas]]></dc:creator>
            <pubDate>Wed, 10 Jul 2019 18:40:07 GMT</pubDate>
            <atom:updated>2019-07-10T21:52:20.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8djLpHm7qj-6VjMss-ZFHw.jpeg" /><figcaption>Jens Mortensen / The New York Times</figcaption></figure><p>It has become the drink of choice for millions of Americans — some trying to kick soda, others repatriating their study abroad standby — but the outcome is clear: Sparkling water is here to stay. Like most consumer products, American preferences drive wide variety in the market under a broad number of banners. My clear favorite is the Wegmans store brand Lime Mint flavor — so much so that when I moved from the East Coast for grad school, I filled the back seat of my car with 25 cases. But what if you didn’t care about the taste? What if your only interest was drinking whatever the internet liked the most, and spending the least on it? You’re fortunate, because with a bit of help from <a href="https://www.geeksforgeeks.org/twitter-sentiment-analysis-using-python/">GeeksForGeeks</a>, I’ve answered your question using Tableau, Twitter, and Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwvk1qj62yPZ3zRVgXbvVg.png" /><figcaption><a href="https://public.tableau.com/profile/william.nicholas#!/vizhome/SparklingWaterSentimentAnalysis/Sentimentvs_CostDashboard">Sentiment vs. Cost by William Nicholas</a></figcaption></figure><p>Using the <a href="https://www.tweepy.org/">Tweepy</a> library to access Twitter and <a href="https://textblob.readthedocs.io/en/dev/">TextBlob</a> for NLP, I ran the top 200 tweets containing each major brand through a sentiment analysis, bucketing them into Positive, Neutral, and Negative categories. The chart below compares the relative share of these categories for each brand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uBvJ8UUdUB9eiA8juSg1rw.png" /><figcaption><a href="https://public.tableau.com/profile/william.nicholas#!/vizhome/SparklingWaterSentimentAnalysis/Sentimentvs_CostDashboard">Sentiment Buckets by William Nicholas</a></figcaption></figure><p>From this we can tell a few things: People think Whole Foods is wonderful, and Perrier is passé. But it’s one thing to merely determine broad popularity. How does this data inform our buying decision? We need to know more about the exact details of the sentiment, and compare it to the costs.</p><p>To get the raw sentiment, I again utilized TextBlob to analyze the Twitter library. A sentiment value of zero was neutral, with positive and negative numbers directly correlated to the intensity of the sentiment.</p><p>To gather the pricing data, I recorded the prices at local chain groceries, with Target as a backup for certain national brands. For products not available regionally, I relied on the appropriate store’s website. Costs were adjusted to reflect the total price of twelve 12oz servings in the Midwest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lSj4JXm4ocaAPsjTI0fLCQ.png" /><figcaption><a href="https://public.tableau.com/profile/william.nicholas#!/vizhome/SparklingWaterSentimentAnalysis/Sentimentvs_CostDashboard">Costs and Sentiments Compared by William Nicholas</a></figcaption></figure><p>We can conclude that the pricey Voss brand is worth its cost (nearly $24.00 for twelve servings) in internet affirmation, but some of the fabled European brands that garnered Instagram likes for you in Barcelona won’t cut it here. San Pellegrino was the only brand with a negative sentiment, while Perrier scored an average of zero. While Boston favorite Spindrift is popular on Twitter, if we’re seeking to maximize affirmation as a product of cost, we’ll do better with store brands like Whole Foods or Wegmans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*TdUT8Jj2Umbn9sjiSKJwyQ.png" /><figcaption><a href="http://www.residualthoughts.com/2019/06/17/visualizing-the-strange-world-of-corporate-social-media-accounts/">Corporate Social Media at Residual Thoughts</a></figcaption></figure><p>What is clear is that there’s no strong correlation — yet. Brands have an incentive to leverage the power of social media to drive profits via a dominant Twitter presence that isn’t there yet in the sparkling water sector. For more on the relationship between new-age Twitter accounts and corporate returns, check out Joe Hovde’s work at <a href="http://www.residualthoughts.com/2019/06/17/visualizing-the-strange-world-of-corporate-social-media-accounts/">Residual Thoughts</a>.</p><p>If you’d like to dig into the data more, review the dashboard on <a href="https://public.tableau.com/profile/william.nicholas#!/vizhome/SparklingWaterSentimentAnalysis/Sentimentvs_CostDashboard">Tableau Public</a>. Have a fierce opinion on the subject, or want to run the analysis yourself? Check out my code on <a href="https://github.com/wiljnich/Sparkling-Water-Sentiment-Analysis">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16e02412e1ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing Public Data Pipelines with Python]]></title>
            <link>https://medium.com/@wiljnich/developing-public-data-pipelines-with-python-8a485be1cc85?source=rss-6eb1ad52f778------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a485be1cc85</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[local-government]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[William Nicholas]]></dc:creator>
            <pubDate>Thu, 06 Jun 2019 15:59:14 GMT</pubDate>
            <atom:updated>2021-09-01T18:43:40.863Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJJSAq_x6RDP7qS8-8alaw.png" /></figure><p>Every office has one: a convoluted, multi-stage Excel process to convert a legacy data source into a usable report. It’s usually accompanied by an outdated document that explains what to do, conveniently leaving out all the quirks. These systems rely heavily on an individual analyst’s knowledge of the workbook’s idiosyncrasies, and have countless chances for introducing error.</p><p>How do we ensure that governments are working with the most accurate information, while preserving the low cost that makes Excel so popular? Enter: the data pipeline.</p><p><strong>The Data Pipeline at CoProcure</strong></p><p>At CoProcure, we process tens of thousands of contracts from governments across the United States. Each requires a multitude of data processing steps before it can be found on our search engine. Using the Amazon Web Services (AWS) <a href="https://aws.amazon.com/lambda/">Lambda</a> toolkit, we are able to separate our data pipeline into a variety of smaller, function-specific scripts. Each Lambda is a lightweight portion of code, triggered by an event like an API call or another Lambda, that moves our contracts to the next stage of the process. By structuring our pipeline this way, we reduce the complexity and error that comes with using a monolithic script, while preserving the flexibility to add additional steps.</p><p>To implement these scripts in Python, we leverage the <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">boto3</a> package. This is the official AWS Software Development Kit (SDK) for Python, which enables us to write our output records directly to Amazon’s S3 storage buckets and compare against our DynamoDB database for duplicates. Combining boto3 with the serverless Lambda process ensures that our data pipeline works correctly every time. Users can be notified of errors automatically, preventing flawed data from pervading the rest of the process, and logs can be recorded for review.</p><p><strong>How can local governments leverage data pipelines?</strong></p><p>Imagine never wondering if a <strong><em>critical </em></strong>step was done correctly. That’s what a well-constructed data pipeline offers you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dB31ovPvrnm7e4uT" /><figcaption>Using Lambda, convoluted reports can be broken down into individual scripts to reduce error</figcaption></figure><p>While AWS offers an extensive free tier, costs above that are limited to the computing resources used and can be easily capped. The direct reduction in cost and error, combined with the peace of mind that comes with cloud storage, provides a strong argument to support moving your existing data processing steps to AWS.</p><p>If your organization is a Google or Microsoft client, both companies have similar offerings to Lambda in <a href="https://cloud.google.com/functions/docs/">Google Cloud Functions</a> and <a href="https://azure.microsoft.com/en-us/services/functions/">Azure Functions</a>. For those organizations too small to justify a switch to AWS, or who have specialized data storage regulations, there is a free, in-house alternative: the Jupyter Notebook.</p><p>Imagine a Word document with built-in Python functionality: that’s the Jupyter Notebook. Jupyter Notebooks offer analysts the opportunity to perform each step of data process in a unique block, directly alongside the documentation. For a great explanation of using Jupyter Notebooks to build a repeatable data analysis process, check out <a href="https://pbpython.com/notebook-process.html">Practical Business Python</a>.</p><p>The needs of citizens don’t slow down for bad tools, and regulatory requirements don’t care that Excel is difficult to document. By leveraging data pipeline tools like AWS Lambda or smaller options like Jupyter Notebooks, local governments can ensure that bad data doesn’t hold back important work.</p><p>—</p><p><em>About the author: </em><a href="https://www.linkedin.com/in/williamjnicholas"><em>William Nicholas</em></a><em> is a technical intern at CoProcure and a graduate student at Indiana University’s O’Neill School of Public and Environmental Affairs, where his focus is data science for public administration. Outside of CoProcure, he has worked in data analysis for political media spending, bail reform, and in the private sector.</em></p><p><a href="https://coprocure.us/"><em>CoProcure</em></a><em> is an early-stage, venture-backed startup on a mission to reduce the $300B / year wasted in local public purchasing inefficiencies. Our marketplace of competitively-bid contracts can be reused by government buyers, saving time and money for buyers and reducing the cost of selling to governments for suppliers. Want to learn more? Say hi: </em><a href="/service/mailto:hello@coprocure.us"><em>hello@coprocure.us</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a485be1cc85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using R and Shiny to build interactive, data-driven web apps for free]]></title>
            <link>https://medium.com/@wiljnich/using-r-and-shiny-to-build-interactive-data-driven-web-apps-for-free-d3ad1a0ea351?source=rss-6eb1ad52f778------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3ad1a0ea351</guid>
            <category><![CDATA[government]]></category>
            <category><![CDATA[public-administration]]></category>
            <category><![CDATA[contracting]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[procurement]]></category>
            <dc:creator><![CDATA[William Nicholas]]></dc:creator>
            <pubDate>Tue, 28 May 2019 17:41:26 GMT</pubDate>
            <atom:updated>2019-10-08T19:35:37.062Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-B_EHZ859Zw7rPZ9tK-Vg.png" /></figure><p>Data can enable local governments to be more responsive to their citizens and anticipate challenges in their communities. However, analysts face a persistent restraint: “do more with less.” Analysts must be able to present complex data to a multitude of stakeholders, oftentimes without resources like Tableau or PowerBI.</p><p>At <a href="https://www.coprocure.us/">CoProcure</a>, our emerging data team faced a similar problem. We needed an interactive view of our web traffic, but as a startup we wanted to avoid expensive tools and the complexity of deploying them. Using <a href="https://www.r-project.org/">R</a> and <a href="https://shiny.rstudio.com/">Shiny</a>, we were instead developed an interactive, data-driven web application for free.</p><h3><strong><em>The Use Case: Internal Dashboarding</em></strong></h3><p>CoProcure is built to serve the nearly 90,000 local governments across the United States. Given the scale of our market, web traffic patterns significantly impact the development decisions we make. To effectively understand that traffic, we needed a fast, flexible web application that users across the organization could access. We chose to build this using R, the leading open-source language for statistical computing, and Shiny, the leading R package for building web applications.</p><h3><strong><em>Why R and Shiny?</em></strong></h3><p>When selecting a tool for this project, we first considered the usual suspect: JavaScript. While Javascript would have enabled us to create a dashboard within a traditional web development framework, R provided us with several distinct advantages over JavaScript:</p><h4><em>Shiny makes the app highly flexible</em></h4><p>By developing this tool as a standalone app with Shiny, we can deploy it differently for each audience. Our non-technical staff can quickly review it from a direct link, and it can be simultaneously embedded as part of a larger analytics dashboard for the web team. Given the app’s simplicity, it can also be accessed locally and modified to meet the needs of a particular user.</p><h4><em>R is designed for calculations</em></h4><p>Processing the data in R is faster and easier than in JavaScript. R provides a simpler syntax and is designed for statistical calculation, giving our team the ability to manipulate large volumes of user data with ease.</p><h4><em>R and Shiny reduce organizational overhead</em></h4><p>Shiny applications are small enough to be built and deployed by a single analyst. Because they are independently deployed, they can be modified without downstream impact to dashboard pages. And since the visual elements are embedded as part of the app, rather than defined in the destination, the dashboard can be deployed in an HTML page with a single line of code.</p><h3><strong><em>How can Shiny Apps with R work for government?</em></strong></h3><p>As the audiences for government data grow, governments must match the expectations set by the private sector for data analysis. Being able to deploy timely, interactive snapshots is now a necessity, driven by the popularity of tools like Tableau. R and Shiny give you the tools you need, but without the hassle or the price tag.</p><p>This toolset is fast, flexible, and free. It comes with a much lower organizational overhead than large analytics suites like Tableau, and is in widespread use across governments in the United States. It can be easily embedded in a variety of websites, and the independence of each app means that you can configure options that work for each data source. Open data projects can be shared with the world, while secure records are easily kept internally.</p><h4><strong><em>Shiny Apps with R can help you ensure compliance and beat Excel.</em></strong></h4><p>Using R means each calculation can be reviewed for accuracy. When using Excel, it’s impossible to tell what’s been done to the workbook. Coupled with Shiny’s embedded documentation and logging capabilities, this tool set automates away the error common to Excel processes and ensures your calculations are the same each time.</p><p>While data analysis has long been the domain of expensive tools, R and Shiny provide governments the ability to more rapidly find the answers hidden in their data.</p><p><strong><em>About the author:</em></strong><em> </em><a href="https://www.linkedin.com/in/williamjnicholas/"><em>William Nicholas</em></a><em> is a technical intern at CoProcure and a graduate student at Indiana University’s O’Neill School of Public and Environmental Affairs, where his focus is data science for public administration. Outside of CoProcure, he has worked in data analysis for political media spending, bail reform, and in the private sector.</em></p><p><a href="https://coprocure.us/"><em>CoProcure</em></a><em> is an early-stage, venture-backed startup on a mission to reduce the $300B / year wasted in local public purchasing inefficiencies. Our marketplace of competitively-bid contracts can be reused by government buyers, saving time and money for buyers and reducing the cost of selling to governments for suppliers. Want to learn more? Say hi: </em><a href="/service/mailto:hello@coprocure.us"><em>hello@coprocure.us</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3ad1a0ea351" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tracking Questionable Transactions Using Python & Tableau]]></title>
            <link>https://medium.com/@wiljnich/tracking-questionable-transactions-using-python-tableau-612c8eaa54b2?source=rss-6eb1ad52f778------2</link>
            <guid isPermaLink="false">https://medium.com/p/612c8eaa54b2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[financial-crime]]></category>
            <category><![CDATA[public-administration]]></category>
            <dc:creator><![CDATA[William Nicholas]]></dc:creator>
            <pubDate>Wed, 06 Feb 2019 02:07:34 GMT</pubDate>
            <atom:updated>2019-02-06T19:54:48.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RXWeV2o9HMcT0Zcl" /></figure><p><a href="https://public.tableau.com/views/TrackingQuestionableApp-BasedTransactionsTheCaseofVenmo/TrackingDashboard?:retry=yes&amp;:embed=y&amp;:display_count=yes">Tableau Public</a></p><p><strong><em>Or, how I learned to stop worrying and love the ‘thon.</em></strong></p><p>This is my first public Python project, and it’s based on my personal interest in the investigation of financial crimes &amp; money laundering. As a graduate student in public administration, I’m fascinated by what simple, easy to run tools like Python can do for work like this.</p><p>When pursuing illicit transactions, individuals will be trying to keep their data presence to a minimum. They’ll likely use fake credit cards, and shell companies. They may employ coded transactions hidden within legitimate ledgers. I set out to pick through some data, and see if I could find anomalies using Python and a set of easily-manipulated parameters.</p><p>Here’s a walk-through of what I did. I’d love to hear from those with more experience. As always, I’d love to connect with people in the data analysis and government space. I’m on LinkedIn at <a href="https://www.linkedin.com/in/williamjnicholas">/in/williamjnicholas</a>.</p><p><strong>Generate data</strong></p><p>I started with the tool available on <a href="http://generatedata.com/">generatedata.com</a> to produce a data set with mock credit card numbers, zip codes, company names, a name, and a memo field. Because I wasn’t running the script on a personal server, I was limited to 100 rows at a time, which I merged in the command line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-VoIy_8_33Qu23AFWPv6A.png" /><figcaption>Using the command line to merge the files</figcaption></figure><p><strong>Produce the inputs</strong></p><p>I started by building a dataframe with the input data, and created my flags:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ShJL-LWmD5hdnjCkhmp1TQ.png" /><figcaption>Here are my initial inputs and thresholds</figcaption></figure><p>— People may be intentionally avoiding making payments above $10k, and wanted to look for suspicious values below that. In this case, I set the reporting threshold to $9501</p><p>— Our targets may use code words to distinguish illicit transactions from real ones. In this case, I used a random assortment from Lorem Ipsum, just like the Memo field. Let’s pretend these are eggplant, syringe, and cash emojis</p><p>[‘integer’, ‘orci’, ‘justo’, ‘mattis’, ‘nec’, ‘sollicitudin’, ‘ultrices’, ‘vitae’, ‘enim’]</p><p>— I selected a target area of zip codes to be hypothetically problematic:</p><p>sus_zip = [‘47401’, ‘47402’, ‘47403’, ‘47404’, ‘47405’, ‘47406’, ‘47408’]</p><p><strong>Flag the outliers</strong></p><p>From there, I built dataframes for each of the sources based on the content of each field, and appended the reasoning to a new column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzBbUge1qkHghS6zBenSig.png" /><figcaption>Flagged transactions based on values greater than the reporting threshold ($9501)</figcaption></figure><p>Then I joined the dataframes together to produce a master list of suspicions transactions, and exported it as a CSV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*wD93Sao39qDmeSlnqAv97w.png" /><figcaption>Exporting using the easy “to_csv” capabilities in Pandas</figcaption></figure><p><strong>Present findings</strong></p><p>Finally, I threw the data into Tableau to produce a quick visualization to highlight the data by time and location. Take a look, and please share your thoughts!</p><p><a href="https://public.tableau.com/views/TrackingQuestionableApp-BasedTransactionsTheCaseofVenmo/TrackingDashboard?:retry=yes&amp;:embed=y&amp;:display_count=yes">Tableau Public</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=612c8eaa54b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>