<?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 Theodore Brandon on Medium]]></title>
        <description><![CDATA[Stories by Theodore Brandon on Medium]]></description>
        <link>https://medium.com/@tedbrandon?source=rss-5ee16a455115------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cf5OxR9T5w_j65BYuj8yTg.png</url>
            <title>Stories by Theodore Brandon on Medium</title>
            <link>https://medium.com/@tedbrandon?source=rss-5ee16a455115------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:22:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tedbrandon/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[Hello Breast Cancer - Meet DeepMiner]]></title>
            <link>https://medium.com/@tedbrandon/hello-breast-cancer-meet-deepminer-ab0017c5aa76?source=rss-5ee16a455115------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab0017c5aa76</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[breast-cancer]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[medical-imaging]]></category>
            <dc:creator><![CDATA[Theodore Brandon]]></dc:creator>
            <pubDate>Thu, 11 Nov 2021 21:15:51 GMT</pubDate>
            <atom:updated>2021-11-11T21:15:51.218Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*ucIaKKVIAop10tNe.jpg" /></figure><p>As a data science student, it is easy to get so wrapped up in the learning process itself that I sometimes lose sight of real-world applications of the topics I study. As a former student of the “hard” sciences, it is difficult to let go of everything I learned in those fields. I find myself wanting to apply my new knowledge and skills to anything from astronomy and the massive amount of data that can be acquired by, say, the Hubble Space Telescope, to a much smaller scale, such as a single bacterial cell, somehow with a seemingly, equally massive amount of information that can be gleaned; when measured with the correct device. Fortunately, there are plenty of outlets when one has experience with the sciences, and the newly-acquired skills of a data scientist.</p><p>I came across a recent <a href="https://hdsr.mitpress.mit.edu/pub/myfmx2sk/release/1">article</a> published in the Harvard Data Science Review (HDSR), regarding a mixture of breast-cancer imaging and data science; how the latter might help improve and expedite the former, as early as possible. Not only was this an opportunity to study an interesting mix of both kinds of sciences, but it also brought me back to some of my earlier career/research on sex-steroid-hormones (i.e., estrogens) and their impact on breast cancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*z5vD971tFUltyEhH.jpg" /></figure><p><strong>DeepMiner/Neural Networks</strong></p><blockquote>We propose DeepMiner, a framework to discover interpretable representations in deep neural networks and to build explanations for medical predictions (Abstract from Wu, et al, 2021)</blockquote><p>Translation: DeepMiner uses a type of analysis called a “deep neural network” to make sense of acquired data, so the results can be applied to diagnoses/classifications in the world of medicine. A very nice explanation of neural networks can be found <a href="https://physicsworld.com/a/neural-networks-explained/">here</a>. In addition to being a component of AI, neural networks, which were designed to mimic the functionality of the human brain, are frequently referred to as “black-box” models in the world of data science. What does this mean? It means that, though we are the ones who program and create the code to make them work, once they use the provided data and start “thinking” on their own, we don’t always know exactly what they do, and the results they spit out can be very complicated.</p><p>A word of caution: though in many cases, very useful information is garnered, in others, useless results can be the output, so these still require some level of oversight. Interpretation of these results can be tricky, with any resultant medical decisions questionable. Therefore, a certain level of human oversight is still necessary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T5rHV9GGACVtFEXZ.jpg" /></figure><p>In the case of this study, DeepMiner was tasked with examining mammographic images, using them to classify any growths in the breast being examined. Classifications include <em>normal</em> (no findings of interest), <em>benign</em> (non-cancerous findings) and <em>malignant</em> (cancerous findings).</p><p><strong>The Process</strong></p><p>This analysis is broken down into three phases. As with other models, first came “training”. In this case, training consisted of exposure to image patches of previously-evaluated examples of all 3 specimen types, cropped from full mammograms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*KX6k8IZRBmhAVG8d" /><figcaption>DeepMiner processing. Image comes directly from the article</figcaption></figure><p>Next, once training was completed, one of the most potentially beneficial, time-saving aspects of this process was revealed. Human experts (a radiologist and a medical physicist specializing in mammography) parsed through a sampling of these images. In total, 2048 images were analyzed by DeepMiner, which was a bit unrealistic for the experts to review. Therefore, sampling for their examination included 60 images, 20 from each classification. This analysis generally takes a specialist about 1 minute per image, so parsing through 1,000s of images is a time-consuming task. If this technology became an industry standard, it would be a vastly time-saving improvement.</p><p>Finally, referring to these expert annotations, in relation to analyzed images, DeepMiner can explain and describe its classifications and predictions for future mammographic imaging. Generated <em>annotations</em> of 330 (50:50 benign:malignant) of these processed, DeepMiner-classified images were presented to experts, who were then tasked to classify cases as “malignant” or “benign”. Given solely these generated annotations, experts were able to correctly classify disease-state in 182 of the cases, which is a statistically-significant improvement over random guessing.</p><p><strong>The Future</strong></p><p>A future improvement to this process could include the addition of information provided by genetic testing for breast cancer risk. As an additional feature for DeepMiner to incorporate, this would only improve this process of detection and classification. Similarly, risk factors such as smoking status, age and BMI would be potentially beneficial. As the quality of this technology has nowhere to go but up, the future is bright for this process!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fnPt2PNEOTEAPwCr.jpg" /></figure><p>Lastly, one of the wonderful caveats of these results is that this technology has the potential to be applied to other medical imaging. Therefore, given time and resources, we could end up seeing this, and other developments like it, applied to many other processes in medicine, in the not-too-distant future. Stay tuned!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab0017c5aa76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DIY Happy Little Masterpieces:]]></title>
            <link>https://medium.com/@tedbrandon/diy-happy-little-masterpieces-6ef812374738?source=rss-5ee16a455115------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ef812374738</guid>
            <category><![CDATA[seaborn-tutorial]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[matplotlib]]></category>
            <category><![CDATA[matplotlib-tutorial]]></category>
            <category><![CDATA[seaborn]]></category>
            <dc:creator><![CDATA[Theodore Brandon]]></dc:creator>
            <pubDate>Mon, 18 Oct 2021 00:24:18 GMT</pubDate>
            <atom:updated>2021-10-18T00:26:45.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-DhLnblWLatLVKoLrtA3w.png" /></figure><p><em>A Matplotlib/Seaborn Tutorial</em></p><p>I genuinely enjoy the processes of data science; the data acquisition, getting familiar with the set, cleaning, modeling, interpreting and presenting results. It’s all just, fun! But my favorite part is probably the creation of visuals, which, for me are the easiest way to convey “the message” of the results. My <a href="https://medium.com/@tedbrandon/extracting-beauty-from-the-world-of-data-science-de3b985dabb3">previous blog</a>, provided a brief summary of the power of <a href="https://seaborn.pydata.org/index.html">Seaborn</a>, which is one of the cooler Libraries in Python (and yes, I am the authority on what is coolest in Python). The blog includes beautiful visuals, plenty of color and a fair amount of variety. While 2 small snippets of code were presented, what wasn’t provided was the amount of time, effort and patience that CAN go into creating a useful, aesthetically pleasing visual.</p><p>As a beginner, I have found that it takes literally hours, and seemingly endless searches to find all the necessary code to make really nice-looking visuals. However, thus far, it has been worth it to personalize these to my satisfaction. Since it has been so challenging and-time consuming for me to produce these, on the off-hand that another data scientist would like a resource for creating a plot with detailed personalization, a tutorial for the process is presented here. This includes two visuals that were quite rewarding to finalize.</p><p>Both visuals were developed from data analysis of house sales in King County, WA (May 2014 — May2015), via <a href="https://www.kaggle.com/harlfoxem/housesalesprediction">Kaggle</a>. This data-set includes information about the many features of houses for sale, including the sale price, which was the Target for this analysis. These tutorials will include segments of code, followed by the plots they produce. As each iteration increases in complexity, coding segments will increase in size, retaining the core of the previous version. Changed/added code will be emboldened.</p><p><strong>The Histogram</strong></p><p>A population density plot of sale price can be quickly prepared with a few lines of code. Labels will be necessary, so they’re included here as well:</p><pre>import matplotlib.pyplot as plt<br>import seaborn as sns</pre><pre># x is a dataframe consisting solely of the sale prices of these houses</pre><pre>fig, ax = plt.subplots(figsize=(20,15))<br>sns.histplot(x)<br>plt.xlabel(&#39;Sale Price ($)&#39;)<br>plt.ylabel(&#39;Count (homes sold)&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h331fyWq9wHShd8oscUAJA.png" /></figure><p>This is a reasonable start, but axes labels and tick marks are way too small, and there is no title. To remedy this, a list of parameters will need adjustments:</p><p><em>fontsize</em> = *integer* — makes the font larger or smaller</p><p><em>fontweight</em> = “bold” — creates a bold font</p><p><em>x </em>and/or <em>y</em>= *float* — adjusts x and/or y positions of titles and labels (Be careful with this. For our purposes, x and/or y must only be changed within title and label lines of code. If used in a line that references data, errors could result)</p><p><em>suptitle</em> = *string* — creates an upper title for the plot</p><p><em>title</em> = *string* — creates a lower title for the plot</p><p><em>x/yticks</em> — multiple attributes can be adjusted here. In this case,we’re just changing the font:</p><pre>fig, ax = plt.subplots(figsize=(20,15))<br><br># Suptitle is the upper, of the two styles<br><strong>fig.suptitle</strong>(&#39;King County Home Sale Prices:&#39;, <strong>fontsize=30</strong>, <strong>fontweight=&#39;bold&#39;,y=0.97</strong>)<br>sns.histplot(x)</pre><pre># plt.x/yticks adjusts the actual tick mark labeling<br>plt.xlabel(&#39;Sale Price ($)&#39;, <strong>fontsize=24, fontweight=&#39;bold</strong>&#39;)<br><strong>plt.xticks(fontsize=18)</strong><br>plt.ylabel(&#39;Count (homes sold)&#39;, <strong>fontsize=24,x=.95</strong>)<br><strong>plt.yticks(fontsize=18)</strong></pre><pre># title is the lower of the two styles<br><strong>plt.title(</strong>&#39;2014-2015&#39;<strong>, fontsize=24, fontweight=&#39;bold&#39;,y=1.015)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moumlftWRXpa9xJKu8mtNA.png" /></figure><p>Much easier to read and now we have a title. Next thing to address is the shape of this “peak”. There is a long tail, so changing the x-axis to log-scale should fix this and mold the peak into a more Gaussian shape. It looks like the default “bins” for this plot might not be ideal, as the “resolution” (jaggedness) of this peak could be improved:</p><p><em>log_scale</em> = *boolean* — set to True to change the scaling to logarithmic</p><p><em>element</em> = “poly” — “bars” is the default, “poly” smooths/blends vertical bars</p><p><em>bins</em> = *integer* — changes the way values are counted and combined. Experimenting with this parameter can have drastic effects, as seen in the following plots, with bins = 5, 25 and 100:</p><pre>fig, ax = plt.subplots(figsize=(20,15))<br>fig.suptitle(&#39;King County Home Sale Prices:&#39;, fontsize=30, fontweight=&#39;bold&#39;,y=0.97)</pre><pre># adjusting bins changes resolution, log_scale fits the peak into a #   gaussian shape, and poly smooths out the bin transitions<br>sns.histplot(x,<strong>bins=25, log_scale=True, element=&#39;poly&#39;)</strong><br>plt.xlabel(&#39;Sale Price ($)&#39;, fontsize=24, fontweight=&#39;bold&#39;)<br>plt.xticks(fontsize=18)<br>plt.ylabel(&#39;Count (homes sold)&#39;, fontsize=24,x=.95)<br>plt.yticks(fontsize=18)<br>plt.title(&#39;2014-2015 (Log-Scale) - 25 bins&#39;, fontsize=24, fontweight=&#39;bold&#39;,y=1.015)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHHaHwEbGjHiGBsAy_a8_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAZ2d2GkH1Eov9AL2t5NZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43j3ta4ptxitIXb88JKHwA.png" /><figcaption>Left to right: bins = 5, bins = 25, bins = 100. Finding the sweet-spot for bin# takes some experimentation</figcaption></figure><p>Overlaying plots and further customization can improve visual appeal and utility.</p><p><em>color</em> = *rainbow* — while there are many color choices built-in to this package, the incredibly versatile Hex color codes can also be used</p><p><em>kdeplot:</em> A kde (kernel density estimate) plot can be overlaid onto this histogram. Since the existing plot is log-scaled, this must be as well. In order for the overlaid plots to share the x-axis, the <em>ax.twinx()</em> must be used. A secondary y-axis (right-side of plot) can remain in place, but a secondary x-axis, while doable, can make some plots (including this one) less visually appealing. While the two plots may share the same axis, they must each be identified with independent assignments. In this case, <em>ax</em> = ax for the histogram and <em>ax</em> = ax2 for the kdeplot:</p><pre>fig, ax = plt.subplots(figsize=(20,15))<br>fig.suptitle(&#39;King County Home Sale Prices:&#39;, fontsize=30, fontweight=&#39;bold&#39;,y=0.97)</pre><pre># name the shared axis, and choose a color for the &quot;fill&quot;<br>sns.histplot(x, <strong>ax=ax</strong>, bins=25, <strong>color=&quot;#458D25&quot;</strong>, log_scale=True, element=&#39;poly&#39;)<br>plt.xlabel(&#39;Sale Price ($)&#39;, fontsize=24, fontweight=&#39;bold&#39;)<br>plt.xticks(fontsize=18)<br>plt.ylabel(&#39;Count (homes sold)&#39;, fontsize=24,x=.95)<br>plt.yticks(fontsize=18)</pre><pre># define second axes, as copies of the existing<br><strong>ax2 = ax.twinx()</strong></pre><pre># overlay a kdeplot, using same axes, and log-scale<strong><br>sns.kdeplot(x, ax=ax2, color=&quot;#552cbf&quot;, log_scale=True)</strong><br>plt.title(&#39;2014-2015 (Log-Scale)&#39;, fontsize=24, fontweight=&#39;bold&#39;,y=1.015)</pre><pre># A new y-axis (from kde) on the right needs customization<br><strong>plt.yticks(fontsize=18)<br>plt.ylabel(&#39;Density&#39;, fontsize=24,x=1.1)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pS60Eq8TWqjfNzk6SfXUIg.png" /></figure><p>This is looking very nice now. However, there is further customization that can be added here, if desired. Markers can be a nice addition to point out important aspects of the data. In this case, vertical lines showing the median and mean can be added. Additionally, if desired, the secondary axis can be blanked out by adding “plt.yticks([])” and “plt.ylabel(‘’)” after the kde has been added.</p><p><em>plot</em> = another plot that can be overlaid. In this case, it will be a vertical line from the x-axis, upwards to the edge of the histogram. ** Note: to make vertical/horizontal lines that span the entirety of the plot, <em>axvline</em>/<em>axhline</em> can be used. But to customize the span, <em>plot</em> worked best for me.</p><p><em>annotation</em> = allows for the addition of text to specific positions of the plot. This can include (amongst other things) arrows from the location of the text(<em>xytext</em>), to the location desired on the plot(<em>xy</em>). The arrow itself can be further customized. A summary of annotation options can be found <a href="https://matplotlib.org/stable/api/text_api.html?highlight=arrowprops">here</a>. Customization at this step, setting xy and xytext, can be a little cumbersome:</p><pre>fig, ax = plt.subplots(figsize=(20,15))<br>fig.suptitle(&#39;King County Home Sale Prices:&#39;, fontsize=30, fontweight=&#39;bold&#39;,y=0.97)<br>sns.histplot(x, ax=ax, bins=25, color=&quot;#458D25&quot;, log_scale=True, element=&#39;poly&#39;)</pre><pre># create a vertical line at the mean, and customize aspects<br><strong>plt.plot([x_mean,x_mean],[0,2920], color=&quot;blue&quot;,linewidth=2.5)</strong></pre><pre># add in arrows to point from a descriptor to the vertical lines<br># lots of customization here for colors, lengths, starting points,<br>#    ending points, arrowhead types, arrow-body types and more<br><strong>ax.annotate((&#39;Mean Price\n&#39; + str(int(x_mean))), xy=(x_mean,100), xytext=(850000,115), \<br>            arrowprops=dict(facecolor=&#39;blue&#39;, shrink=0.1, linewidth=0.5), fontsize=17,color=&quot;blue&quot;)<br>plt.plot([x_median,x_median],[0,3010], color=&quot;#244C12&quot;,linewidth=2.5)<br>ax.annotate((&#39;Median Price\n&#39; + str(int(x_median))), xy=(x_median,250), xytext=(200000,265), \<br>            arrowprops=dict(facecolor=&#39;#244C12&#39;, shrink=0.1, linewidth=0.5), fontsize=17,color=&quot;#244C12&quot;)</strong><br>plt.xlabel(&#39;Sale Price ($)&#39;, fontsize=24, fontweight=&#39;bold&#39;)<br>plt.xticks(fontsize=18)<br>plt.ylabel(&#39;Count (homes sold)&#39;, fontsize=24,x=.95)<br>plt.yticks(fontsize=18)<br>ax2 = ax.twinx()<br>sns.kdeplot(x, ax=ax2, color=&quot;#552cbf&quot;, log_scale=True)<br>plt.title(&#39;2014-2015 (Log-Scale)&#39;, fontsize=24, fontweight=&#39;bold&#39;,y=1.015)<br>plt.yticks(fontsize=18)<br>plt.ylabel(&#39;Density&#39;, fontsize=24,x=1.1)</pre><pre># Remove the second y-axis, which wasnt very useful<br><strong>plt.yticks([])<br>plt.ylabel(&#39;&#39;)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phyvlenLf0PG9LiiSmiLvg.png" /></figure><p>There you have it! A beautiful, gaussian histogram, loaded with useful information!</p><p><strong>The Heatmap</strong></p><p>Prior to developing a model, when looking into correlation of different independent variables in a data set, a heatmap, early-on, can be very useful:</p><pre># X is database of many different attributes of sold homes<br>#  It has been cleaned up extensively to allow for comparisons plt.figure(figsize=(17,17))<br>sns.heatmap(X.corr())<br>plt.title(&quot;Correlation Heatmap&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pfzKkdfcQ2P0wi6tezfMw.png" /></figure><p>It’s a start, but this leaves a lot to be desired. Once again, fonts need to be increased, and it would be much nicer to have numeric values on this map. This can be performed by including <em>annot</em>=True. To change the font of these annotations, sns.set(font_scale=*float*) will be necessary. In order to prevent other plots in your code from being affected by this, add a second copy of this command (with font_scale = 1) directly after the heatmap itself is generated:</p><pre>plt.figure(figsize=(17,17))asd</pre><pre># set the global font_scale higher, for improved legibility<br><strong>sns.set(font_scale=1.6)</strong></pre><pre># add correlation vallues with annot=True<br>sns.heatmap(X.corr()<strong>.abs(), annot=True</strong>)<br><strong>sns.set(font_scale=1)</strong><br>plt.title(&quot;Correlation Heatmap&quot;, <strong>fontsize=36</strong>)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqhEXmhHc0BpRMq708GofQ.png" /></figure><p>Much better, but a little inconsistent when it comes to decimals. This can be adjusted with <em>fmt</em>=’.2f’ in this case, to get just 2 decimals (2 f = 2 decimals float). Also, the “lower-left triangle” and the “upper-right triangle” are mirror images of each other, so it can be nice to remove the upper-right one. This is accomplished using a “mask”:</p><pre>plt.figure(figsize=(17,17))<br>sns.set(font_scale=1.6)</pre><pre># a mask is used to cover up the redundant, confusing half<br><strong>mask = np.triu(np.ones_like(X.corr(), dtype=bool))</strong></pre><pre># change the decimals to make them uniform, and apply the mask<br>sns.heatmap(X.corr().abs(), annot=True, <strong>fmt=&#39;.2f&#39;,mask=mask</strong>)<br>sns.set(font_scale=1)<br>plt.title(&quot;Correlation Heatmap&quot;, fontsize=36)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJSlTGY4alv-X7CTI_CRZA.png" /></figure><p>Less cluttered and easier to read. The grey background showing where the upper-right triangle used to be, stands out in a bad way. This is cleared up by adding a “with” command, setting the axes_style to “white”, just prior to generating the map. Two other options(amongst many others) for this type of plot include the color gradient (cmap=*color map*) and the inclusion of the color bar (cbar=True), to the right of the map.</p><pre>plt.figure(figsize=(17,17))<br>sns.set(font_scale=1.6)<br>mask = np.triu(np.ones_like(X.corr(), dtype=bool))</pre><pre># force a white background, change the color gradient(cmap)<br># remove the color gradient bar from the right side(cbar)<strong><br>with sns.axes_style(&quot;white&quot;):</strong><br>    sns.heatmap(X.corr().abs(), annot=True, fmt=&#39;.2f&#39;,     <strong>cmap=&quot;YlOrRd&quot;</strong>,mask=mask, <strong>cbar=False</strong>)<br>sns.set(font_scale=1)<br>plt.title(&quot;Correlation Heatmap&quot;, fontsize=36)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cX4bFcQZ3pnL1TsG4BisA.png" /></figure><p>Perfect! This looks much nicer and is a little easier to quickly read, with the darkest squares representing the highest values. Just as an example, it is apparent that there is likely collinearity between “ft²-Living” and “ft²-Above Ground”, so this, amongst other observations, will need to be taken into account when performing next steps.</p><p>There you have it. Two beautiful plots. Yes, it took a while to find all the proper code and put it all together, but in the end, it was worth every second.</p><p>As with most things, the best way to get a good feel for how this library works, is to experiment. There are no mistakes in this process; just happy little accidents, and you never know what you’ll learn from one!</p><p>*With the exception of the header, all visuals presented here are Theodore Brandon originals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ef812374738" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extracting Beauty from the World of Data Science]]></title>
            <link>https://medium.com/@tedbrandon/extracting-beauty-from-the-world-of-data-science-de3b985dabb3?source=rss-5ee16a455115------2</link>
            <guid isPermaLink="false">https://medium.com/p/de3b985dabb3</guid>
            <category><![CDATA[seaborn]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[matplotlib]]></category>
            <dc:creator><![CDATA[Theodore Brandon]]></dc:creator>
            <pubDate>Sun, 26 Sep 2021 22:02:53 GMT</pubDate>
            <atom:updated>2021-09-26T22:02:53.459Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/76/1*Dtbw5MfFJO72TG2I_CbB3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vVX4Xdp_XUl8aFRQJBoLlQ.png" /></figure><p><em>A Color-Loving Data Scientist’s Journey through Seaborn (and Matplotlib!)</em></p><p>It is every data scientist’s job to process data. Large amounts of data. Small amounts of data. Clean data, dirty data, complete data, incomplete data, accurate data, inaccurate data, complex, simple, unspecified, unknown….. lots and lots of data. At the end of every job, however, what remains, whatever discoveries have been made, any conclusions presented, rejected Null Hypotheses, failures to reject Null Hypotheses — all of this needs to be digested, summarized, and presented in a palatible form to the powers that be. Many times, a simple Pandas summary data table will suffice. However, as the saying goes, a picture’s worth 1,000 words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*NDG-xT7KIqcKT9IP7HYoiw.png" /></figure><p>Elegant, pleasing to the eye, and it tells a clear story: over the 1950’s, airline traffic increased, with large peaks in the summer months. Useful data for the justification of planning future growth and spending.</p><p><strong>Seaborn: </strong>Born in 2012, from the amazing brain of <a href="https://mwaskom.github.io/">Dr. Michael Waskom</a>, PhD, <a href="https://seaborn.pydata.org/index.html">Seaborn</a> is built atop the already powerful <a href="https://matplotlib.org/"><em>Matplotlib</em></a>,<em> </em>and engineered to integrate with <a href="https://pandas.pydata.org/docs/index.html">Pandas</a>. Thus, this is a powerful data visualization library, with which every data scientist need be intimately familiar. What Matplotlib brings to the table serves as an excellent base for Seaborn to shine.</p><p><strong>Color and Customizability:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*YOjqZxFIsYXi8dMg6_sdtQ.png" /><figcaption>A small taste of built-in colors, shades, gradients and opacities</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BBFcWq6qQqUchuL2fJI_g.png" /><figcaption>Comprehensive list of color palettes available with Seaborn</figcaption></figure><p>With an extensive list of built-in palettes (<a href="https://www.color-hex.com/">hex-code</a> can be utilized as well), customizing plots is a few keystrokes away.</p><p><strong>Seemingly Endless Options:</strong> In addition to the examples provided above, the flexibility this package offers is, to put it lightly, exquisite. Take your dataframe and a few lines of code et voilà:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*zaGVF2zLPA8sHyrNQk0I9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*yD0EmvuJfxYXugE3q43z0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1WoZxcAfkkg9vP2wNpe4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*4283SIACgsIeMMl2y__6vQ.png" /><figcaption>Left: Scatterplot Matrix, displaying atributes of 3 species of penquin. Right: Spreadsheet Heatmap of the same airline data presented previously.</figcaption></figure><p><a href="https://www.python-graph-gallery.com/371-surface-plot">Templates</a> for creating these “works of art” are a quick google-search away:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*P9MhO3Vn0273YIqmoZe4Tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*l1YlRrfBMS_IHFvPGqextA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*xL6jun-7FXGiK8GyjqS53w.png" /><figcaption>Example 3D-images displaying both the flexibility and the beauty Seaborn is capable of producing.</figcaption></figure><p>By tweaking a few parameters (a linewidth here, a histogram bin# there), amateurs such as myself, can gain more understanding of how to use this library. Plus, let’s just be honest; it looks cool too!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r46Z8d_0TsmqCfCgUklKlg.png" /></figure><p><strong>The take home message:</strong> If you have big data, you’ve extracted useful, impactful information from it, but you need a good way to effectively communicate this information; Seaborn is your best bet.</p><p>Aside from the 3-D images, all plots originated from the <a href="https://github.com/mwaskom/seaborn">mwaskom/seaborn public github</a> repository. This author has added a certain level of customization to each, in an attempt to improve skills and understanding of this delightful package.</p><p>Recommended for all beginners: A Seaborn tutorial can be found <a href="https://seaborn.pydata.org/tutorial.html#">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de3b985dabb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Newly Budding Data Scientist - Looking for Correlation in all the Right Places:]]></title>
            <link>https://medium.com/@tedbrandon/newly-budding-data-scientist-looking-for-correlation-in-all-the-right-places-efd34770c10d?source=rss-5ee16a455115------2</link>
            <guid isPermaLink="false">https://medium.com/p/efd34770c10d</guid>
            <dc:creator><![CDATA[Theodore Brandon]]></dc:creator>
            <pubDate>Fri, 03 Sep 2021 17:35:40 GMT</pubDate>
            <atom:updated>2021-09-03T17:35:40.401Z</atom:updated>
            <content:encoded><![CDATA[<p>First time writing a blog, so take this with a grain of salt, and… be gentle:</p><p>I grew up in San Diego, where the entirety (up until this point) of my education took place. This culminated in a B.S. in Biochemistry/Chemistry from UCSD in 2003, <em>summa cum laude</em> which I guess means I was really good at school. I immediately jumped right into a job related to my degree, never stopping to think about whether, or how much I was enjoying what I was pursuing. I just felt very happy that I actually got to “use my degree”, unlike so many others. I won’t bore you with specifics, but I began a career in a field called Mass Spectrometry. Succinctly, it involves the measurement of the quantity, or just an identification of different molecules, using super-high-tech, very expensive instruments. Measurements included anything from very small molecules like CO2, to “macromolecules” like intact proteins. Again, it turned out that I was pretty good at it, so I continued to pursue it, without thinking about how much I was enjoying what I was doing. A quick 17 years later and I was working at a great company, performing interesting work, supervising other aspiring chemists, and still able to apply my degree and show off my expertise, which had only grown over the years.</p><p>Then hit 2020. Early in the year, I clearly remember overhearing a few coworkers, very knowledgeable naturopathic doctors, discussing some new virus and how (and how much!), it was going to change the world. Not thinking very much about it, or in fact, thinking they were over-reacting, I carried on with my duties and responsibilities. Looking back, I suppose I should have taken their conversation more seriously. Just one of the many fun things the virus brought with it, was a decline in the influx of samples at my place of employment, and, subsequently, a decline in company income. After almost 13 years with the company, I suddenly found myself unemployed.</p><p>I won’t lie; this put me into a bit of a tailspin. A lack of available jobs, due to a worsening global crisis left me with few options. During this time, I questioned everything. This gave me a chance to finally slow down and think: Was I performing work that made me truly happy? Was I still (or even ever?) passionate about my field? Was this how I wanted to spend the rest of my career? Having lots of free time gave me the chance to really investigate these questions, inevitably leading me to the realization that I had never been passionate about my field in the first place. True, I had been very good at school. I was good at learning, I was good at taking tests, and enjoyed learning about science. Science and I, well we just clicked. Same thing with Mass Spectrometry; we just clicked. But I now have come to realize that I never possessed passion when it came to all of this. It left me feeling a bit hollow, and questioning everything else in my life too.</p><p>Through all of this, my home computer kept me good company, but I hadn’t yet thought of it as the pathway to a new life. It had never occurred to me to try to follow in the footsteps of my older brother and father, each of whom was a programmer practically at the time of their conceptions! I did recall, however, that I enjoyed that computer science class I took in high school. Turbo Pascal. I had done well in that class, but just never pursued anything in that direction — the pull of the harder sciences was just too great.</p><p>I don’t even remember how it started, but my brother and I, as we discuss many things, were led to a conversation about computer programming. From our talks, he began to suggest that I might want to head back in the direction of programming. Further, he intuited that I might enjoy learning “Python” as a passageway to “Machine Learning” and some other foreign, but interesting-sounding things. Being a good sport, he even talked me into taking some Udemy courses with him, along these lines. After about 5 seconds of the beginner Python course, I was reminded just how much I had loved the high school class, and I fell in love with Python.</p><p>My brother continued showing me the ropes of the basics of programming, which I used as an opportunity to develop a few starter programs involving making bigger letters out of their own letters (like, the shape of a large “A”, using only “A”s) to create full words, or even short sentences. He provided enough information for me to create Fibonacci sequences and factorials, without using built-in functions, or libraries, neither of which I knew even existed, at that point. But I succeeded at those, with only minimal frustration. Once I had gotten some of the basics down, he talked me into creating one of my favorite games: Yahtzee. I took the challenge, wanting to make it as great and realistic as possible. After a week or two, I’d gotten it. It even included some very basic “animation” and the ability for more than one player to play at the same time. I’m still pretty proud of that one, especially considering how much of a beginner I was. Tic-tac-toe was a subsequent challenge, but this one turned out to be much more basic, and I finished it quickly.</p><p>During this time, my wife kept telling me about this cool bootcamp she had come across and how much she thought I would like it. As any good husband would, I heard her words but didn’t process them and kept doing my thing. Finally, after who knows how many attempts, she got me to try out that free bootcamp with some institution called “Flatiron School.” Almost immediately, I was hooked.</p><p>Now the question was, how far should I go down this rabbit-hole? Did I want to make this my new career? Which discipline would be best for me? Once again, my ever-wise brother told me to look into “Data Science” and “Machine Learning”, both of which were still pretty foreign to me, as I had only just started the free bootcamp. As I continued learning, I was quickly falling in love with the Data Science module. I have ALWAYS been a huge geek when it comes to Microsoft Excel, and everything one can do with it and large sets of data. This seemed like Excel on steroids! This whole package made the choice easy for me, and I am ready to get this show on the road.</p><p>So…. Here! We! Go!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efd34770c10d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>