<?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 Harrison Hardin on Medium]]></title>
        <description><![CDATA[Stories by Harrison Hardin on Medium]]></description>
        <link>https://medium.com/@harrison.hardin?source=rss-4ec2049b428f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kFhRVKqVvJcCChhDNvSmVg@2x.jpeg</url>
            <title>Stories by Harrison Hardin on Medium</title>
            <link>https://medium.com/@harrison.hardin?source=rss-4ec2049b428f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 17:37:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harrison.hardin/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[VI. Realism, Data Crimes and Next Steps]]></title>
            <link>https://medium.com/swlh/vi-realism-data-crimes-and-next-steps-2e257913a02b?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e257913a02b</guid>
            <category><![CDATA[advice]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Tue, 20 Aug 2019 15:49:42 GMT</pubDate>
            <atom:updated>2019-08-20T16:02:00.299Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>If one would give me six lines written by the hand of the most honest man, I would find something in them to have him hanged. -Cardinal Richelieu</blockquote><p>I have talked about data privacy in almost every conceivable context in this series. Is greater security worth the tradeoff required by surveillance capitalism? On a macro level, a product in Alphabet’s portfolio like G board is helping advance our ability to do Natural Language Processing as a society, feeding what it learns from you into this area of Machine Learning and benefitting us all with better predictions on how words fit together. On a micro level, you benefit via better user experience in G board’s ability to fill in what you are trying to say before you even try to say it, speeding up your typing. Track people long enough, and you’ll find your ability to sell incredibly specific information to the highest bidder increases substantially, be they advertisers or rogue political research firms. But beyond the prying entrance of eerie ultra-specific ad targeting into your individual life from the odd Google search is the effect of kingmakers being able to use compiled micro knowledge to macro effect, and sway our elections. We’re in the midst of an attempt to amplify control to unprecedented and dangerous levels, at the expense of liberty.</p><p>The fourth installment of this series revealed some of the close ties Google has to government entities in the US, organizations that set out to promote the wellbeing of its citizens. With a lot of its services, Alphabet does just that, actually improving lives not only within the US itself but in all the world’s countries. The goodwill towards humankind isn’t so utopian that it doesn’t take account of adversaries or even friendly countries which can be trying to gain our intellectual property, like our francophone allies across the sea. We heavily favor countries that comprise what’s known as the Five Eyes, and rightfully so. This is a special relationship that evolved from the same British and U.S. cipher and code-breaking teams that cracked Enigma in World War II, made up of five English-speaking allies which also include Australia, New Zealand and Canada. The willingness to share intelligence and techniques for gathering it is out of self-interest. But can this self-interest go so far as to become counter-productive when privacy isn’t respected?</p><p>The military-industrial-google complex and I both believe in a theory in International Relations known as Realism, which maintains that power is the only thing that truly matters. The Five Eyes using its capabilities against other countries, under Realism, is its prerogative, as there is nothing powerful enough to dissuade it from doing so. It has done just that, to individual citizens inside and outside itself.</p><p>Surveilling a single woman in Germany is well within the acceptable bounds of the Five Eyes’ purview. And that is exactly what happened; details of her private life were pored over by unwelcome guests, as so many East German mercenaries did in service to The Iron Curtain, stealing themselves into the lives of others? Moving up through levels of analysis, what would it take for the balance of power to shift in order to longer be favorable to justify the Five Eyes’ prying? Even if all the people in the local <em>Stadtstaaten </em>(“city-state”) of Berlin were surveilled, it could be justified. Next in the land area state (“<em>Flächenländer”) </em>of Brandenburg, then on to all 16 federated states of the German Republic, it could still be justified. If pushed further, though, the ability of power to justify itself starts to be called into question. If all citizens of the EU were included in this dragnet, the realpolitikal value of such an action is not worth the cost. It could be leveraged by China, Russia, and/or the Middle East to go against the countries which make up the anglophone world. Why should I, as a person living and benefitting from the Five Eyes’ protection care about what’s happening way over in Germany? Isn’t it in our best interest as a country to be as vigilant as possible, even if that means a little spying? <strong>No.</strong></p><p>The particular woman in question here isn’t just any Berliner, or Brandenburger, or citizen of Germany. She happens to be widely described as the most powerful woman in the world, and increasingly the leader of the free world in the wake of Trump. What our country did when (as the most powerful member of the Five Eyes) it acted for the rest of the group and was outed for wiretapping Angela Merkel has been toxic to our international image. The cost to our reputation was the equivalent of wiretapping every citizen in the EU. Even to advocates for security, any potential advantage mustered from pushing surveillance to such an extreme is outweighed in an even more extreme way by the shift in our standing with our NATO allies. Trust will need to be built back up. But for now let’s restrict ourselves in our analysis to the domestic affairs of just the two original members of the special relationship, the UK and US.</p><p>The $5 billion the FTC fined Facebook reflects a growing discontent for one Silicon Valley behemoth’s repeated privacy trespasses against us. What’s the damage of such practices beyond monetary settlements? What were the specifics of the case, and how do they tie into our staunchest ally?</p><p>Across the Atlantic, the chicken that came before the egg was Nigel Farage and the Brexit campaign. Despite efforts to do away with damning evidence, it emerged from emails and whistleblowers that Cambridge Analytica put its Data Science muscle into sealing the UK’s fate to shoot itself in the foot.</p><p>A third party app promising a fun way to predict your personality was behind the gathering of tens of millions of users’ data that was funneled into the political research firm Cambridge Analytica, based in the UK but named by its Vice President, Steve Bannon.</p><p>The Trump campaign’s digital arm was known as Project Alamo, and it demonstrated through its use of Cambridge Analytica the raw power of Data Science. This UK consulting firm claimed to have 5000 data point on every American voter (more than 328 million people), via a personality survey on Facebook which was hidden in plain view as a fun pop quiz. “The One Click Personality Test” didn’t only take your data, it took all the data from your entire friend network with no permission. This involved neither consent nor awareness of what the data would be used for, and the case itself cites 87 million users affected. Data accessed from the ‘quiz’ reached beyond public information into private messages. Personality types in swing states which were categorized as being more persuadable were targeted, as a hypnotist does when picking which volunteers to include in the show, basing the selection on the enthusiasm with which they’re waving their arms. Trump’s campaign had 5.9 million well-targeted facebook ads, masterminded by Data Scientist Brad Parscald, while Hillary’s had only 66K. This targetting of voters’ suggestibility effectively made Parscald a kingmaker in the 2016 elections. Although he is returning to head up Trump’s 2020 campaign, the Democrats are sure to prioritize such targetting in the future.</p><p>Other than surreptitious fad apps and quizzes, the other main way to mine data is known as web scraping. It is an ethical gray area, but is one of the main tools used by groups like Cambridge Analytica to weaponized your data. They were truly the architects of Brexit, therefore, the era of Trump, therefore the current strong global push towards far-right populism, Jingoism and Xenophobia. As bad as the situation is in the US and UK, perhaps the worst instance of data crime occurred in Myanmar, where a massacre was facilitated by fake news spread by WhatsApp (Facebook). There is blood on the hands of technology companies that have grown too powerful to go unchecked and unregulated.</p><p>How can we fight back? Can you reclaim your own identity? From a societal perspective (that is to say, the society of the author), the Western Alliance? This too shall pass, and what happens next is for chance to decide. To protect your privacy and improve your chances in the new reality, wake up! Take into consideration the following pieces of advice:</p><ul><li>Don’t blindly click user agreements, they have consequences. So does putting your data out in the ether. You’ll be ahead of most by carefully reviewing each before proceeding to use the service. Although South Park once famously made fun of its terms of service agreement, Apple seems to be doing better than other companies when it comes to respecting privacy. Speaking at a conference of EU privacy commissioners in Brussels, Tim Cook put in a bid for a bill of U.S. digital rights, arguing for GDPR-style privacy protection in every state, not just California. He slammed competitors (read: Facebook, Alphabet) for profiting while unleashing powerfully negative forces onto the world.</li></ul><blockquote>“It is time for the rest of the world — including my home country — to follow your lead.”</blockquote><ul><li>Always think critically. Be skeptical, not cynical. Google can and should be criticized for its leviathan status, but also consider the source when you have a story with a headline like <a href="https://www.wsj.com/articles/trump-signals-scrutiny-of-googles-ties-with-china-after-thiel-comments-11563285110">this</a>. Peter Thiel called for the investigation because he claims Google is working with China’s government instead of the U.S. military. He has Trump’s favor, as an early supporter of him, and built a fortune with PayPal. But Thiel is also behind Palantir, a lesser-known company that specializes in government and corporate big data analytics. So always consider the source and remember to dig deeper: Thiel is acting in self-interest and leveraging his position with the president against a direct competitor that was attacked by China during the “Operation Aurora” incident of 2010 discussed in part IV.</li></ul><p>What are some ways to address this issue of data privacy, as an individual? Some quick remedies are using a search engine like DuckDuckGo instead of Google, and realizing the costs associated with Facebook, as well as Amazon and Microsoft. What about data on how private your data is? A metric? It turns out the topic of this series, data privacy, can be measured scientifically. There are a few ways in development, and I will make note of two: Private Aggregation of Teacher Ensembles, <a href="http://www.cleverhans.io/privacy/2018/04/29/privacy-and-machine-learning.html">PATE</a>, an approach that achieves private learning by carefully coordinating the activity of several different ML models, and Differentially Private Stochastic Gradient Descent (<a href="https://github.com/tensorflow/privacy/blob/master/tutorials/walkthrough/walkthrough.md">DP-SGD</a>). This second approach is basically a procedure where a batch of data is randomly sampled and iterated through until the entire batch has been processed. Domain knowledge of Machine Learning algorithms is needed, as well as TensorFlow and Keras, but for those who really want to take privacy up a notch, this is recommended reading.</p><p>What are some ways to approach the issue as a society? The NSA later this year will further consolidate its offensive and defensive capabilities into a new cybersecurity directorate. It is adopting a strategy of “persistent engagement” in cyberspace against foreign adversaries including Russia, China and Iran. Laudable goals, but its track record of turning the military-industrial complex inward instead of outward necessitates the creation of an agency that could serve as a foil. A Data Protection Agency. The FTC helps to safeguard consumers and promote competition, but until recently failed to enforce many of the orders it established. The DPA would focus on privacy protection, compliance with data protection obligations, and emerging privacy challenges. It would address specific issues raised in this series in the following ways:</p><ol><li>Enact baseline federal legislation to bring all 50 states’ data rights to a level comparable to that seen in California, while still respecting that each state and often each city in a state have slight variations in how they approach data.</li><li>Impose obligations for companies that collect personal information to have greater transparency, purpose specification and use limitation of data.</li><li>Prohibit or do more to prevent manipulative marketing practices.</li><li>Allow individuals more meaningful control of their personal data by requiring companies to move away from all-or-nothing terms of service which impose a binary of either waiving privacy rights or not using the product.</li><li>The consolidation of personal data within a small group of firms has stifled innovation and competition. The DPA and other antitrust enforcers in the US should prioritize privacy interests in merger review, incentivizing privacy by design.</li><li>Any reasonable citizen would not object to the disclosure of specific records that are required for legitimate criminal investigations and obtained through an appropriate judicial procedure, but US companies should not disclose user data in bulk to government agencies.</li></ol><p>The only way to truly opt-out of having your data mined is to become a Luddite. Regulation promises to tame the Wild West of Data. But just as stating the Western part of the United States was “tamed” over the last 200 years is highly loaded, what is becoming the new reality of technology is open to interpretation. Our “manifest destiny” is to continue pushing the boundaries of what Data Science is capable of, as it continues to oscillate like a pendulum between privacy and security, liberty and control, good and evil. The players will continue to play this new game of ours, but there need to be referees on the field.</p><p>Should you wish to support public-interest technology, groups such as the <a href="https://www.eff.org/">Electronic Frontier Foundation</a> and <a href="https://www.epic.org/">EPIC</a> are a great place to start.</p><p><strong>Works Consulted:</strong></p><p><a href="https://www.computerworld.com/article/3315623/complete-transcript-video-of-apple-ceo-tim-cooks-eu-privacy-speech.html">Complete Transcript, Video of Apple CEO Tim Cook’s EU Privacy Speech</a></p><p><a href="https://www.epic.org/testimony/congress/EPIC-SCOM-ConsumerPerspectives-Apr2019.pdf">Consumer Perspectives: Policy Principles for a Federal Data Privacy Framework</a></p><p><a href="https://www.wsj.com/articles/nsa-forms-cybersecurity-directorate-under-more-assertive-u-s-effort-11563876005">NSA Forms Cybersecurity Directorate Under More Assertive U.S. Effort</a></p><p><a href="https://arxiv.org/pdf/1808.06651v1.pdf">Privacy Amplification by Iteration</a></p><p><a href="https://arxiv.org/pdf/1610.05755.pdf">Semi-Supervised Knowledge Transfer For Deep Learning From Private Training Data</a></p><p><a href="https://www.wsj.com/articles/trump-signals-scrutiny-of-googles-ties-with-china-after-thiel-comments-11563285110">Trump Targets Google’s China Ties, Citing Billionaire Investor Peter Thiel</a></p><p><a href="https://www.thegreathack.com/">https://www.thegreathack.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e257913a02b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/vi-realism-data-crimes-and-next-steps-2e257913a02b">VI. Realism, Data Crimes and Next Steps</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[V. Standard Data]]></title>
            <link>https://medium.com/swlh/v-standard-data-c54db90ee543?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c54db90ee543</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 00:26:03 GMT</pubDate>
            <atom:updated>2019-08-20T15:57:33.851Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Look how revealing Mark Zuckerberg is not, on his own Facebook page. -Robert Ellis Smith</blockquote><p>Why are the children of Silicon Valley executives often not allowed to use the very technology their parents have so successfully marketed to the world? In the attention economy that is emerging, the company that dominates your focus for the longest will be the most successful. It’s Not In My BackYard-ism for the 21st century, in which the detrimental effect technology has on the attention span is noted by only a select few. Whatever happened to standing behind your product? The president of the Electronic Privacy Information Center (EPIC), Marc Rotenberg, states: “It’s not clear why a company that has asked us to give up so much privacy should be allowed to maintain so much secrecy.”</p><p>It would appear the dam of hypocrisy is starting to crack here. The second section of this series already brought up the landmark settlement against Facebook, but let’s revisit it. In the past, Mr. Zuckerberg has sued to keep information about his career secret in Massachusetts. Now, in the FTC order, “Mr. Zuckerberg will be held accountable for certifying quarterly — under threat of civil and criminal penalties — that the company’s privacy program is in compliance.” Among the specifics this case addresses are:</p><ul><li>Facebook must report to the FTC within 30 days incidents where data of 500 or more users have been compromised, along with the company’s efforts to address the problems.</li><li>It must also increase oversight of third-party apps, including by terminating developers that fail to certify they are in compliance with Facebook’s platform policies or fail to justify their need for specific user data.</li></ul><p>This sharp turn towards privacy reflects a sea change in how we use technology and how it uses us.</p><p>You shouldn’t have to opt-out of getting taken advantage of, but too often this is baked-in to the business model of companies that claim to disrupt the traditional order. The FTC decision on Facebook is a victory against Standard Data and towards more robust digital security, but don’t let your guard down.</p><p>In an opinion <a href="https://www.wired.com/story/i-scraped-millions-of-venmo-payments-your-data-is-at-risk/">piece</a> written recently for Wired, author Dan Salmon discusses how with 20 lines of Python code he could access 115,000 public transactions per day on Venmo. It reveals if you are using Android or iPhone to access its services, which aim to disrupt the traditional bank industry. By changing your privacy settings to private you can protect yourself against potential bad actors, but the fact that you must manually opt-in to this reveals the tech sector continues to make it painfully clear that if you’re not paying for the product, <strong>you</strong> are the product, providing your valuable information for free.</p><p>Privacy in the context of antitrust law is clearly becoming an area of focus on either side of the Atlantic. A quick history of some merger decisions made by the EU’s European Commission and the FTC in the US may provide some context. The FTC <a href="https://www.ftc.gov/system/files/documents/public_statements/418081/071220googledc-commstmt.pdf">greenlit</a> a merger between Google and DoubleClick a little over 10 years ago, despite objections from EPIC and even the FTC Commissioner herself.</p><p>As these 2010 Justice Department <a href="https://www.justice.gov/atr/horizontal-merger-guidelines-08192010#6">guidelines</a> make clear, merger reviews can take into account many dimensions of competition including innovation, product quality, and product variety in determining whether a lessening of competition in these areas will harm consumers, but privacy is notably missing from these guidelines. Companies could compete on privacy in any number of ways: providing clearer, easier to read descriptions of their data collection practices, allowing choice about data use in a wider range of circumstances, adjusting the choice architecture to provide for opt-in rather than opt-out choice, allowing secondary use only with affirmative opt-in consent, not sharing customer data for third-party marketing, minimizing the data collected and discarding it after its initial use.</p><p>The European Commission approved the Facebook Messenger and WhatsApp merger in 2014 stating there simply wasn’t evidence at the time that consumers chose their communications app on the basis of the privacy. However, WhatsApp’s pro-privacy practices have largely been replaced with the data mining typical of the rest of the Facebook family. Two years later they also approved the merger between Microsoft and LinkedIn, but, unlike in the Facebook case, the Commission concluded that privacy was “an important parameter of competition and driver of customer choice in the market.” LinkedIn’s professional social network competitor in Germany and Austria, Xing, provided opt-in choice for data sharing while LinkedIn offered the less protective opt-out choice, and so approval of the merger was conditioned on Microsoft restricting their conduct in connection with integrating and preinstalling the LinkedIn app.</p><p>This trend towards respecting privacy has continued in Europe, and the <strong>General Data Protection Regulation (</strong>GDPR) was adopted that same year, becoming enforceable on the 25th of May, 2018. The US needs a national privacy law. However good the California Consumer Privacy Act is, addressing privacy issues on a state level causes fragmentation and confusion.</p><p>The tide appears to be turning against Standard Data in the EU now via antitrust fines that continue to be levied by the European Commission and specifically its current commissioner, Margrethe Vestager. She’s just been voted to a senior position inside Europe’s top antitrust enforcer for the next five years and will likely do a lot to shape competition on the far side of the Pond. On this side of the Atlantic, too, sentiments are turning to thoughts of trustbusting Standard Data, across the aisle. This is as true with Democratic hopefuls like Senator Elizabeth Warren as it is with the incumbent on the right, President Trump.</p><p>The EU has led the antitrust charge against Google/Alphabet for more than a decade, issuing fines totaling more than $9.25 billion. In addition to the Google cases, Margrethe Vestager has also issued a fine retroactively to Facebook for misleading regulators in 2014 in the WhatsApp merger and ordered Amazon and Apple to pay back taxes under what she alleged to be <a href="https://www.wsj.com/articles/eu-orders-luxembourg-to-recoup-almost-300-million-from-amazon-1507109839?mod=article_inline">sweetheart deals with tax authorities</a>. Antitrust scrutiny of technology titans continues to rise in the US, with the FTC and Justice Department dividing up oversight of four of the largest (Amazon, Google, Facebook and Apple). Warren has proposed breaking Amazon up and unwinding its Whole Foods acquisition. She also wants to examine Facebook’s market power, a position recently backed by one of the social-media giant’s co-founders, Chris Hughes. Trump has stated that Amazon should pay more in taxes and criticized the company’s effects on competitors.</p><p>I would like to bring up an instance of just how much reach tech giants have, and just how necessary busting the new trusts is. The pro-privacy think tank EPIC’s website is replete with useful resources, but the irony of navigating on the <a href="https://www.epic.org/">website</a> from Our Work &gt; Privacy Campaigns &gt; Internet Privacy is worth highlighting. Below an infographic and blog post travailing the overreaches of Google and Facebook, a couple of badges appear at the bottom of the page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*UHGLJ8kf-KEqU4E7baE19A.png" /><figcaption>Isn’t it ironic? Don’t you think?</figcaption></figure><p>The big-ticket fine of $5 billion leveled against the successor of MySpace by the FTC is unlikely to satisfy Facebook’s staunchest critics, much as multibillion-dollar penalties against big banks after the 2008 financial crisis did little to reduce anger at Wall Street. The dollar amount obtained in this case is a financial penalty higher than what the European Union could have sought under its privacy law and is more than merely a symbolic gesture. Fiscally symbolic but lexically momentous, the UK’s Information Commissioner’s Office gave Facebook its “maximum penalty” of about $645,000.</p><p>Going forward, what are some privacy best-practices? The last part of this series will explore this in-depth. In brief, be skeptical of the seemingly innocuous. As a lead in to the last section, beware fads like FaceApp might store an ageified picture of you in the cloud indefinitely, and as a Russian company it isn’t a huge leap to suspect the man who developed the term “super-presidentialism” to describe his autocracy and pacify the more Chamberlain-esque among us is applying his former KGB training to its modern-day equivalent, the FSB, in yet another ploy to destabilize Democracy: facial recognition databases. Peace for our time? False pretenses abound. <strong>Don’t give your data to anyone you don’t trust.</strong></p><p><a href="https://medium.com/@harrison.hardin/vi-realism-data-crimes-and-next-steps-2e257913a02b">Part VI</a></p><p><strong>Works Consulted:</strong></p><p><a href="https://www.wsj.com/articles/amazon-to-overhaul-marketplace-terms-as-part-of-german-settlement-11563353036">Amazon Faces Probe in Europe Over Use of Merchant Data</a></p><p><a href="https://www.cio.com/article/3408016/antitrust-enforcers-can-think-of-privacy-as-a-parameter-of-competition.html">Antitrust Enforcers Can Think of Privacy as a Parameter of Competition</a>.</p><p><a href="https://www.wordstream.com/articles/google-privacy-internet-privacy">Do You Know Who’s Watching You?</a></p><p><a href="https://www.wsj.com/articles/facebook-agrees-to-pay-5-billion-in-ftc-settlement-11563971400">Facebook Agrees to Pay $5 Billion in FTC Settlement</a></p><p><a href="https://www.wired.com/story/i-scraped-millions-of-venmo-payments-your-data-is-at-risk/">I Scrapped Millions of Venmo Payments. Your Data is at Risk</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c54db90ee543" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/v-standard-data-c54db90ee543">V. Standard Data</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IV. Google Government]]></title>
            <link>https://medium.com/swlh/iv-google-government-1768f5c63e23?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1768f5c63e23</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[surveillance]]></category>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Thu, 15 Aug 2019 00:59:38 GMT</pubDate>
            <atom:updated>2019-08-20T15:56:05.011Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Quis custodiet custodes ipsos (who watches the watchers)?</blockquote><p>In part II, I held Alphabet’s arm up and rang the bell, declaring it the winner of the “Map Wars” with its acquisition of Waze taken together with the already entrenched success of Google Maps. The world learned a lot in the year 2013, and one of those things is that the real winners of geo-locational services are forces at the helm of the military-industrial complex. As the world’s sole remaining superpower, the US government is the expert in winning any type of war. This piece will venture into this complex fog, where it turns out Alphabet remains the World Champ, more tied in with Top Dog than we ever realized. Business and government intertwine and paint a picture that is perhaps more complicated than a dichotomy between privacy and security, allies and adversaries. The truth is always somewhere in between.</p><p>Former Google Chief Executive <a href="http://gawker.com/5419271/google-ceo-secrets-are-for-filthy-people">Eric Schmidt has stated</a> in an interview, “If you have something that you don’t want anyone to know, maybe you shouldn’t be doing it in the first place.” One might retort, “Because the government gets to define what’s wrong, and they keep changing the definition.”</p><p>As Google increasingly came to dominate the consumer internet in the early 2000s, a different side of the company picked up momentum in the shadows: Google Government. It turns out that the same platforms and services Google uses to monitor people’s lives and mine their data can be deployed to run huge swaths of the authorities that rule over our land, including the military, spy agencies and police departments. At the peak of the first big tech boom, the CIA launched something called In-Q-Tel, a Bay Area venture capital fund whose mission it was to invest in start-ups that aligned with the agency’s intelligence needs. A company called Keyhole would be saved from bankruptcy just as the dot-com bubble burst when the CIA poured an unknown amount of money into it, partnering with the National Geospatial-Intelligence Agency, a major intelligence organization whose job was to deliver satellite-based intelligence to the Pentagon. In 2004, the same year Google went public, the Mountain View monolith bought Keyhole outright, CIA investors and all. It then absorbed the company into Google’s growing internet applications platform. Keyhole was transformed and reborn as Google Earth.</p><p>An analysis of the federal contracting database maintained by the US government, combined with information gleaned from Freedom of Information Act requests and published reports on the company’s military work, reveals that Google has been doing brisk business selling Google Search, Google Earth and Google Enterprise (known as G Suite) products to just about every major military and intelligence agency. In 2003, it scored a 2.1 million dollar contract to outfit the National Security Agency with a customized search solution that could scan and recognize millions of documents Sometimes Google sells directly to the government, but it also works with established contractors like Lockheed Martin and the Science Applications International Corporation, a California-based intelligence contractor known as “NSA West,” thanks to the fact that many of its employees formerly worked at NSA East (the original).</p><p>In 2010, following a disastrous intrusion into its system by what the company believes was a group of Chinese government hackers (an event that has been dubbed “Operation Aurora”), Google entered into an additional secretive agreement with the NSA on top of the one it had signed 7 years before. Defense reporter Shane Harris writes in his book @War, “According to officials who were privy to the details of Google’s arrangements with the NSA, the company agreed to provide information about traffic on its networks in exchange for intelligence from the NSA about what it knew of foreign hackers. It was a quid pro quo, information for information. And from the NSA’s perspective, information in exchange for protection.” Chinese Intellectual Property theft has been in the news again recently in the case of Huawei’s CEO being detained in North America after it appears spying capabilities have been hardcoded into the company’s phones and 5G network.</p><p>Our intelligence services gather billions of individual pieces of data every day. Almost all of the dots don’t connect. This dredging of so much information suffers from the curse of dimensionality. Often the fact that we are able to successfully spy on someone is a bigger secret than the information we learn from that spying. During World War II, the British were able to break the Enigma encryption machine and eavesdrop on German military communications. However, the Allies could only act on information they learned when there was another plausible way they would have learned it. They even occasionally manufactured plausible explanations. It wasn’t worth the risk of tipping the Germans off that their encryption machines’ code had been broken. The NSA’s belief that more data is better, and that it’s worth doing anything in order to collect it, is flawed: there are diminishing returns. The Boston marathon bomber left a flagrantly obvious trail of red flags that weren’t picked up on. In Data Science, when you are studying a dataset with too many features, you need to perform what’s called a Principal Component Analysis, and perhaps a similar sort of adjustment would cause fewer occurrences like what happened in Parkland and Las Vegas.</p><p>Another famous instance of security at the expense of privacy was the occurrences at San Bernadino and the standoff between the FBI and Apple. The graph below indicates surprisingly strong support for giving up autonomy to feel safe, but the publicity of this case belies the power that the government truly has. Apple still stands out for its tendency to respect privacy, a trend which will be revisited in the next installment in this series.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*wndshVQCpQSuPraUJW-6_w.png" /></figure><p>The technology beneath the hood of many other internet companies hide vast systems of private surveillance that work with and empower the state, and that might not be as bad of a thing as it sounds. We have been lied to over and over, to the point of becoming numb to the grey workings of the government and technology companies that represent us. Yes, government agencies cloak programs in multiple code names to obscure their full extent and capabilities, just as for-profit businesses will nest themselves in as many Matryoshka doll shells as required to minimize the tax levied against them. This is embedded in the very nature of government, or business (or both at once!). We’re being played, but we’re being played in a way that isn’t utterly inimical to our existence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6yMxO3AneIL2Eo2FA3IBKg.png" /><figcaption>NSA Surveillance Heatmap (Red = Most)</figcaption></figure><p>In the aftermath of the Cold War, it is shocking that we surveil our own country more than the former USSR. Other adversaries, like Iran, are understandably red hot with surveillance. The map above is from 2007, and since that time the world’s first digital weapon, Stuxnet, was deployed, and tensions have only continued to build around the Strait of Hormuz. However, attempts at data acquisition on the national level are not just something that occurs between adversaries. For all the solidarity we expressed to our longtime defensive allies in the aftermath of the Charlie Hebdo shooting and massacre in Paris, we shouldn’t be so naive as to let our economic guard down: a look into French industrial espionage in the US is the first item linked below. We are allies in defense but economic competitors. Notably, in Europe, Germany has been subjected to not insignificant amounts of surveillance. In part VI, the unintended consequences of such snooping will be examined in greater detail.</p><p><a href="https://medium.com/swlh/v-standard-data-c54db90ee543">Part V</a></p><p><strong>Works Consulted:</strong></p><p><a href="https://www.hanford.gov/files.cfm/frenchesp.pdf">A Case Study in French Espionage: Renaissance Software</a></p><p><a href="https://www.theguardian.com/news/2018/dec/20/googles-earth-how-the-tech-giant-is-helping-the-state-spy-on-us">Google’s Earth: How the Tech Giant is Helping the State Spy On Us</a></p><p><a href="https://www.theatlantic.com/politics/archive/2013/12/how-americans-were-deceived-about-cell-phone-location-data/282239/">How Americans Were Deceived About Cell-Phone Location Data</a></p><p><a href="https://www.schneier.com/essays/archives/2014/01/how_the_nsa_threaten.html">How the NSA Threatens National Security</a></p><p><a href="https://www.schneier.com/essays/archives/2006/05/the_eternal_value_of.html">The Eternal Value of Privacy</a></p><p><a href="https://www.schneier.com/blog/archives/2013/09/the_limitations.html">The Limitations of Intelligence</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1768f5c63e23" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/iv-google-government-1768f5c63e23">IV. Google Government</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[III. The United States of Privacy]]></title>
            <link>https://medium.com/swlh/iii-the-united-states-of-privacy-2b18b5144268?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b18b5144268</guid>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[charity]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Thu, 08 Aug 2019 01:17:58 GMT</pubDate>
            <atom:updated>2019-08-15T01:04:48.097Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Alas, poor Yorick! I knew him, Horatio: a fellow<br>of infinite jest…</blockquote><p>When data is conglomerated on levels beyond the personally identifiable, it can take on a different significance. This new inflection of meaning can even be altruistic, or at least be less foreboding than the somewhat dystopian conversation of privacy violations exacted in exchange for a greater sense of security that characterizes this series. Even in his darkest tragedies, Shakespeare included some amount of comic relief, so let’s bathe for a moment in the glow of local charity. But we won’t dwell in the oasis so long as to lose track of the huge column of granite-grey smoke emanating from our privacy rights burning in the distance. It’s not a mirage.</p><p>In this section, the conversation will venture into the province of how data gathered on the local level compares, first across a few different cities then on to the state level. Through this comparison, the data will indicate which state objectively ranks as the best example or model going forward for the other 49.</p><p>I would like to comment directly on some data privacy trends I noticed while completing work on some recent coding projects. During my time in the Data Science intensive program at The Flatiron School, I used several datasets at the city and state level sourced from different areas of the country and noticed some interesting distinctions. Some of the research involved housing data around places like <a href="https://www.kaggle.com/c/boston-housing">Boston</a> and <a href="https://www.kaggle.com/harlfoxem/housesalesprediction">Seattle</a>, and subsequently I was curious to discover that my home state of Texas is one of fewer than 10 states that keep real estate sale prices private (A range of prices is allowed to be made public, but not a specific sales price). Some of the code for my work examining real estate metrics through the lens of Time Series and Regression analysis from sources like Zillow can be found hosted on Github <a href="https://github.com/lindseyberlin/dsc-mod-4-project">here</a> and <a href="https://github.com/harrisonhardin/RegressionModelOfKingCountyHousingDataset">here</a>. I noted trends in cities like New York are perhaps towards greater <a href="https://data.ny.gov/">data openness</a>, where all Taxi ride and subway turnstile information is released in an effort to optimize the future of various facets of life, with the understanding that the individual data about rides in the cabs and subways in the past would be revealed (although not personally identifiable). The tradeoff between privacy and benefit to society creates a new angle to view what is being discussed.</p><p>The oasis I refer to in the first paragraph is another detour into personal anecdote relating to Texas. During the completion of the coding program in Houston, my cohort was visited by Dr. Neeraj Tandor of <a href="https://www.januaryadvisors.com/">January Advisors</a> for a presentation on how Data Science can be used for local charity. This paints a more complex picture of data usage in one of Texas’ major cities and reveals that each state is complicated in how it approaches its use of data. In spite of Texas’ statewide inclination to restrict real estate information, Houston was blazing a path forward in data openness and philanthropy in a bid to rival aforementioned cities in the northeast and northwest of the country. Dr. Tandor shared with us several ways that his group was working with the City to streamline philanthropic information and databases. A concrete example of Data Science benefitting society was how his group was working with Houston to document the myriad charitable organizations’ efforts to provide aid to the homeless population by keeping track of which charity had already worked with which affected individual, and what service had been provided. This increased efficiency and reduced unnecessary overlap of services.</p><p>This starts to fill in the complex picture of how data privacy is being used on the local level in a handful of states. What about in all of the states? Let’s return to a more abstract analysis of privacy trends on the state level. To give some sense of how this picture has changed across time, here are a few privacy metrics for all 50 states in the year 1997:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qnueb20mAmNZTpLjuu9mKw.png" /><figcaption>Credit: Me! I put this together.</figcaption></figure><p>And here are privacy metrics for each state 20 years later:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQuGux6xIaTohH3Hmsx3hw.png" /><figcaption>Credit: Comparitech</figcaption></figure><p>Understandably, the measures of privacy have changed somewhat over the course of two decades. There was no such thing as the Internet of Thing (IoT) in 1997. Now IoT devices are creating new types of data in enormous quantities, both in the home and the workplace. The internet is no longer simply the domain of personal computers and smartphones. The Snowden revelations made everybody a little more cautious around cameras and microphones attached to these more obvious forms of technology, but what about your digital frame with motion-sensors? Those are cameras. What about your Samsung SmartTV and its microphone? The reason I single this brand out is that it’s at the center of a privacy scandal called <a href="https://www.cnet.com/news/weeping-angel-hack-samsung-smart-tv-cia-wikileaks/">Weeping Angel</a>, in which this IoT device could allegedly record you even when it remained in a “Fake-Off” mode. The grey nature of this topic could go one of two ways: it could all be smoke that any security vulnerabilities exist on any smart technology. Or it could be that this is just one instance of one possible security flaw that can be exploited within a single type of IoT object, and there are myriad others contributing to a <strong>bonfire of the privacies</strong>. In an age when the interconnectivity of everything means targeted ads can start popping up in your digital life as a result of what you search and what you say into your microphone, data privacy laws need to become more of a priority.</p><p>The overall takeaway of this state-level comparison across the passage of time is that privacy is ever-changing and complex. Laws need to be constantly updated with the evolving nature of technology. At least in the snapshot we have available here, how can we evaluate the state with the “best” privacy at the present moment? The state others should model and emulate?</p><p>First, some interesting observations from the two tables. Every state now requires companies to publicly disclose data breaches, something that hadn’t even materialized as an area of laws that states needed to address in 1997. Maine is the only state to pass a law prohibiting law enforcement from tracking a person’s location using GPS or other geo-location info built into smartphones and computers. Illinois and California have both put forth such bills in the past, but they were vetoed. Illinois and Maryland are the only states to specifically protect biometric data, including fingerprints, face recognition scans, and retina scans, but that law is <a href="https://www.eff.org/deeplinks/2018/04/new-attack-illinois-biometric-privacy-act">currently in jeopardy</a> in Illinois. Biometric data is easy to capture. Once captured, we generally cannot change our biometrics, unlike our credit card numbers, or even our names. Databases of biometric information are ripe targets for data thieves something that will be revisited in part V of this series.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*FnNEm8szGfj5mVmdQu26bQ.png" /><figcaption>Credit: Comparitech</figcaption></figure><p>Of the 50 states, California passed the toughest privacy and data protection law in the nation, making it the darkest shade of blue on the map above (it complied with 15 (75 percent) of the 20 criteria, better than any other state after it passed the landmark <strong>Consumer Privacy Act of 2018 </strong>on June 26, 2018). It’s the only state which requires companies to delete personal data on demand, with laws protecting IoT data and to mention an inalienable right to privacy in its state constitution. Other states have been somewhat tardy in keeping up with the changing digital landscape and would do well to follow California’s example (and that of the EU’s GDPR, as section V will reveal).</p><p><a href="https://medium.com/@harrison.hardin/iv-google-government-1768f5c63e23">Part IV</a></p><p><strong>Works Consulted:</strong></p><p><a href="https://www.eff.org/deeplinks/2018/04/new-attack-illinois-biometric-privacy-act">New Attack on the Illinois Biometric Privacy Act</a></p><p><a href="https://www.epic.org/privacy/consumer/states.html">Privacy Laws by State</a></p><p><a href="https://www.comparitech.com/blog/vpn-privacy/which-us-states-best-protect-online-privacy/">Which US States Best Protect Privacy Online?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b18b5144268" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/iii-the-united-states-of-privacy-2b18b5144268">III. The United States of Privacy</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[II. Consumers, Corporations and Commissions]]></title>
            <link>https://medium.com/swlh/ii-consumers-corporations-and-commissions-19afac8c481a?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/19afac8c481a</guid>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[net-neutrality]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[social-media]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Sun, 04 Aug 2019 16:58:50 GMT</pubDate>
            <atom:updated>2019-08-20T15:54:15.948Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>People have really gotten comfortable not only sharing more information and different kinds, but more openly and with more people. That social norm is just something that’s evolved over time. -Mark Zuckerberg</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eBnlb4p_G0sV4SbENTTpOg.png" /></figure><p>Although this demonstrates that a majority of Democrats surveyed (80%), independents (69%) and Republicans (75%) do not support allowing telecommunications companies to sell customers’ information, a rare display of political unity, it can serve as a <em>memento</em> to think critically. Republicans are consumers as well, and what this is really showing is that the passing of the bill is a boon to corporations, who will be allowed to profit off customer data. Democrats, Republicans, and anyone else who is an employee of a telecom business would surely vote for Trump to sign the bill (or face the wrath of management).</p><p>In fact, perfect polarization is reflected in how Congress voted: the Senate vote was <a href="https://www.senate.gov/legislative/LIS/roll_call_lists/roll_call_vote_cfm.cfm?congress=115&amp;session=1&amp;vote=00094">50–48</a>, with every Republican senator voting to kill privacy rules and every Democratic senator voting to preserve them. We can and should object to our Internet Service Providers trying to profit off of selling our information.</p><p>However, Trump and the current Republican heads of the FTC and FCC are trying to pull the wool over bipartisan opposition to stripping net neutrality rights. Ajit Pai at the FCC and FTC boss Maureen Ohlhausen, wrote the following piece in The Washington Post, the title of which is: “<a href="https://www.washingtonpost.com/opinions/no-republicans-didnt-just-strip-away-your-internet-privacy-rights/2017/04/04/73e6d500-18ab-11e7-9887-1a5314b56a08_story.html?utm_term=.444caf7749bf">No, Republicans didn’t just strip away your Internet privacy rights</a>.” In a large way, they did.</p><p>Any weakening of the rules by either the Trump FCC or Congress will leave you unprotected from ISP data collection, use and security practices that are almost certain to violate their privacy. When Google finds common ground with you, the end-user, to help <a href="https://ecfsapi.fcc.gov/file/100319291940/2016-10-03%20Google%20Letter%20(WC%2016-106).pdf">lobby against the rules</a> on your behalf, take note. To say the least, Alphabet and Facebook aren’t good consumer-advocates: as much as telecom companies deserve to be called out for these kinds of actions, they are only trying to start to get a little piece of the data-collection turned into mountains of advertising dollar from corporations clustered around the south end of the Bay Area. Anonymizing your digital trail of breadcrumbs through something like a VPN is a good preventative measure. Lobbying efforts split down the aisle in the specific case of telecommunications companies are indicative of something that is becoming more broadly apparent in other areas: your data can and will be used to political ends without your consent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*Gq5NWN__TEHs8W-wDu9L1g.png" /><figcaption>Credit: WSJ</figcaption></figure><p>There is no apter illustration of this than with the now-defunct Cambridge Analytica, and the culpability of Facebook in pawning off your trust in its services for profit. Privacy advocates at EPIC (an institution introduced in part I) held the FTC to its mission of protecting consumers and prompted a detailed investigation of Facebook from a steady filing of Freedom of Information Act requests. It helped get the FTC to issue a consent order against Facebook in 2011 by applying pressure to the social media giant, also via FOIA requests.</p><p>This application of pressure towards this initial consent order is of nontrivial importance, because when it was shown that Facebook’s changes to its privacy settings overrode user preferences and allowed third parties to access private information without users’ consent for the first time (starting in 2009, but coming to light in 2011), the FTC was severely limited in its bite. Upon the second offense, though, a way was cleared for a record-breaking settlement of $5 billion dollars to be levied against Zuckerberg’s social media giant. This is the largest of its kind and an interesting political choice for the FTC to enact, considering it was the three Republican commissioners who pushed the pact through, and the two Democrats as hold outs. That division really comes down to the parties jockeying for who would emerge as the better-equipped to police Big Tech. In light of the extreme polarization that arose as a result of the 2016 election, and the fact that Cambridge Analytica had been hired to harness the power of Data Science for Trump’s political aspirations, it is still quite interesting for the right to move against a company that clearly did a great deal to help usher the former reality-star into the Oval Office. We’ll circle back to explore the Cambridge Analytica issue more in-depth in part VI, but for now, suffice it to say that this could be a canary in the coal mine of Republicans starting to move against Trump.</p><p>Silicon Valley is the real heavy-hitter in the data collection racket, data mining firms like Cambridge Analytica and ISPs are only trying to take part in the massive gold rush enjoyed by corporations that can take a $5 billion hit on the chin (although Facebook’s future is certainly cloudier now). As a lead-in to the much more profound level of access to your information this group of companies in Northern California enjoys, let’s focus on one small facet of their business model: geo-location and “the Map Wars.”</p><p>Out of the strong start-up culture of Israel came the Waze system, and with it the golden opportunity for any of the major tech players to acquire the ultimate in crowd-sourced map technology. No amount of automated data can ever compare to lightning-in-a-bottle magic of maps that enrich themselves with live guidance about road, traffic and other dynamic conditions. Already ahead in the game with Google Maps, Alphabet was smart to snap up Waze. The Mountain View Monolith has been cautious to preserve the semblance of the autonomy and uniqueness of the original app that makes you feel to be part of a community of drivers all looking out for each other, outsmarting traffic and traffic enforcers, together. What is ultimately being outsmarted is you, the customer, though, and without vast swaths of the user base being the wiser, Alphabet has secured another foothold in mapping the way we live our lives. Others were easily capable of making this acquisition, and will likely be kicking themselves for years for having missed out here. It is unlikely any of the big tech players will ever catch up. Apple is kicking itself doubly for missing this acquisition and for the rollout of its own Map application.</p><p>Continue further up the Pacific Coast Highway using either of Alphabet’s geo-location products and you will arrive in the hometown of two other hegemons bear mentioning (Microsoft) and the newest arrival at the top of the mound, Amazon. Each is brilliant at downplaying dominance, not in geo-location but elsewhere. Microsoft by providing the computing infrastructure that still powers the majority of businesses large and small. Amazon by operating at a loss long enough to edge out all competitors trying to sell a physical product in a physical space (with its understanding of logistics, it wouldn’t be surprising to learn it wants to enter the Map Wars eventually). Until Prime can totally take over the market, it will have the soaring profits of its sprawling Web Services to tide itself over. Amazon certainly knows how to play the long game, but so does the name-shifting company that used to promise as part of its corporate conduct motto to not be evil.</p><p>Alphabet’s roughly $1.3 billion dollar purchase of Waze was a steal. Although the outfit that originally developed it was able to retain a good amount of autonomy in the terms of the deal, the idea that Waze and Google Maps are competing is illusory. The Map Wars are over, and standing on top of the rubble is Google, er, I mean Alphabet (this clever renaming bid shows foresight into a time when the word Google could leave a bad taste in one’s mouth).</p><p>This is the Standard Oil of the digital age. Standard Data. Descartes thought, therefore he was. “I google, therefore I am not,” read a billboard in San Francisco. Our omniscient ‘Pocket Gods’ not only do away with the need to memorize any new information whatsoever but also form better and better models as to where we’re physically moving, mapping our physical and mental movements with ever greater precision. Despite some serious challengers, no one currently dominates the technology and data game as Alphabet, Inc. But phantoms of the trustbusting of Rockefeller’s age are starting to come back around, as we can begin to see with the FTC’s unprecedented fine against Facebook (larger than any levied in Europe against US technology corporations). Part V of this series will revisit this concept and look into how monopolistic trends within Standard Data may start to be exposed to increasing regulatory pressures. In March, an NBC poll asked Americans how much they trusted huge tech firms to protect their personal information, Facebook scored the worst, with 60% responding they trusted the company “not at all.” Compare that with 37% for Alphabet and 28% for Amazon.</p><p>The intersection of the individual, the corporation and some of the politics on a federal level that governs those interactions are buzzy, important areas in the public consciousness right now. What may be somewhat less well-trodden ground is a foray into data trends affecting you at the city and state level, something I look to examine in the next section in the series through the lens of what is being done on the local level in a few different cities around the country with data usage. What are some patterns we see playing out at the state level when it comes to protections for your financial, medical, geo-location or real-estate information?</p><p><a href="https://medium.com/swlh/iii-the-united-states-of-privacy-2b18b5144268">Part III</a></p><p><strong>Works Consulted:</strong></p><p><a href="https://thehill.com/blogs/pundits-blog/technology/324520-fcc-ftc-are-playing-a-shell-game-with-online-privacy">FCC, FTC Are Playing a Shell Game with Online Privacy</a></p><p><a href="https://www.techdirt.com/articles/20170405/05570837086/fcc-ftc-bosses-pen-misleading-editorial-falsely-claiming-best-way-to-protect-your-privacy-moving-forward-is-to-gut-net.shtml">FCC, FTC Bosses Pen Misleading Editorial Falsely Claiming The Best Way To Protect Your Privacy Moving Forward… Is To Gut Net Neutrality</a></p><p><a href="https://www.wsj.com/articles/ftc-approves-roughly-5-billion-facebook-settlement-11562960538">FTC Approves Roughly $5 Billion Facebook Settlement</a>.</p><p><a href="https://arstechnica.com/information-technology/2017/03/how-isps-can-sell-your-web-history-and-how-to-stop-them/">How ISPs Can Sell Your Web History and How To Stop Them</a></p><p><a href="http://www.tech-news.com/another/ap201704.html">Location, Location, Location</a></p><p><a href="https://techcrunch.com/2013/06/11/behind-the-maps-whats-in-a-waze-and-why-did-google-just-pay-a-billion-for-it/">WTF Is Waze And Why Did Google Just Pay A Billion+ For It?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19afac8c481a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/ii-consumers-corporations-and-commissions-19afac8c481a">II. Consumers, Corporations and Commissions</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I. A Brief History of Data]]></title>
            <link>https://medium.com/swlh/i-a-brief-history-of-data-ce5f51d1df3d?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce5f51d1df3d</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[surveillance]]></category>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Fri, 02 Aug 2019 18:03:45 GMT</pubDate>
            <atom:updated>2019-08-15T01:02:28.041Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>You have zero privacy anyway. Get over it. -Scott McNealy</blockquote><p>Predictably, the quote comes from the C-level executive of a powerful computer company, Sun Microsystems, with everything to gain from brashly convincing you that your window of time to control access to data about yourself and how it gets used has slammed shut.</p><p>Is privacy dead? No, but it was coughing up blood last night.</p><p>Just as an entity that makes a living providing investment advice can be called a stockbroker, an informationbroker sells your data. The first describes a financial advisor, a money manager. The second describes the commoditization of your unique, private life. And it’s a bull market.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/0*AwJWGL3Se-iqsVss" /></figure><p>The current state of data and how it relates to privacy makes the following sentences seem alien and strange, remnants of a long-forgotten pre-social media fairytale:</p><ul><li>Everybody deserves the right to be gatekeepers of their own flow of information.</li><li>Privacy allows us to express and reveal ourselves within small groups of friends, trusting that those revelations will be kept in confidence and respected.</li></ul><p>Technology executives and commissioners of federal agencies belittle concerns about data autonomy as no longer relevant in the new digital age, a pipedream. Yet they are precisely those who protect their privacy with the most vehemence. Privacy is essential for our quality of life, for our collective mental health, even. Our <strong>collective conscience</strong>. There is dignity in privacy. Having it stripped away has had a nontrivial effect on our society. You are not entitled to the rights of your own story, in a sense. Or, perhaps more aptly, for having any kind of interaction whatsoever with the modern world, you are tokenized, monetized and sold to the highest bidder. There are real rewards to reap for bearing your soul to the world, but not by you. You are alloted the recognition of a virtual thumbs up or two while your data is hoovered up and sold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*hMZF72On_e40B7pS" /><figcaption>Remember me?</figcaption></figure><p>Let’s take a brief look back at how we got here, in the context of roughly the time since the founding of Google in 1998. The late ’90s may have been as Utopian a time as the internet ever experienced. It was a golden age of transition from floppy to compact discs, of Compaq Presarios and translucent backed iMacs.</p><p>The events of September of 2001 suddenly gave strong emphasis and priority to security at the expense of privacy. More than 200 years before, Ben Franklin set up our mail system and instituted the first privacy laws of our fledgling country. His wise words of not trading liberty — privacy, really — for security (and that those who opt for such a deal deserve neither) were muted in the aftermath of 9/11. This series of six think pieces on the state of data and will examine how our own country (and sometimes other nations) deals with the tensions between the sanctity of a private individual and the sometimes intrusive requirements of a threatened (or perhaps pretending to be threatened) society. I will examine different slices and segments of said society, how they interact with one another, and how we might strike an equilibrium between data liberty and security that Ben would be proud of.</p><p>The Patriot Act of 2001 was passed with significant bipartisan support initially, however as time went on, its intended expiration “sunset” kept getting extended while the right was in power. Conservative think tank The Heritage Foundation cites <a href="https://www.heritage.org/terrorism/report/fifty-terror-plots-foiled-911-the-homegrown-threat-and-the-long-war-terrorism">50 instances</a> in which this act thwarted terrorism since this legislation passed. This can be compared with the ACLU’s <a href="https://www.aclu.org/issues/national-security/privacy-and-surveillance/surveillance-under-patriot-act">reporting</a> of a single terror-related conviction, which would have occurred even without the Patriot Act. When the political pendulum swung in the other direction, the sun finally set on this legislation, and the Freedom Act replaced it, purportedly ending bulk collection of records, increasing the transparency of government institutions and allowing citizens to challenge gag orders in national security cases.</p><p>How does this relate to 2019? In testimony from <a href="https://archives.fbi.gov/archives/news/testimony/usa-patriot-act">2004</a>, a former FBI Director defended the act, stating the organization “could be forced back into pre-September 11 practices, attempting to fight the war on terrorism with one hand tied behind our backs.” The man’s name was Robert Mueller.</p><p>The debate between an increased sense of security and privacy intrusion rages on today, and it is largely an argument of red versus blue. Although it can perhaps be better framed in terms of liberty versus control. Before Snowden and others leaked the lengths the government was willing to go in the name of protection, the security argument was colored in a different light. In two links I include below, I reference two Huffpost articles from 2007 presenting the two opposing viewpoints. The case for privacy is delivered by the director of a civil liberties group I will reference again in this series, the Electronic Privacy Information Center (EPIC), Marc Rotenberg. The case for security is made under the usual pretense of preventing catastrophic terroristic outcomes. It is done by a gentleman who is associated with associations and fellowships at some noted security policy institutes, Mr. Taipale. He was also called to give testimony for the Senate’s Committee on the Judiciary regarding ‘The Privacy Implications of Government Data Mining Programs,’ and the domain knowledge demonstrated of Data Science processes is substantial. He speaks of counterpoints to the security argument framed as “the training set problem,” meaning terrorist events are so rare that no useful patterns can be gleaned, the frequency of False Positives (Type I errors) and False Negatives (Type II errors) in advancing counter-terrorism predictive models. The arguments are far more sophisticated and refined, and I contend that it would seem the two-faced nature of the national security camp is showing its hand, particularly in light of the events of 2013 leaking the extent of data collection at the NSA. The intelligence community is opaque by nature, and I also offer that there is a tremendous amount of benevolence and preventative good which will never be revealed.</p><p>I will quote Mr. Taipale’s conclusion in his Senate testimony as a reflection on the importance of finding balance in the push and pull of privacy and security: “Key to resolving these issues is designing a policy and information architecture that can function together to achieve both outcomes, and is flexible and resilient enough to adapt to the rapid pace of technological development and the evolving nature of the threat.” It turns out the threat can evolve to be the commander in chief himself shining a spotlight on the grey ops community to protect his ego, a move that undoubtedly had consequential reverberations into important assets of the US government. True motives are often masked in politics. The call to rally around the flag, or to rally around the cult of personality of a leader is nothing new. However difficult it gets, I believe we will be able to adapt and overcome anything (although we may have to make a deal with the devil).</p><p>A notable work that has entered the zeitgeist for how well it describes this Faustian bargain is Shoshana Zuboff’s ‘The Age of Surveillance Capitalism.’ An algorithm frequently used in Machine Learning which allows us to process language naturally is known as an N-gram model, which processes the appearance in text of a word or phrase. Google’s Ngram viewer allows us to see that the word “surveillance” was seldom used until the 1960s, as the dystopian work of fiction ‘1984’ gained in popularity and as the stranger-than-fiction reality of the Cold War set in and saw the word enter the common parlance much more often, and trend that continues to grow today. The etymology is French for the verb “to watch over.”</p><p><em>(As a brief aside, yes, Google does have some redeeming qualities, like making Natural Language Processing algorithms approachable to people outside of technical, Data Science backgrounds. Facebook does the same with Time Series Forecasting through its introduction of something called Prophet.)</em></p><p>Although it can verge on being melodramatic, the book does identify the ability of Silicon Valley household names to shape and manipulate the information we give out for free, just by using their services, and fashion that data exhaust into a “prediction product.” This is an odd echo of the same kind of predictive abilities Mr. Taipale referred to, but for business instead of the government. Foreshadowing what is to come with Cambridge Analytica, Zuboff also mentions Facebook’s first big litigation headache began in 2007 with Beacon, which was shut down after it was revealed that the service broadcasted all web activity and purchases made by users in News Feed without their knowledge and even when not they were not connected. In government, we have seen a rise in concerning activities and another instance of the fallout of digitalization. The IRS was <a href="https://money.cnn.com/2015/05/26/pf/taxes/irs-website-data-hack/">breached</a> in 2015, and more than 100,000 people had information taken.</p><p>The ramifications of how important it is to enact privacy measures seemingly go on and on. The 2017 Equifax data breach of 147 million customers was settled for a record $700 million. In the next section, as well as in parts V and VI, we’ll fully flesh out the Facebook &amp; Cambridge Analytica debacle, which is an even more notorious violation of personal privacy and egregiously high settlement. But social media policing can bring about quick justice and help us feel protected and vindicated, like in the quick resolution of a <a href="https://techcrunch.com/2019/07/29/capital-one-breach-was-inevitable/">hack into 100 million Capital One credit card applications</a>, where bank accounts and Social Security Numbers were taken by a former Amazon Web Services employee. It’s nigh impossible to keep up with all the data breaches occurring; at the time of publishing this article, Pearson education was hacked and the names, dates of birth and email addresses of thousands of students were accessed. One day there is a clear and appropriate place to draw the line in technology’s access to our lives, the next there is not.</p><p>This series will explore the relationship between our most valuable commodity, data, and how it impacts us as individuals, and as groups of individuals. Is there safety and security in numbers? Political polarization may not be new, but the extremes we have arrived at in recent years are south of the antarctic and north of the arctic. What is the future of internet freedom for individuals? Cities and States? Nation-States? What are the political ins and outs of how privacy and security intertwine? Is the dual helix really better framed in terms of government/corporate control and liberty? The next article will explore how you as a person interact with data as well as how businesses and the US federal government shape those interactions.</p><p><a href="https://medium.com/swlh/ii-consumers-corporations-and-commissions-19afac8c481a">Part II</a></p><p><strong>Works Consulted:</strong></p><p><a href="http://data-mining-testimony.info/">http://data-mining-testimony.info/</a></p><p><a href="https://www.quora.com/Is-Internet-privacy-dead?share=1">Is Internet Privacy Dead?</a></p><p><a href="https://www.history.com/topics/21st-century/patriot-act">Patriot Act</a></p><p><a href="https://www.huffpost.com/entry/privacy-vs-security-priva_b_71806">Privacy Vs. Security? Privacy.</a></p><p><a href="https://www.huffpost.com/entry/privacy-vs-security-secur_b_71785?guccounter=1">Privacy Vs. Security? Security.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce5f51d1df3d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/i-a-brief-history-of-data-ce5f51d1df3d">I. A Brief History of Data</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Natural Language Processing in “A Neural Probabilistic Language Model:” A Summary]]></title>
            <link>https://medium.com/data-science/natural-language-processing-in-a-neural-probabilistic-language-model-a-summary-19c9cd7cf6c4?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/19c9cd7cf6c4</guid>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 14:46:38 GMT</pubDate>
            <atom:updated>2019-07-22T15:19:32.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bXb6vuZ6NJg6DYwX" /><figcaption>Credit: smartdatacollective.com</figcaption></figure><p>This is the PLN (plan): discuss NLP (Natural Language Processing) seen through the lens of probability, in a model put forth by Bengio et al. in 2003 called NPL (Neural Probabilistic Language). The year the paper was published is important to consider at the get-go because it was a <strong>fulcrum</strong> moment in the history of how we analyze human language using computers. Noam Chomsky’s Linguistics might be seen as an effort to use the human mind like a machine and systematically break down language into smaller and smaller components. He started with sentences and went to words, then to morphemes and finally phonemes. Computerization takes this powerful concept and makes it into something even more vital to humankind: it starts with being relevant to individuals and goes to teams of people, then to corporations and finally governments. Dr. Chomsky truly changed the way we approach communication, and that influence can still be felt. Linguistics was powerful when it was first introduced, and it is powerful today. N-gram analysis, or any kind of computational linguistics for that matter, are derived from the work of this great man, this forerunner. This blog will summarize the work of the Bengio group, thought leaders who took up the torch of knowledge to advance our understanding of natural language and how computers interact with it.</p><p>Artificial Intelligence has changed considerably since 2003, but the model presented in this paper captures the essence of why it was able to take off. Machine learning and deep learning have both become part of the AI canon since this paper was published, and as computing power continues to grow they are becoming ever more important. Data Science is a confluence of fields, and today we’ll examine one which is a cornerstone of the discipline: probability. The probabilistic distribution model put forth in this paper, in essence, is a major reason we have improved our capabilities to process our natural language to such wuthering heights.</p><p>English, considered to have the most words of any alphabetic language, is a probability nightmare. The possibilities for sequencing word combinations in even the most basic of sentences is inconceivable. We are facing something known as <strong>the curse of dimensionality</strong>. To make this more concrete, the authors offer the following:</p><blockquote>…if one wants to model the joint distribution of 10 consecutive words in a natural language with a vocabulary V of size 100,000, there are potentially 100,000^10 − 1 = 10^50 − 1 free parameters.</blockquote><p>In data-driven Natural Language Processing tasks, there are practically unlimited discrete variables, because the population size of the English vocabulary is exponentially north of 100K. When trying to compare data that has been split into training and test sets, how can you ever expect to put forth a readily generalizable language model? The two divisions in your data are all but guaranteed to be vastly different, quite ungeneralizable. You’re cursed by the amount of possibilities in the model, the amount of dimensions. What can be done?</p><p>The Bengio group innovates not by using neural networks but by using them on a massive scale. Linguistics and its founding father Noam have a tendency to learn how one word interacts with all the others in a sentence. Bengio et al. focus on learning a statistical model of the distribution of word sequences. This research paper improves NLP firstly by considering not how a given word is similar to other words in the same sentence, but to new words that could fill the role of that given word. Secondly, they take into account n-gram approaches beyond unigram (<em>n</em> = 1), bigram (<em>n</em> = 2) or even trigram (the <em>n</em> typically used by researchers) up to an <em>n </em>of 5.</p><p>The math for n-gram models is given as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*sa0IeE20OyewtV3rjUW3YA.png" /></figure><p>This formula is used to construct conditional probability tables for the next word to be predicted. When modeling NLP, the odds in the fight against dimensionality can be improved by taking advantage of word order, and by recognizing that temporally closer words in the word sequence are statistically more dependent. What does this ultimately mean in the context of what has been discussed? What problem is this solving? The language model proposed makes dimensionality less of a curse and more of an inconvenience. That is to say, computational and memory complexity scale up in a linear fashion, not exponentially. It improves upon past efforts by learning a feature vector for each word to represent similarity and also learning a probability function for how words connect via a neural network. Let’s take a closer look at said neural network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*KBORCVHmNPt1faymRy5pMA.png" /></figure><p>We’re presented here with something known as a Multi-Layer Perceptron. <strong>What are those layers?</strong> Three input nodes make up the foundation at the bottom, fed by the index for the word in the context of the text under study. The layer in the middle labeled tanh represents the hidden layer. Tanh, an activation function known as the hyberbolic tangent, is sigmoidal (s-shaped) and helps reduce the chance of the model getting “stuck” when assigning values to the language being processed. <strong>How is this?</strong> In the system this research team sets up, strongly negative values get assigned values very close to -1 and vice versa for positive ones. Only zero-valued inputs are mapped to near-zero outputs. The uppermost layer is the output — the softmax function. It is used to bring our range of values into the probabilistic realm (in the interval from 0 to 1, in which all vector components sum up to 1).</p><p>Don’t overlook the dotted green lines connecting the inputs directly to outputs, either. The optional inclusion of this feature is brought up in the results section of the paper. It provides an interesting trade-off: including the direct connections between input and output causes the the training time to be cut in half (10 epochs to converge instead of 20). Without them, the model produced better generalizations via a tighter bottleneck formed in the hidden layer.</p><p>It’s possible for a sentence to obtain a high probability (even if the model has never encountered it before) if the words contained therein are similar to those in a previously observed one. There’s the rub: Noam Chomsky and subsequent linguists are subject to criticisms of having developed too brittle of a system. This method sets the stage for a new kind of learning, deep learning. When utilized in conjunction with vector semantics, this is powerful stuff indeed. Through this paper, the Bengio team opened the door to the future and helped usher in a new era. An era of AI.</p><p><strong>Works Referenced:</strong></p><p><a href="http://www.jmlr.org/papers/volume3/bengio03a/bengio03a.pdf">A Neural Probabilistic Language Model</a>, Bengio et al.</p><p><a href="https://opendatascience.com/an-attempt-to-chart-the-history-of-nlp-in-5-papers-part-ii/">An Attempt to Chart the History of NLP in 5 Papers: Part II</a>, Kaylen Sanders.</p><p><a href="https://theclevermachine.wordpress.com/tag/tanh-function/">https://theclevermachine.wordpress.com/tag/tanh-function/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19c9cd7cf6c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/natural-language-processing-in-a-neural-probabilistic-language-model-a-summary-19c9cd7cf6c4">Natural Language Processing in “A Neural Probabilistic Language Model:” A Summary</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wine is OSEMN]]></title>
            <link>https://medium.com/data-science/wine-is-osemn-feaf4ce30c63?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/feaf4ce30c63</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[wine]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Tue, 09 Jul 2019 19:46:58 GMT</pubDate>
            <atom:updated>2019-07-12T03:25:15.311Z</atom:updated>
            <content:encoded><![CDATA[<p>Wine is awesome. It’s also OSEMN when you apply each of the five steps of the Data Science lifecycle to a <a href="https://www.kaggle.com/zynicide/wine-reviews">kaggle</a> data set showcasing Wine Enthusiast reviews from 2017, and a <a href="https://www.kaggle.com/olivierg13/wine-ratings-analysis-w-supervised-ml">csv</a> about red wine chemical composition and quality. What are those steps? <strong>O</strong> is for <strong>o</strong>btaining the data. <strong>S </strong>is for <strong>s</strong>crubbing<strong> </strong>the data you just wrangled (also called cleaning). <strong>E </strong>is for <strong>e</strong>xploring the data, sometimes referred to as EDA — exploratory data analysis. This stage often involves examining summary statistics as well as looking at visualizations to get a clearer picture of the story the data is trying to tell. <strong>M </strong>is for <strong>m</strong>odeling, and involves selecting one or many machine learning models to apply to the data. <strong>N </strong>is for i<strong>n</strong>terpreting the results of the previous step. These five stages will be applied <a href="https://github.com/lindseyberlin/Mod5Project/blob/master/Harrison_Final.ipynb">here</a> in the hopes of gaining some meaningful insight from fermented grape juice.</p><h3>I. Obtain</h3><p>Although too ambitious for the time being, I had aspirations to create some supplemental wine data from one of my favorite apps, Vivino. Check it out, it is surely making waves at the intersection of the wine industry and data science. The data analyzed here has already been graciously wrangled. The dataset on red wine chemistry (phenolics) comes from the scientific research of P. Cortez, et al. in 2009.</p><h3>II. Scrub</h3><p>The review dataset had some information missing, and some duplicates were present. Missing values were handled by dropping them, and the duplicates are a good illustration of a hypocratic oath, of sorts, when cleaning data. Ideally, duplicates would be removed. However, I demonstrate that doing so causes (much more) harm than good, by a factor of five. The Cortez dataset on phenolics has neither missing nor duplicated entries. This is a relatively rare thing to come across “in the wild,” and is likely the result of the Cortez group having already scrubbed the data clean. These first two stages comprise a majority percentage of the total Data Science lifecycle. Not anything approaching sunken percentage of an iceberg, typically, but close. About 60–80% of your time can typically be expected to be spent obtaining and scrubbing data.</p><h3>III. Explore</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3BzYR1bVujjIT_auIBK3PQ.png" /><figcaption>Fairly Gaussian Distribution of Wine Ratings</figcaption></figure><p>The seaborn plot shown above indicates not only a normal distribution, but give some guidance as to where the points should be grouped for simplification. The details of that simplification are, once again, available to be perused in my jupyter notebook for this project hosted on <a href="https://github.com/lindseyberlin/Mod5Project/blob/master/Harrison_Final.ipynb">github</a>.</p><p>My visualizations contained therein would appear to give credence to the notion that the more a given reviewer is writing about the wine in question, the more they like it and the higher they will rate it (or the more expensive it is, and hence merits more words to describe what the potential buyer is investing in). On a whole, a curt description is seemingly due to an unimpressed reviewer. A taciturn taster’s terseness is telling. Seemingly being the operative word. We shall see.</p><h3>IV. Model</h3><p>The Machine Learning algorithm I will be using (Random Forest) is for the purpose of classification, and falls under the category of what is known as a supervised learning model. First, I examine if the length of the wine descriptions in the dataset is a satisfactory classificatory predictor of if a wine will be considered high-scoring or not (my target, or dependent variable). I arrived at this from my EDA about how many wines were getting what kinds of scores. I then examine the same independent variable, wine review description length, in the context of classifying wine price, my next target variable. In each instance, I use Random Forest Classification (RFC) to see how this algorithm responds to keeping the input variable consistent and varying the output variable.</p><p>The first target variable, point rating, had very low precision before simplifying or “binning” the points into smaller groupings. Afterwards it only classified slightly better than chance. The second model targetting price as the output variable proved to be about equally as proficient (only as good as random chance) at classifying expensive wines, defined as being above $100 a bottle. However, below this threshold it was impressive, classifying at about 96.5% accuracy.</p><p>I also examine this particular classification model in the context of a different data set also involving wine, but this time the phenolics of red wines and how these features relate to quality. Phenolic compounds are responsible for giving red wine its color. The chemistry is fascinating, and it is often cited as the distinguising factor between a high-quality wine and a not-so-high-quality one. RFC proves itself an extradorinarily effective machine learning algorithm here.</p><p>Generally in Machine Learning, many different models are iteratively tested to determine which provides the best results (whether you are gearing for accuracy, precision, or some other trait of the model). In the case of RFC, and in other decision tree style approaches, this can involve performing a cross validation (often 5 or 10 fold) carried out through a method such as a GridSearch, which combinatorically goes through each possibility with the data being fed in. This is a ready way to tune model parameters, although it is an exhaustive search which can be computationally intense. Compared with other ML algorithms, it tends to be a top-performer, naturally resistant to noise and variance in the data.</p><p>I do utilize iteration within the RFC algorithm for my phenolics dataset to find the best features to select for highest precision, but I did not for the wine review, price and points modeling. This is something lacking in my project that would be a worthy inclusion in the future. My reasoning here was to narrow in on how RFC specifically functions in the context of two different datasets unified by a common viticultural theme.</p><h3>V. Interpret</h3><blockquote>Bacchus favors a stressed-out grape.</blockquote><p>We have arrived at the final step of the Data Science process. What should we make of all of our hard work? Before examining Random Forest Classification of wine datasets, I’d have ventured to guess that the more a taster is putting pen to paper, or technically, finger to keyboard, the higher they are going to rate the wine being sampled.</p><p>The results from the the RFC modeling were fairly decisive, and my presuppositions did not actually hold up.</p><p>While the RFC of the simplified points metric (not pictured) did do slightly better than average at classifying wine description length into the five categories defined, it was not to the extent I hypothesized when first formulating this project. This graph from my EDA may demonstrate why:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*a79AZaLQRvGuUX0iPKN5RA.png" /></figure><p>A linear regression model would have been more appropriate here than classification.</p><p>This turned out to be especially true in the case of 20 distinct points categories, but still true when binned into smaller groupings every 4 points.</p><p>A much better classification model involved using the shorter descriptions to classify less expensive wines (under $100). The inclusion of upward outliers helped this model along in a big way. In fact, only including wines priced up to $500 was detrimental to the model’s accuracy, something else I would not have foreseen without testing it and verifying. I had some domain knowledge in choosing $100 as a threshold of quality, beyond which lies <em>cult status</em>. As the damage gets into three digits a bottle, there is tremendous divergence in price without sufficiently justified exponential increase in quality. What was reflected in the RFC model was a high level of accuracy for classifying wines under $100 but a not-better-than-chance classification model for wines above that threshold.</p><p>I put forth that the vast majority of wine drinkers are never looking to spend more than $100 on a bottle, or to do so only very infrequently. This model shows that wines of a certain description length from this subset of wine reviews from 2017 are able to be classified with high precision and accuracy as being below that critical price point through the Random Forest Algorithm. Above it, and review length is only about as good as chance at classifying cost per bottle.</p><p>Taken together, I contend that these two results should be interpreted to mean that buying wine with longer description length that is still under $100 for the bottle is the best approach for scouting out your next pick in Wine Enthusiast. Since it was the weaker model, point rating should only be used as a secondary way to classify which are truly the best wines.</p><p>Although I do not touch on it here, there is likely some interplay of description length and word frequency inside the review description which merits further study. This would be entering the province of Natural Language Processing, and involves turning word appearances in a given text into vectors to be able to gauge frequency. Description length might reasonably harmonize with how often certain words are appearing, or it might not. This would be a worthwhile extension of what I have delved into here.</p><p>Our foray into phenolics gave us a decisive classification. Naturally. Phenols are organic compounds released by plants and animals as a part of their defense mechanisms, with a central cyclic benzene ring and a varying number of hydroxyl groups as substituents. So, the more stressed the vines are, the more phenols they will produce. These compounds not only affect the color in red wines but also act as preservatives and impact the taste. Bacchus favors a stressed-out grape.</p><p>My notebook details that regardless of if you are dealing with what I define as “not two-buck Chuck” (good) or “two-buck Chuck” (bad) wine, Random Forest is quite a precise and accurate Machine Learning classification model for one of these two styles of wine. It is particularly good at distinguising good quality wines. Feature scaling is always something worth applying when analyzing datasets that contain variables operating over highly disperse distributions. However in this specific instance, all of the features were very uniform even before scaling. This, along with playing around with some feature selection, provided some additional insight and depth into my foray into the world of Machine Learning and wine.</p><p>Although by no means perfect, this project made the Data Science lifecycle in all its OSEMNess much more concrete for me. I hope it can go some measure toward doing the same for you.</p><p><strong>References:</strong></p><p><a href="https://github.com/harrisonhardin/Mod5Project">https://github.com/harrisonhardin/Mod5Project</a></p><p><a href="https://www.kaggle.com/zynicide/wine-reviews">Wine Reviews</a></p><p>P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547–553, 2009.</p><p><a href="https://www.kaggle.com/kabure/wine-review-s-understanding-pythonic-eda">https://www.kaggle.com/kabure/wine-review-s-understanding-pythonic-eda</a></p><p><a href="https://www.kaggle.com/olivierg13/wine-ratings-analysis-w-supervised-ml">https://www.kaggle.com/olivierg13/wine-ratings-analysis-w-supervised-ml</a></p><p><a href="https://www.kaggle.com/uciml/red-wine-quality-cortez-et-al-2009/downloads/winequality-red.csv/2">https://www.kaggle.com/uciml/red-wine-quality-cortez-et-al-2009/downloads/winequality-red.csv/2</a></p><p><a href="https://www.winefrog.com/definition/515/phenolics">https://www.winefrog.com/definition/515/phenolics</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feaf4ce30c63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/wine-is-osemn-feaf4ce30c63">Wine is OSEMN</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model Selection, Tuning and Evaluation in K-Nearest Neighbors]]></title>
            <link>https://medium.com/data-science/model-selection-tuning-and-evaluation-in-k-nearest-neighbors-6d3024d78745?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d3024d78745</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[model]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Wed, 26 Jun 2019 15:02:03 GMT</pubDate>
            <atom:updated>2019-07-20T01:04:25.865Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*PifsUj0vL_8uHZ_igH0IKw.png" /><figcaption>It’s a beautiful day in the neighborhood</figcaption></figure><p>The core of the Data Science lifecycle is model building. Although relatively unsophisticated, a model called K-nearest neighbors, or KNN when acronymified, is a solid way to demonstrate the basics of the model making process …from selection, to hyperparameter optimization and finally evaluation of accuracy and precision (however, take the importance of <a href="https://stats.stackexchange.com/questions/312780/why-is-accuracy-not-the-best-measure-for-assessing-classification-models">accuracy</a> with a grain of salt). If Occam’s Razor has taught us anything, it’s that simplicity is not a bad thing, so let’s dive into looking at an algorithm that is often a component in building other models in Machine Learning which are quite sophisticated.</p><h3>I. Model Selection</h3><p>For this walkthrough, I’ve already selected the model as KNN. In choosing a model, do what the best scientists always do first: look to the data. Do you have a little or a lot of it?</p><p>The best model selections will have a good trade off between bias and variance, and ideally minimize both. Since I’ve already mentioned the term Machine Learning, it is important to distinguish that I am not referring to algorithmic bias here, but instead statistical bias. Algorithmic bias is a hugely important and active topic of discussion, but it is outside the scope of my blog post. Statistical bias involves the difference between expected and true values of a parameter, and variance refers to how much a model’s predictions fluctuate after multiple repetitions of the learning process on a subset of the data being studied called the training set.</p><p>This brings us into a discussion about goodness of fit. Before getting into the specifics of how KNN works, if we examine the following image, the black line is an example of a model with a good fit to tje data in the abstract sense of identifying blue dots from red dots. Although not pictured, an underfit model would be a line that runs perfectly diagonally from the top left to the bottom right (underfitting meaning high bias). The green line is arguably perfect, it classifies all blue dots together and the same for red dots. However it represents the definition of overfitting, and would not be able to generalize well to new data (more on this in Section III).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*8WMV7OPlQF8JiSfg.png" /></figure><p>In essence, bias and variance taken together will make up the amount of error in a given model that it is possible to reduce:</p><p>Reducible Error = Squared Bias + Variance</p><p>No matter how perfectly a model is able to minimize bias and variance, there is a certain degree of inescapable error or noise that will always be present in our entropic universe. This is known as irreducible error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*modEYt2TSSm552uA.png" /></figure><p>At its core, the K-nearest neighbors algorithm is really pretty intuitive. How would this point in space that is equally distant from the two apples and three oranges be classified? Citrus tips the scale, and now we have four oranges.</p><h3><strong>II. Model Tuning</strong></h3><p>Often in modeling, both parameter and hyperparameter tuning are called for. What distinguishes them is whether they come before (hyperparameter) or after (parameter) a model has been fit.</p><p>KNN is a relatively simple classification tool, yet it’s also highly effective much of the time. It gets bandied about that in approximately <strong>a third of all grouping cases</strong>, it’s the most effective categorizer. A third! This model may be small, but so too is it mighty.</p><p>There are different iterations of the algorithm in various programming languages, but I’ll be discussing scikit-learn’s here, which is in Python. The base algorithm uses Euclidean distance to find the nearest K (with K being our hyperparameter) training set vectors, or “neighbors,” for each row in the test set. Majority vote decides what the classification will be, and if there happens to be a tie the decision goes to the neighbor that happened to be listed first in the training data.</p><p>For me, it’s the best algorithm for visualizing what a hyperparameter actually does. <strong>Pop quiz!</strong> At each of the values of K in the graph, the question mark in the middle would be classified as a blue circle. But what about when K keeps increasing? Leave your answer in the comments below for a chance at winning the most valuable prize of all, <em>knowledge</em>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*gfo6LVm0lCWCDCAswXWrsw.png" /></figure><p>The image below raises an interesting question. Clearly, when K is equal to 11, the puzzle piece is a smiley face. But what about when k is four? According to the documentation, if two groups of neighbors have identical distances but different labels, the result will depend on the ordering of the training data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*m5IsNmsZkwcJ2sSj.png" /><figcaption>What is the optimal K for solving how this piece of the puzzle should be classified?</figcaption></figure><p>Be aware that in different iterations of the algorithm, this can vary. For example, in R’s KNN classification system, ties are broken at random.</p><p>The famous (read: infamous) Iris dataset, a classic in the Statistical canon, is an apt demonstration of how this algorithmic tool can be put to use. A scatterplot visualization of the four features being analyzed should make it clear that KNN would be able to easily distinguish the three separate species in 3 out of 4 of the comparisons. One feature matchup is a little more mixed, at least between two of the species being compared, but even in the case of comparing sepal length to sepal width, KNN would be able to distinguish the three species from one another to varying degrees of success, depending on what we set K as.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*hQ4mIJBSb7tzCuDzutuXYQ.png" /></figure><p>It is also readily available, should you wish to sandbox what is discussed here and even level-up to ensembling a few methods together. You could be winning Kaggle competitions before you know it!</p><p>So now that we have our model picked out and have a better idea of what the hyperparameter means in the context of nearest neighbors, how do we optimize K? Learning curves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*Mv0xM16_FNJXUpCC3wAeSw.png" /><figcaption>Seaborn Visualization of a KNN learning curve</figcaption></figure><p>Pictured above we see a learning curve which comes from an excellent Kaggle page that looks at KNN in the context of diabetes prevalence amongst Pima Indians. We can see clearly that the <em>maxima</em> of the Test Score, 11, denotes the optimal value for the algorithm, K = 11. This circles back to our discussion about bias and variance. Too much of door number one (bias), and you would see a learning curve indicative of a simplistic model: low test and low training scores which are also very similar in value. An excess of door number two (variance) and there will be a noticeable difference between training and test score. A good balance of each denotes a model which is both accurate and precise. A model could even be described by a fourth possibility: neither accurate nor precise. This would be the case in a high bias, high variance situation. Answer for yourself: which of the four categories best describes the learning curve in this visualization?</p><h3>III. Model Evaluation</h3><p>In science, evaluating a model basically means seeing how well it handles new data. This was hit upon in a general sense when we looked at goodness of fit (remember our red and blue dots).</p><p>To evaluate K-nearest neighbors in the context of Machine Learning models at large, we need to weigh some of its advantages and disadvantages. KNN is used as the building block for many other more advanced algorithms, a phenomenon I briefly touched on earlier that’s known as ensembling, or blending. You can also fine-tune the algorithm with a few variations common to other areas of ML.</p><p>What distinguishes unsupervised from supervised K-nearest neighbors is to what end it is being used — the former being for clustering and the latter classification. If we are talking about unsupervised KNN, you can switch between a <em>brute force</em> approach, <em>ball tree</em>, <em>KD tree</em>, or even leave it up to the algorithm itself to determine the best way to cluster (<em>auto</em>). I’d reguard this customizability as a point in favor of KNN, as it allows you the flexibility to handle both small and large datasets. The division typically occurs on a number of samples close to about 30: below this number, roughly speaking, a <em>brute force</em> strategy is better. Above it, the <em>tree</em>-based approaches are the way to go. Too far above it, though, and the time complexity involved is no longer tenable. That is to say, as N (the number of samples) goes up, the calculation time of KNN increases exponentially, quickly diverging from what can be considered useful.</p><p>One of the other notable cons here has to do with the structure of the data you want to work with, and is known as the curse of dimensionality, although this ailment can be addressed by using scikit-learn’s Neighborhood Components Analysis, or NCA for short. This is also a supervised (learned) distance metric algorithm aimed at improving the accuracy of KNN’s classifications when compared to using the default metric, Euclidean distance. It is derived from a broader algorithmic strategy to deal with dimensionality issues called a Principal Components Analysis, or PCA. When NCA is used in conjunction with the K-neighbors classifier, it is elegant, simple and powerful; no complications from additional parameters requiring fine-tuning. There is also the tremendous added benefit of being able to handle multi-class problems without any increase in model size.</p><p>Further refinements, such as the Nearest Centroid classifier (yet another supervised application of this model), only drive home the point that this family of algorithms is foundational in ML. We are pushing into increasingly advanced territory, and I would refer you to sk-learn’s documentation linked below to delve deeper.</p><p><strong>Works Referenced:</strong></p><p><a href="https://www.kaggle.com/shrutimechlearn/step-by-step-diabetes-classification-knn-detailed">Step by Step Diabetes Classification-KNN-detailed</a>, Shruti Iyyer.</p><p><a href="https://sebastianraschka.com/pdf/manuscripts/model-eval.pdf">Model evaluation, model selection, and algorithm selection in machine learning</a>, Sebastian Raschka.</p><p><a href="https://towardsdatascience.com/a-short-introduction-to-model-selection-bb1bb9c73376">A “short” introduction to model selection</a>, David Schönleber.</p><p><a href="https://kevinzakka.github.io/2016/07/13/k-nearest-neighbor/">A Complete Guide to K-Nearest-Neighbors with Applications in Python and R</a>, Kevin Zakka.</p><p><a href="https://scikit-learn.org/stable/modules/neighbors.html#nearest-neighbor-algorithms">Scikit-Learn’s K-nearest neighbors algorithms</a></p><p><a href="http://www.arc2020.eu/counting-apples-or-oranges-climate-change-stats-vs-food-systems-thinking/">http://www.arc2020.eu/counting-apples-or-oranges-climate-change-stats-vs-food-systems-thinking/</a></p><p><a href="https://www.python-course.eu/k_nearest_neighbor_classifier.php">https://www.python-course.eu/k_nearest_neighbor_classifier.php</a></p><p><a href="https://ionds.com/wp-content/uploads/2016/10/Overfitting-image-model-case-300x300.png">https://ionds.com/wp-content/uploads/2016/10/Overfitting-image-model-case-300x300.png</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d3024d78745" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/model-selection-tuning-and-evaluation-in-k-nearest-neighbors-6d3024d78745">Model Selection, Tuning and Evaluation in K-Nearest Neighbors</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Primary, Unique and Foreign Keys and Grouping When Working With Data Sets]]></title>
            <link>https://medium.com/data-science/primary-unique-and-foreign-keys-and-grouping-when-working-with-data-sets-c4a7db3051a6?source=rss-4ec2049b428f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4a7db3051a6</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Harrison Hardin]]></dc:creator>
            <pubDate>Tue, 11 Jun 2019 19:59:04 GMT</pubDate>
            <atom:updated>2019-08-22T23:34:44.396Z</atom:updated>
            <content:encoded><![CDATA[<h3>Primary, Unique and Foreign Keys and Grouping When Working With Datasets</h3><p>A key skill for analyzing any dataset is knowing how to group subsets of your data effectively. In the case of SQL databases, there are different indexes that you often need to uniquely identify various elements within their respective tables. Working on a recent project involving the <a href="https://www.kaggle.com/hugomathien/soccer/downloads/soccer.zip/10">European Soccer Database</a> afforded me the opportunity to further examine the difference between Primary, Unique and Foreign Keys. I was able to practice splitting up some of these groupings based off of Foreign Keys for further analysis. What follows is a tutorial on all types of database Keys and some grouping techniques through the lens of my <a href="https://github.com/harrisonhardin/Project03">pairwork</a> project.</p><p>First, I’ll touch on differences in the three Key types mentioned above. When you need to group data for some kind of analysis, it is important to bear in mind a few things about the nature of database keys. One of the first things you do in the process of cleaning data so that it’s malleable is to check for missing values and deal with those values in an appropriate manner. If you are ever working with a Primary Key in a dataset, it is important to realize that missing values (often appearing as Null or NaN — meaning Not a Number) are not something you have to worry about with the Key itself. That’s true for Foreign Keys as well, because Foreign Keys are just Primary Keys that are being referenced in a table other than the one they originate in. Each table can only have one Primary Key, but there can be more than one of both Foreign and Unique Keys. Unique Keys are permitted to have one missing value, but not more than that. This is as true for missing values as it is for other types of values: it is called “unique” precisely because each value must be distinct. All of this is to say that when you need a Key for your data grouping, the cleaning up of missing values is negligible. You will have at most one missing piece of data to deal with, and that is only if the type of Key you are working with is a Unique Key.</p><p>In this project, one of the directions I took my analysis in involved using a Foreign Key to group games by both home and away team, although I only ended up needing the home team’s games because I was interested in looking at wins at home versus all other game result types (which would consist of away wins, losses at home, home draws and away draws). The parallel grouping for away games is included in the snippet below just to further reinforce the concept, even though it didn’t figure into my analysis.</p><pre>games_home = df.groupby(df.home_team_api_id) <br>games_away = df.groupby(df.away_team_api_id) </pre><p>The author of the dataset, Hugo Mathien, sheds some light on the naming convention used here in this quote from the Kaggle page (which is linked to above):</p><blockquote>“When you have a look at the database, you will notice Foreign Keys for players and matches are the same as the original data sources. I have called those Foreign Keys ‘api_id’.”</blockquote><p>API is an acronym for Application Program Interface, and in this case refers to the resource he referenced in the first place to create that part of the dataset. Another example of this could be something like <a href="https://darksky.net/dev">Dark Sky</a>, a weather API that allows you to access historical weather data and forecasts. I have used this in conjunction with a different Soccer dataset in another team-based project to make predictions about the outcomes of games, but let’s get back to the example at hand.</p><p>Once the home games have been sliced by that Foreign Key, I got the individual teams with the following code:</p><pre>team_ids = list(games_home.groups.keys()) </pre><p>From there, I made sure that the data provided about goals was complete and that no missing information needed to be dealt with. Then, it was on to calculating and storing percentages of wins at home. All other game results were easily calculated as the complement of the home percentages metric by subtracting from 1:</p><pre>#This returns 0 values that are missing for either column</pre><pre>df[[&#39;home_team_goal&#39;, &#39;away_team_goal&#39;]].isna().sum() </pre><pre>#So I go on to calculate a new column for victories at home</pre><pre>df[&#39;HomeWin&#39;]=df.home_team_goal&gt;df.away_team_goal</pre><pre>#Loop through to obtain home wins by team</pre><pre>for team in team_ids:       </pre><pre>  x=games_home.get_group(team)</pre><pre>home_percentage=x.HomeWin.sum()/len(x.HomeWin) </pre><p>Ultimately, the conclusion I arrived at isn’t extremely shocking: playing at home offers a statistically significant advantage at your chances of winning. The real value was in getting practice working with large SQL datasets, grouping by Foreign Keys, and using logic inside of Python functions to gain insight.</p><p>When not dealing with Keys, which in a worse case scenario will have a single NaN, there are often lots of missing values that need to be handled in a manner best suited for the task at hand, whether that be simply dropping them, replacing them with the mean or possibly the median. It depends on what specific type of analysis you’re performing. If you have several outliers of note, it is best to do median replacement of null values. This gets into a deeper discussion about levels of imputation. Sometimes it is important to think about the reason the data is missing rather than jumping to replacing it. Although outside the scope of this post, there is an even more nuanced approach to use called multiple imputation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*okICVuVAePcWmjCiuOiq8w.png" /><figcaption>Screenshot from a dbdiagram.io schema crawler of some of the tables in the Data Set and how they connect</figcaption></figure><p>The last morsel of dataset knowledge I’d like to touch on is how one goes about grouping by categorical data for the purpose of studying each category by statistical metrics. Let’s take a look at some commented code from my project:</p><pre>#First, set up columns to see who won (same as above), and who lost or drew</pre><pre>df[‘AwayWin’]=df.away_team_goal&gt;df.home_team_goal<br>df[‘Draw’]=df.home_team_goal==df.away_team_goal</pre><pre>#Then, create a new category</pre><pre>df[&#39;GameOutcomes&#39;]=df[[&#39;HomeWin&#39;, &#39;AwayWin&#39;, &#39;Draw&#39;]]</pre><pre>#Group dataset by result of games</pre><pre>game_groups=df.groupby(df[&#39;GameOutcomes&#39;])</pre><pre>#Discover insights about the rest of the dataset, for example by looking at the mean:</pre><pre>game_groups.mean()</pre><p>What this does in effect is allow you to see the mean value of three categories, a win at home, a loss at home (in other words an away win) or a draw, grouped so as to show how they impact the other variables in the Match table. You could look at the changes in the mean of your preferred team’s victories by season, or perhaps investigate how their possession differs in wins versus draws (possession is a metric listed below the home_player columns in my screenshot above). It should be noted that in my analysis of home-field advantage, I took this code a step further and added the home win percentage and its complement to a dictionary for each team, and transposed that dictionary in order to make it into its own Data Frame. These can be seen in the GitHub repository linked in the first paragraph.</p><p>My <a href="https://www.linkedin.com/in/harrisonhardin/">LinkedIn</a></p><p><strong>Resources consulted:</strong></p><p><a href="https://stats.stackexchange.com/questions/143700/which-is-better-replacement-by-mean-and-replacement-by-median"><em>https://stats.stackexchange.com/questions/143700/which-is-better-replacement-by-mean-and-replacement-by-median</em></a></p><p><a href="https://codingsight.com/the-difference-between-primary-key-and-unique-key/"><em>https://codingsight.com/the-difference-between-primary-key-and-unique-key/</em></a></p><p><a href="https://www.youtube.com/watch?v=u9nftlpCdXQ"><em>https://www.youtube.com/watch?v=u9nftlpCdXQ</em></a></p><p>And a special thank you to my partner on the project, Joe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4a7db3051a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/primary-unique-and-foreign-keys-and-grouping-when-working-with-data-sets-c4a7db3051a6">Primary, Unique and Foreign Keys and Grouping When Working With Data Sets</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>