<?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 Tara Greenwood on Medium]]></title>
        <description><![CDATA[Stories by Tara Greenwood on Medium]]></description>
        <link>https://medium.com/@taragreenwood?source=rss-aa59e2508daa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*EPDTiQ4_Vnu9CzDE</url>
            <title>Stories by Tara Greenwood on Medium</title>
            <link>https://medium.com/@taragreenwood?source=rss-aa59e2508daa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:34:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@taragreenwood/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[Fast feature selection using fractal dimension]]></title>
            <link>https://medium.com/@taragreenwood/fast-feature-selection-using-fractal-dimension-a83aa55f7a4?source=rss-aa59e2508daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/a83aa55f7a4</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Tara Greenwood]]></dc:creator>
            <pubDate>Wed, 12 Jun 2019 22:51:57 GMT</pubDate>
            <atom:updated>2019-06-12T23:19:38.962Z</atom:updated>
            <content:encoded><![CDATA[<p>A summary of the paper by:</p><p>Traina, Caetano, Traina, Wu, Christos, &amp; Agma. (2002, October 01). Fast feature selection using fractal dimension. Retrieved from <a href="https://kilthub.cmu.edu/articles/Fast_feature_selection_using_fractal_dimension/6605570">https://kilthub.cmu.edu/articles/Fast_feature_selection_using_fractal_dimension/6605570</a></p><p><strong>Big Data and the Curse of Dimensionality</strong></p><p>What data features are most relevant to us? Whether we’re analyzing big data for the first time or analyzing the same data for other qualities, our list of parameters can really bloat. I have personally auto-encoded my dataset until my table had more than a thousand columns. This can increase computation cost, scale badly for additional data, and decrease model performance due to redundancy in the data’s attributes. There are several methods to reduce this dimension such as Principal Components Analysis, Factor Analysis, and Artificial Neural Networks. Today we’ll look at another method.</p><p><strong>Use of Fractal Dimensions</strong></p><p>Fractals are self-similar objects embedded in a dimension space E. Let’s look at the classic Sierpiński carpet embedded in 2 dimensions.</p><pre>import pillow as PIL</pre><pre>from PIL import Image<br>from PIL import ImageDraw</pre><pre>def save_animated_gif(filename, images, duration):<br>    # done using <a href="https://pillow.readthedocs.io/en/latest/handbook/image-file-formats.html#saving">https://pillow.readthedocs.io/en/latest/handbook/image-file-formats.html#saving</a><br>    first_image = images[0]<br>    other_images = images[1:]<br>    first_image.save(filename, save_all=True, append_images=other_images, duration=duration, loop=0)</pre><pre>def make_pattern(draw, x, y, section_size, remaining_levels):<br>    if remaining_levels &lt;= 0:<br>        return<br>    hole_color = (5, 205, 65)<br>    corner = (x + section_size / 3, y + section_size / 3)<br>    # -1 necessary due to <a href="https://github.com/python-pillow/Pillow/issues/3597">https://github.com/python-pillow/Pillow/issues/3597</a><br>    opposite_corner = (x + section_size * 2/3 - 1, y + section_size * 2/3 - 1)<br>    draw.rectangle((corner, opposite_corner), fill=hole_color)<br>    parts = 3<br>    for x_index in range(parts):<br>        for y_index in range(parts):<br>            x_anchor = x + section_size * x_index / parts<br>            y_anchor = y + section_size * y_index / parts<br>            new_size = section_size / 3<br>            new_levels = remaining_levels - 1<br>            make_pattern(draw, x_anchor, y_anchor, new_size, new_levels)</pre><pre>def make_carpet(levels, size):<br>    carpet_color = (5, 60, 20)<br>    carpet = Image.new(&quot;RGBA&quot;, (size, size), carpet_color)<br>    draw = ImageDraw.Draw(carpet)<br>    make_pattern(draw, 0, 0, size, levels)<br>    return carpet</pre><pre>levels = 7<br>size = 3**levels<br>carpets = []<br>carpets.append(make_carpet(0, size))<br>standard_frame_time_in_ms = 1200<br>durations = [standard_frame_time_in_ms / 2] # first stage visible for a short time<br>for i in range(levels - 1):<br>    carpets.append(make_carpet(i + 1, size))<br>    durations.append(standard_frame_time_in_ms)<br>durations[-1] *= 4 # final stage of animation visible for a long time</pre><pre>save_animated_gif(&quot;Sierpiński&#39;s carpet.gif&quot;, carpets, durations)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zY6PSWqPwlmmgQDhIDf2Hw.gif" /><figcaption>Sierpiński’s carpet fractal animation for teaching Python 3 from <a href="https://codereview.stackexchange.com/questions/212564/sierpi%C5%84skis-carpet-fractal-animation-for-teaching-python-3">https://codereview.stackexchange.com/questions/212564/sierpi%C5%84skis-carpet-fractal-animation-for-teaching-python-3</a></figcaption></figure><p>It’s made quite simply. Divide the surface into 3 parts for each dimension (r =3, E =2). This removes 1 square of the original 9 (r^E) squares, leaving 8 (k). The fractal dimension is ln(k)/ ln(r), in this case. ln this case it’s (8)/ln(3), approximately 1.8928.</p><p><strong>Approximate the Fractal Dimension of a Dataset</strong></p><p>Real data isn’t infinitely self-similar; it’s noisy. The box-counting algorithm is the most common way to approximate an object (in this case, a dataset). The authors of the paper used it like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHFmH1w9DH50POdqzC2ohA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqdrgQQMgtWhb6LEDrjPNQ.png" /></figure><p>In other words:<br>1. Plot points into the original number of attributes E, known as the embedded dimension space. Since the dataset values aren’t infinite, the resulting surface is bounded.<br>2. Divide the surface of our dataset into equal parts with edge length r, resulting in a “hypergrid” of r^(E-1) boxes.<br>3. Count only the boxes which contain at least one point.<br>4. Divide those boxes into r^(E-1) individual boxes.<br>5. Iterate this E times.<br>5. Count how many boxes that leaves us. If the attributes are truly independent of each other, they will not share a box. This represents the Correlation Integral, S(r). <br>6. Take the derivative of that integral, we use the fact that the natural log of S(r) is proportional to the natural log of (r) by some linear factor.<br>Divide ln(S(r)) by ln(r) and we have our approximation of the Intrinsic Dimensionality of our dataset! This is also called the Correlation Fractal dimension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IK40amVe8BNYBbvYXoLUHw.png" /></figure><p>Round that fraction up to the nearest integer J and you have the minimum number of attributes needed to represent your dataset.</p><p>Next, we sort those features by order of importance and discard the lowest until you have the top J features:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGFbMsFxMeU0ASbhu6QMZA.png" /></figure><p>Essentially:</p><ol><li>One by one, take one of the E features out and compute the partial fractal dimension of our dataset with respect to the other E-1 features.</li><li>Select the grouping with the partial fractal dimension closest to the overall fractal dimension.</li><li>Iterate this process until we have J features.</li><li>What we have left are the most important features.</li></ol><p>Excitingly, these are from the <em>original features</em>. They are<em> human readable</em>. After all the unsupervised learning we’re exposed to, seeing an explicit list of key information points is quite exciting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a83aa55f7a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Datasaurus Dozen: Back at it with Bootstrapping]]></title>
            <link>https://medium.com/@taragreenwood/the-datasaurus-dozen-back-at-it-with-bootstrapping-d09b1940cfc7?source=rss-aa59e2508daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/d09b1940cfc7</guid>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Tara Greenwood]]></dc:creator>
            <pubDate>Tue, 21 May 2019 20:01:56 GMT</pubDate>
            <atom:updated>2019-05-21T20:22:30.259Z</atom:updated>
            <content:encoded><![CDATA[<p>The Datasaurus Dozen: Back at it with Bootstrapping</p><p>This is part two of a series on the Datasaurus dozen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VN9kbN1NS7WP7BWRJbMx7g.gif" /><figcaption>This set</figcaption></figure><p>Part one is here</p><p><a href="https://medium.com/@taragreenwood/the-big-picture-the-small-pictures-and-the-numbers-that-dont-matter-795066524257">://medium.com/@taragreenwood/the-big-picture-the-small-pictures-and-the-numbers-that-dont-matter-795066524257</a></p><p>We left off with evidence of the amalgamation paradox at play within our overall dataset (which I called ‘tablesaur’ in the notebook to distinguish it from each of the separate datasets contained within). What can we do to address this?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F78ru4cs-7iuzpf5nGAxlg.png" /></figure><p>I didn’t feel like I had an intuitive sense of Analysis of Variance (ANOVA) and bootstrapping from my coursework, so I decided to do a tutorial applying those tools to the Datasaurus Dozen.</p><p>Here we’ll run an ANOVA test on the original tablesaur. ANOVA seems like a good test because tablesaur has distinct groups. Null hypothesis: There is no difference (alpha = 0.05) between the distribution of a given (or named) subset and the distribution of another. Next, we’ll bootstrap each individual dataset, concatenate them all together into ‘megaset,’ and run a new ANOVA test with Null hypothesis: There is no difference (alpha = 0.05) between the distribution of a bootstrapped dataset and the distribution of another.</p><p>Intuitively, I expect the initial ANOVA test to fail to reject the null hypothesis, while the bootstrapped ANOVA test rejects the null hypothesis. Let’s see what really happens.</p><p>About ANOVA:</p><p>You may be familiar with the t-test, which is a way to compare the means of two different groups. ANOVA is similar, except it can compare more than two groups. Tablesaur contains 13 datasets with 142 rows each (maybe they could have called it the Datasaurus Baker’s Dozen). Don’t forget that the means and standard deviations of each of the datasets within tablesaur have the same mean, variance, correlation and regression line to two decimal places. I checked.</p><p>Here’s a breakdown of ANOVA’s elements:</p><ul><li>MT: total mean. This is also the mean of the means of any grouping.</li><li>SST: total sum of squares. Take the difference between each point and MT, square each one, and add them all together.</li><li>DFT: total degrees of freedom. This is the number of points minus one. Thinking of our points as an m by n matrix, this is m*n -1.</li><li>For tablesaurus, this is (13*142) -1 = 1845</li><li>MW: mean within, or the mean of a given subset.</li><li>SSW: sum of squares within. Take the difference between each point of a subset and its MW, square each one, and add them all together.</li><li>DFW: degrees of freedom within. If there are m subsets of length n, this is m*(n-1) = mn -m</li><li>For tablesaurus, this is 13(142 -1) = 1833</li><li>SSB: sum of squares between. Take the difference between each MW and the MT, square each it, and add them all together.</li><li>DFB: degrees of freedom between. If there are m subsets of length n, this is m-1.</li><li>For each subset, this is 13 -1 = 12.</li><li>SST = SSW+SSB</li><li>DFT = DFW + DFB</li><li>Calculated F value = (SSW/DFW)/(SSB/DFB) = (variance of the group means (Mean Square Between) )/ (mean of the within group variances (Mean Squared Error))</li><li>For tablesaurus, this is (SSW/1833)/(SSB/12).</li><li>Critical F-value: This takes in our alpha value, DFW, and DFB. Here’s a table. <a href="http://www.socr.ucla.edu/Applets.dir/F_Table.html#FTable0.05">http://www.socr.ucla.edu/Applets.dir/F_Table.html#FTable0.05</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*FvclC6mui2r_d8txN14EHg.jpeg" /></figure><ul><li>Because we have so many degrees of freedom, our critical F-value is very slightly above 1.</li><li>If our critical F-value is smaller than the calculated F-value, we can reject the null hypothesis.</li></ul><p>About Bootstrapping:</p><p>Recall that the Central Limit Theorem states that the distribution of the mean of a random sample from a population with finite variance is approximately normally distributed when the sample size is large, regardless of the shape of the population’s distribution.</p><p>If we are concerned that the means of our sample distributions may not be normal and representative of the theoretical population’s distribution, we may deploy bootstrapping.</p><p>Bootstrapping is a resampling method that relies on random sampling with replacement. Each resample involves drawing one point from the sample set, adding that to a resample dataset, replacing it, and doing it again for as many times as there are points in the original sample set.</p><p>The more times we resample the data (the more resamples we generate), the more the distribution of means resembles a normal distribution. Let n=number of resamples. As the limit of n goes to infinity, the distribution of sample means smooths out to a (continuous) normal distribution. This may remind us of the way calculus like to add a number approaching infinity of discrete pieces of sizes approaching zero to approach a continuous (and therefore differentiable) surface.</p><p>I decided to deploy aspects of bootstrapping for our datasets because I suspected that sampling bias was leading to the amalgamation paradox we ran into.</p><p>Generally, bootstrapping is used to output an arrays of means which can be compared to each other. In this case I used its ideas to output a large array of x and y values sampled from each dataset instead so I could analyze the collection of resamples in the same way I did with the original datasets. For example, the “Slant_up” dataset of 142 rows was resampled to make the ‘Bootstrapped_slant_up” dataset of 10,000 rows. The idea is that the ‘Bootstrapped_slant_up” dataset represents a less-biased sample from each the “Slant_up” dataset’s hypothetical population.</p><p>Results:</p><p>The initial ANOVA test on “Tablesaur” failed to reject the null hypothesis. However, the ANOVA test run on the bootstrapped “Megaset” rejected the null hypothesis; implying there may be a difference between the distribution of one dataset and another. I hope you find this conclusion as satisfying as I did.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d09b1940cfc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The big picture, the small pictures, and the numbers that don’t matter]]></title>
            <link>https://medium.com/@taragreenwood/the-big-picture-the-small-pictures-and-the-numbers-that-dont-matter-795066524257?source=rss-aa59e2508daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/795066524257</guid>
            <category><![CDATA[flatiron-school]]></category>
            <category><![CDATA[autodesk]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Tara Greenwood]]></dc:creator>
            <pubDate>Mon, 06 May 2019 08:49:06 GMT</pubDate>
            <atom:updated>2019-05-20T17:55:58.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BQP4X78hMbIcSdQcjjfqg.gif" /><figcaption>Source: Autodesk Research</figcaption></figure><p>I LOVE abstract thinking. Finding and applying patterns is how I turn data into information. By relying on summary statistics alone we can turn data into <em>misinformation</em>. We’ll look at some fun examples to (literally) illustrate the importance of looking at your total dataset, getting feedback on your results, and looking again.</p><p>In 1973, Francis Anscombe made a quartet of eleven-point datasets that can be described with the same four values of mean, variance, correlation, and best fit line, but they are visually quite different. X1 shows a simple linear relationship with a fairly normal distribution; However, X2 doesn’t have a normal distribution or a linear relationship; X3 has a linear relationship, but one outlier throws off its best fit line; and X4 shows an even more extreme example of a non-normal distribution and a single outlier’s influence on the line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1_mEiQAEU8y21Ku9iYjgQ.png" /><figcaption>This graphic represents the four datasets defined by Francis Anscombe for which some of the usual statistical properties (mean, variance, correlation and regression line) are the same, even though the datasets are different. Reference: Anscombe, Francis J. (1973) Graphs in statistical analysis. American Statistician, 27, 17–21.</figcaption></figure><p>We don’t actually know how Anscombe made those datasets. Now there’s a great site, <a href="http://robertgrantstats.co.uk/drawmydata.html">DrawMyData</a>, where we can create a dataset with specific stats by clicking points on the graph until we get the summary stats we want, then export it as a csv file. Thanks Robert Grant! <a href="http://www.thefunctionalart.com/2016/08/download-datasaurus-never-trust-summary.html">Alberto Cairo</a> used that to update the quartet with a charismatic set called the Datasaurus:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDTGOXhkBBWWPo7TsMK4yQ.png" /><figcaption>It must have taken a while.</figcaption></figure><p>In <a href="https://www.autodeskresearch.com/publications/samestats">“Same Stats, Different Graphs: Generating Datasets with Varied Appearance and Identical Statistics through Simulated Annealing</a>,” Autodesk researchers Justin Matejka and Geroge Fitzmaurice took that Datasaurus set as a starting point and used 200,000 perturbations to produce the Datasaurus Dozen. The Datasaurus Dozen adds eleven new shapes with the same summary statistics. This whole dataset is available for <a href="https://www.autodeskresearch.com/sites/default/files/SameStats-DifferentGraphs.pdf">download</a> with the names of each subset and x-y coordinates. Here is my scatterplot of the whole set with its best-fit line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Nqg6lwieXf8PptHnpzPJw.png" /><figcaption>Pictured: ‘dino’, ‘away’, ‘h_lines’, ‘v_lines’, ‘x_shape’, ‘star’,<br> ‘high_lines’, ‘dots’, ‘circle’, ‘bullseye’, ‘slant_up’,<br> ‘slant_down’, ‘wide_lines’</figcaption></figure><p>Clearly, it is not a very well-fitting line. Suppose this model is accepted anyway, and that a given subset with those same stats is assumed to look similar. Remember, there are twelve distinct-looking datasets hidden in that messy scatterplot (you’ll see them at the end; it’s worth it). If someone were familiar with a specific dataset, they may argue for a different linear correlation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLacqtiVpTbSAKy4c1n61w.png" /><figcaption>Not pictured: better-fit line</figcaption></figure><p>This gives us an example of the Amalgamation Paradox (or Simpson’s paradox). The Amalgamation Paradox is a statistical a phenomenon where a certain trend appears in different groups of data but reverses when they are added together. Here’s a classic example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*eCNTS0N4ggWJtZd4uF3Nng.jpeg" /><figcaption>Source: Wikipedia</figcaption></figure><p>And here is an example within our own data subset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F78ru4cs-7iuzpf5nGAxlg.png" /><figcaption>The red dots represent the best of six lucky guesses.</figcaption></figure><p>The amalgamation paradox tells us there may be some confounding variables at play. In the case of the datasaurus dozen, it’s sampling bias. Matejka and Fitzmaurice put a lot of work into biasing each subset’s distribution until it had the same stats as the whole set. This is some truly beautiful sampling bias:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1Ay6MqLn2YDyde2_K6neA.gif" /><figcaption>Look at what you can do with 200,000 perturbations!</figcaption></figure><p>To wrap this up, it may not be enough to take the first look at our data. If our predictions are coming up strange and inconsistent, the next step may be to examine subsets in isolation. For data scientists and pattern enthusiasts, chasing down confounding variables is all part of the game.</p><p>You can see my repository on GitHub: <a href="https://github.com/TSGreenwood/datasaurus_visual_explorations">https://github.com/TSGreenwood/datasaurus_visual_explorations</a></p><p>References:</p><ul><li>F. J. Anscombe (1973) Graphs in Statistical Analysis, The American Statistician, 27:1, 17–21, DOI: <a href="https://doi.org/10.1080/00031305.1973.10478966">10.1080/00031305.1973.10478966</a></li><li>Amy E. Michel Taylor, Stanley A. “Simpson‘s Paradox: A Data Set and Discrimination Case Study Exercise.” Journal of Statistics Education,<br>2014.</li><li>Justin Matejka, George Fitzmaurice (2017) “Same Stats, Different Graphs: Generating Datasets with Varied Appearance and Identical Statistics through Simulated Annealing”<br>CHI 2017 Conference proceedings:<br>ACM SIGCHI Conference on Human Factors in Computing Systems</li><li><a href="http://robertgrantstats.co.uk/drawmydata.html">http://robertgrantstats.co.uk/drawmydata.html</a></li><li><a href="http://www.thefunctionalart.com/2016/08/download-datasaurus-never-trust-summary.html">http://www.thefunctionalart.com/2016/08/download-datasaurus-never-trust-summary.html</a></li><li>Wikipedia contributors, “Anscombe’s quartet,” <em>Wikipedia, The Free Encyclopedia,</em> <a href="https://en.wikipedia.org/w/index.php?title=Anscombe%27s_quartet&amp;oldid=894599492">https://en.wikipedia.org/w/index.php?title=Anscombe%27s_quartet&amp;oldid=894599492</a> (accessed May 3, 2019).</li><li>Wikipedia contributors. “Simpson’s paradox.” <em>Wikipedia, The Free Encyclopedia</em>. Wikipedia, The Free Encyclopedia, 25 Apr. 2019. Web. 13 May. 2019.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=795066524257" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Too Big to See]]></title>
            <link>https://medium.com/@taragreenwood/too-big-to-see-fc93975c54b5?source=rss-aa59e2508daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc93975c54b5</guid>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Tara Greenwood]]></dc:creator>
            <pubDate>Thu, 25 Apr 2019 17:33:05 GMT</pubDate>
            <atom:updated>2019-04-25T17:57:30.330Z</atom:updated>
            <content:encoded><![CDATA[<p><em>starting in data science</em></p><p>People want good jobs. But once our basic needs are met we ache to find our vocation; the role we feel called to, built for, something that makes use of past adversities. I don’t need to echo the buzz around “the sexiest job of the 21st century.” I’m here to work, learn, and prosper. I’m motivated by the thrill of sensing new horizons, the need to turn my own struggles into tools for a new frontier, and the urgency of bringing in ethics for our new powers.</p><p>Science is a way of perceiving truths that we couldn’t sense directly. Who would look at a flat horizon and instinctively know they stood on something spherical? Who would guess that acceleration isn’t linearly dependent on speed, but it on the square of your velocity? How much introspection would it take for me to realize that I’m filled with tiny lifeforms, with their own agendas? What do I think I know, and how do I prove myself wrong?</p><p>With an autistic brain I can’t ignore things as well as others seem to. The noise is noisier, the music is stranger. Everything is connected in some secretive way. Once I notice underlying systems I can never unsee them. Similar structures keep popping up with totally different parts. Cars in traffic exhibit viscosity of flow. Adaptive networks grow like trees branching. Cells function like cities. <br>We live many lives in our lifetime. I grew up the first time in extreme poverty in rural America, in a sort of shadow of generational trauma. I was removed and placed in a different setting with entirely different people. For poor people and the working class, the same efforts produced very different outcomes. To me, malice and greed don’t explain this divergence as well as calculus does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrGzFyErMUQLl0wJqpXaiA.png" /><figcaption>Vector field examples from <a href="https://mathematica.stackexchange.com/questions/24099/smoothing-averaging-2d-vector-fields">mathematica.stackexchange.com/questions/24099/smoothing-averaging-2d-vector-fields</a></figcaption></figure><p>Four years ago I moved to Seattle, where the booming tech industry brings record-high income inequality. I’m friends with techies, I’m turning into one. For better or worse, I am coming in to power.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*17SELsJWz3i0toFnxcTllQ.jpeg" /><figcaption>Look familiar?</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*IRSd6DExGvh5R0wT2KP5Ug.jpeg" /><figcaption>How about now?</figcaption></figure><p>Systemic inequality is just as compelling as fish schooling, bees swarming, or turbulent and laminar flows. They’re all nonlinear; you can’t add back what was subtracted to return to an earlier state. The technological leaders are shaping society in ways they never prepared for. There’s no holding still in fast waters and we can’t stay naive. We have better tools to address human problems than guilt and obligation. Let’s use them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*iVrJyHvn9JDSrwIgbMEyqg.jpeg" /><figcaption>Not prepared for this.</figcaption></figure><p>I’m learning data science because I’m personally overwhelmed by data and by a love of science. I can’t turn off systems thinking when I walk out of the office (not that I fit in at an office anyway). I’m driven to use my own tragedies, shortcomings, and alienation for perspective in a rapidly changing world. We all want to turn the bugs in our personal code into features.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc93975c54b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Project at Flatiron Data Science]]></title>
            <link>https://medium.com/@taragreenwood/first-project-at-flatiron-data-science-6f36f472a660?source=rss-aa59e2508daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f36f472a660</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[king-county]]></category>
            <category><![CDATA[flatiron-school]]></category>
            <dc:creator><![CDATA[Tara Greenwood]]></dc:creator>
            <pubDate>Fri, 19 Apr 2019 19:26:30 GMT</pubDate>
            <atom:updated>2019-04-19T19:26:30.912Z</atom:updated>
            <content:encoded><![CDATA[<p>Patrick Fuller and I used a dataset from the King County Assessor’s office House Data 2014- 2015 to build, train and test models in order to predict the price of houses. To quantify each model’s performance we used Mean Absolute Error. Effectively we could say “given a dwelling with these pieces of information, we expect the price to be this value, plus or minus MAE dollars.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s9-aXeFFYl8OP1LN3uoipQ.jpeg" /><figcaption>Here’s a house, photo credit Wikimedia Commons</figcaption></figure><p>In keeping with the CRoss-Industry Standard Process for Data Mining (CRISP-DM) process, we first looked at our dataset to make sense of it. Most of it was about what you would expect; square foot living space, zip code, number of bedrooms, square footage of neighboring houses, number of floors, etc.</p><p>Comparing the values brought up some surprises. All of the listings stated at least one bedroom, but the square footage was so low that they were probably studios. We dropped that column and its questionable data integrity. Lot size with the square footage often showed VERY different values, in many cases these were probably condos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sD5dj5mgAgjR_Tr4FCpixA.jpeg" /><figcaption>Enjoy life in your 1 bedroom on a 13,752 sqft lot! (Image credit Elaine Thompson, Associated Press)</figcaption></figure><p>Here’s a scatter matrix comparing suitable columns to price:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*NL4s5imZ1uC7WfQxCPcc3g.png" /><figcaption>Nice.</figcaption></figure><p>Data Preparation:</p><p>Of these, “sqft_living,” “”sqft_living15,” “bathrooms,” and “grade” were the best candidates. However, the distributions were not very normal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*sv2p4MGmG9w3pocsmliklA.png" /></figure><p>It’s common to take the natural log of weird values to make sense of the scale while maintaining maxima and minima, so we tried that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*uQOesX5x6Z-SFORVTETLng.png" /><figcaption>Taking the natural log of values less than one looks less normal and more weird.</figcaption></figure><p>All the distribution improved, except that of bathrooms. This is probably because “full bath” usually means it has bathtub. If you just have a shower (and we hope you all have a shower) that value is less than one. Since log is an exponent, this gave us negative values.</p><p>Ultimately, the model improved using “log_price,” “log_sqft_living,” “log_sqft_living15,” “grade,” and bathrooms. Check out the scatter matrix now!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*_3NlNKNAnT0N54DKlsQ2RQ.png" /><figcaption>Nicer.</figcaption></figure><p>Zipcodes are essentially names made of numbers, so we one-hot encoded them. This essentially gave us unit vectors. Running a summary of their relationship to log_price, we took out any zipcodes with a p-value greater than 0.05.</p><p>Modeling:<br> With these columns to choose from we modeled several combinations to for multilinear regression with the aim of minimizing Mean Absolute Error. We built a function, feat_to_model_kfold_eval, which takes as arguments (target = “column name,” predictors = list of column names, df = dataframe, kvals = list of k-folds, show_summary = Boolean, price_logged = Boolean, MAE = Boolean). This returns the “best fit” line array with intercept and coefficients, total errors, MAE (in dollars) if True and RMSE if False. This enabled us to rapidly run, cross-validate, and compare models.</p><p>Our best model so far has given 5, 10, and 20 folds gave us intercept of 7.291932830800424, ‘log_sqft_living’ coefficient of 0.26169686659062574,<br>‘log_grade’ coefficient of 0.8551759986685104, ‘bathrooms’ coefficient of 0.003554448978285926, and list of about 78 zipcode coefficients which we won’t make you read. We feel confident about giving you a house price, plus or minus eighty-seven thousand dollars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68KrijS3RU7NB4schqYekg.jpeg" /><figcaption>Hey, if you live in Seattle you’re no stranger to housing uncertainty. (Photo credit <em>Matt M. McKnight, Crosscut)</em></figcaption></figure><p>With more iterations and perhaps some more data, we can come up with tighter models. We are all learning, all the time. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f36f472a660" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>