<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Data Science Portfolio</title>
    <link>http://mreevesdsba.hopto.org/</link>
      <atom:link href="http://mreevesdsba.hopto.org/index.xml" rel="self" type="application/rss+xml" />
    <description>Data Science Portfolio</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Sat, 01 Jun 2030 13:00:00 +0000</lastBuildDate>
    <image>
      <url>http://mreevesdsba.hopto.org/images/icon_hua2ec155b4296a9c9791d015323e16eb5_11927_512x512_fill_lanczos_center_2.png</url>
      <title>Data Science Portfolio</title>
      <link>http://mreevesdsba.hopto.org/</link>
    </image>
    
    <item>
      <title>Example Talk</title>
      <link>http://mreevesdsba.hopto.org/talk/example-talk/</link>
      <pubDate>Sat, 01 Jun 2030 13:00:00 +0000</pubDate>
      <guid>http://mreevesdsba.hopto.org/talk/example-talk/</guid>
      <description>&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    Click on the &lt;strong&gt;Slides&lt;/strong&gt; button above to view the built-in slides feature.
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Slides can be added in a few ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; slides using Wowchemy&amp;rsquo;s &lt;a href=&#34;https://wowchemy.com/docs/managing-content/#create-slides&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;em&gt;Slides&lt;/em&gt;&lt;/a&gt; feature and link using &lt;code&gt;slides&lt;/code&gt; parameter in the front matter of the talk file&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Upload&lt;/strong&gt; an existing slide deck to &lt;code&gt;static/&lt;/code&gt; and link using &lt;code&gt;url_slides&lt;/code&gt; parameter in the front matter of the talk file&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Embed&lt;/strong&gt; your slides (e.g. Google Slides) or presentation video on this page using &lt;a href=&#34;https://wowchemy.com/docs/writing-markdown-latex/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;shortcodes&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Further event details, including &lt;a href=&#34;https://wowchemy.com/docs/writing-markdown-latex/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;page elements&lt;/a&gt; such as image galleries, can be added to the body of this page.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>What is a GAN?</title>
      <link>http://mreevesdsba.hopto.org/post/what-is-a-gan/</link>
      <pubDate>Sun, 15 Sep 2019 00:00:00 +0000</pubDate>
      <guid>http://mreevesdsba.hopto.org/post/what-is-a-gan/</guid>
      <description>&lt;p&gt;Before reading this post, it is helpful to understand what a neural Network is. Please see the following if you need a refresher:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/post/what-is-a-neural-network/&#34;&gt;What is a Neural Network?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Before describing how a Generative Adversarial Network (GAN) works, let us start with the goal, which is to create a network that can generate outputs that are indistinguishable from the given set of real objects. We will call the network that produces these outputs the generator network. However, we also need something that can distinguish between the actual objects and the generated objects, which we will call the discriminator network. This network provides feedback to the generator to let it know which outputs are closest to the actual.&lt;/p&gt;
&lt;p&gt;Imagine we have a set of keys and we want a lock that can be opened by as many of those keys as possible and as few keys as possible that are not in that original set. A locksmith starts working on making that lock. At the same time, we have a key-maker creating keys to attempt to open the lock made by the locksmith. As the key-maker gets better, the locksmith will also have to get better at distinguishing between the real and fake keys. As they continue to improve, what started off as the key-maker making random keys will eventually become keys that are similar to the original set of keys. In this example the locksmith is the discriminator, trying to reduce the number of errors, both positive and negative and the key-maker is the generator, creating keys that will try to open the lock.&lt;/p&gt;
&lt;p&gt;The important thing to keep in mind, as with any network, is what the input looks like and what the output looks like. These two networks must work in tandem with the generator creating an output that is able to be consumed by the discriminator; this would be the key-maker making a key in the previous analogy. The discriminator, on the other hand, must be able to accept the initial set of objects and the output of the generator (the lock accepting the key) and output a binary, True/False result based on the given input (whether the key opens the lock). This only leaves the input for the generator, which is generally just a random vector to allow for variety within the generator network, the shape of which is not all that important.&lt;/p&gt;
&lt;p&gt;GANs can be used to recreate any type of matrix, but in general they are used to create images. Images can easily be represented in matrix form by seperating each color layer into a seperate, equally sized matrix, with the intensity of that color represented by a numeric value.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>What is a Neural Network?</title>
      <link>http://mreevesdsba.hopto.org/post/what-is-a-neural-network/</link>
      <pubDate>Sun, 15 Sep 2019 00:00:00 +0000</pubDate>
      <guid>http://mreevesdsba.hopto.org/post/what-is-a-neural-network/</guid>
      <description>&lt;p&gt;A neural network, at its most basic level, can be thought of as a function that consists of an input, a transformation process, and an output. One helpful analogy for this is the Plinko game in The Price is Right. The game consists of a contestant dropping a chip at the top of a board which then bounces, seemingly randomly, through a field of pegs before landing in one of several slots.&lt;/p&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/plinko.gif&#34; alt=&#34;Plinko&#34;&gt;
&lt;p&gt;What makes this analogy especially appropriate is that the relationship between the input (starting position of the chip) and the output (the slot at the bottom of the board) is completely obscured by the complexity of the pathway; there is no way to tell the exact path the chip will take based on the starting position. This is what is typically meant when a neural network is referred to as a black box.&lt;/p&gt;
&lt;p&gt;While a process that produces random outputs is useful in a game of chance, it is less useful when trying to utilize machines for decision-making. The power of neural networks comes through the training process. This consists of minor adjustments to the transformation process based on repeated evaluations of inputs. To continue the Plinko analogy, this could be thought of as allowing the contestants to move the pegs. After dropping chips potentially millions of times and looking at the output distribution, the contestant would be allowed to make slight changes to the location each of the pegs and repeat the process. If the overall total winnings increased then they would move each of the pegs further in the same direction. If the overall total winnings decreased they would move them in the opposite direction. This process, known as back propagation, is repeated over and over until an optimized peg configuration is found. The distance that the pegs are allowed to be moved each iteration is called the learning rate, the number of chips we use each time is called the batch size, and each training iteration is called an epoch.&lt;/p&gt;
&lt;p&gt;While it would be tempting just to create channels with the pegs to force the outcome that you want, this is what is known in the machine-learning world as overfitting. Because the data that we train on (the starting position of the chips that we use to optimize the pegs) is rarely the exact positions that we would see when we are actually playing the game, we want to make sure that the final configuration works universally rather than just for the positions that we use to train. What we sacrifice in perfection with our training accuracy we will make up for with a generalized model that will be more successful over time in different situations.&lt;/p&gt;
&lt;p&gt;Up to this point we have only discussed the transformation process as an abstract concept. What it actually consists of is a specified number of layers (rows of pegs) each with a specified size (numbers of pegs per row). The actual composition of these layers is determined during the training process with only generalized guidelines as to how many or how large they should be.&lt;/p&gt;
&lt;p&gt;Continuing to describe neural networks in more detail is beyond the scope of this overview in part because the technicalities of their implementation extends beyond the Plinko analogy. However, it was a useful tool for describing the process of overall process works.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>No, I Will Not Call This Diogenes GAN-terns</title>
      <link>http://mreevesdsba.hopto.org/project/gan-tern/</link>
      <pubDate>Wed, 26 Jun 2019 00:00:00 +0000</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/gan-tern/</guid>
      <description>&lt;h2 id=&#34;project-overview&#34;&gt;Project Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The goal of the project was to create a Generative Adversarial Network (GAN) that would produce visually interesting images. A unique wildflower native to Northern California, the Diogenes Lantern, was selected for the training set based on the pleasing geometric structures and vibrant yellow color.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;While reliant on deep-learning techniques, this project differed in several key factors from the normal implementation of these methodologies. The first is that the end goal was not necessarily to create the most convincing replication of the training set, but rather to create something within the artistic realm while capturing the underlying essence of the flower. The second, and related variance, is that because the goal was not to necessarily recreate indistinguishable images, optimization and hyperparameter tuning were not required.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;machine-learning-background&#34;&gt;Machine Learning background&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;If you are unfamiliar with the concepts of neural networks or GANs please feel free to read the following articles:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/post/what-is-a-neural-network/&#34;&gt;What is a Nerual Network?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/post/what-is-a-gan/&#34;&gt;What is a GAN?&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;data-collection-and-augmentation&#34;&gt;Data Collection and Augmentation&lt;/h3&gt;
&lt;hr&gt;
&lt;p&gt;A total of 172 unique images were scraped using Google image search. This is far fewer than is traditionally leveraged for these types of implementations, especially given the variety of angles, proximity, and backgrounds within the data set. However, due to the stated goal of only needing to create visually interesting images, this is acceptable.&lt;/p&gt;
&lt;br&gt;
&lt;p&gt;Digital augmentation was implemented in order to supplement the dataset and artificially inject variations into the collected images. Zoom, croping, rotation, stretch/skew, and limited color balance changes were randomly applied to create additional images.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h3 id=&#34;hardware-and-software&#34;&gt;Hardware and Software&lt;/h3&gt;
&lt;hr&gt;
&lt;p&gt;The networks were trained on a Linux machine-learning server leveraging an NVIDIA GeForce 1060 GPU. The server has an Intel core I5 processor and 16 GB of RAM.&lt;/p&gt;
&lt;br&gt;
&lt;p&gt;The code for the networks was coded in Python utilizing the KERAS library leveraging a Tensor-Flow backend with GPU utilization.&lt;/p&gt;
&lt;br&gt;
&lt;p&gt;An output image size of 256x256 pixels was selected in order to optimize training time while still having a minimum viable output for artistic prints. Training of the networks took several days to complete over 300,000 epochs with a batch size of 16. Again, hyperparameters such as learning rate, batch size, and layer structure were not changed as the initial setup produced the desired results.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h3 id=&#34;results&#34;&gt;Results&lt;/h3&gt;
&lt;hr&gt;
&lt;p&gt;Since the stated goal of this project was based on artistic subjectivity, traditional measures such as accuracy and error rate do not provide meaningful insights into its success. The model produced acceptable outputs and therefore achieved the intended goal of the work. The images produced were interesting and visually appealing enough and therefore there was no need to continue training or tuning the model.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_2.png&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_3.png&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_4.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;It should be stated, however, that a layer of human-selection was still required in order to produce these results. While all the images were produced from an initial  random vector, many of them resulted in less-than-acceptable levels of variety (due to mode collapse) or visual interest.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_5.png&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_6.png&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_7.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Perhaps with additional tuning and refining, these issues could be reduced, but it was not necessary under these particular circumstances. This should always be considered when judging the effectiveness of a GAN; it should not be judged on the most realistic images produced but on the complete spectrum of the population. It is easy to gravitate towards the most successful results while ignoring the many results that are clearly unrealistic, but it introduces a level of human-bias to the machine-learning that would not be possible in a fully automated application.&lt;/p&gt;
&lt;br&gt;
&lt;p&gt;These images are now part of an art installation. Twelve of the most pleasing resulting images were selected for prints.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_8.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Additionally, one image was selected as the subject of a 48-inch x 48-inch acrylic painting.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/lantern/img_9.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Regression Assumptions</title>
      <link>http://mreevesdsba.hopto.org/post/regression-assumptions/</link>
      <pubDate>Sun, 12 May 2019 00:00:00 +0000</pubDate>
      <guid>http://mreevesdsba.hopto.org/post/regression-assumptions/</guid>
      <description>
&lt;script src=&#34;http://mreevesdsba.hopto.org/rmarkdown-libs/header-attrs/header-attrs.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;http://mreevesdsba.hopto.org/rmarkdown-libs/htmlwidgets/htmlwidgets.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;http://mreevesdsba.hopto.org/rmarkdown-libs/echarts4r/echarts-en.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;http://mreevesdsba.hopto.org/rmarkdown-libs/echarts4r/ecStat.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;http://mreevesdsba.hopto.org/rmarkdown-libs/echarts4r/dataTool.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;http://mreevesdsba.hopto.org/rmarkdown-libs/echarts4r-binding/echarts4r.js&#34;&gt;&lt;/script&gt;


&lt;div id=&#34;overview&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Overview:&lt;/h2&gt;
&lt;p&gt;In the real world, you would normally start with a data set and attempt to find a model that best fits that problem; however, there is a lot of value in starting with a data set that you know will exactly fit a model and add complexity to see the effects of the assumptions made by a model. This will be our approach as we look at linear regression models, the assumptions they make about data, and the effects of those assumptions. Helpful models can absolutely be built outside of these assumptions, and almost always are, but it is important to see the isolated effects of different scenarios.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;problem&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Problem:&lt;/h2&gt;
&lt;p&gt;Imagine that at the end of of the year, you are reviewing your bank statement and you look at how much you spent on lunch every day. Assume that you track your food intake and write down what you eat for each meal. From your bank statement you can see the total cost of your lunch and from your caloric tracking you can see what items you ate each day, but you don’t know how much each item cost. Our goal is to build a linear regression model that will calculate how much each item cost. We will then add in additional complexities to the model and see their effects. Linear models make these assumptions about the dataset:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;&lt;a href=&#34;#number_one&#34;&gt;The cost of each item doesn’t change day-to-day&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#number_tow&#34;&gt;Purchasing more of an item does not change the cost of the item&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Purchasing an item doesn’t affect the cost of the other items&lt;/li&gt;
&lt;li&gt;The total cost is dependent solely dependent on the items purchased&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We will show the affects of running a model on a data set that breaks each of these. This is is not an exhaustive list of scenarios, but this will be our scope.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;dataset&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Dataset&lt;/h2&gt;
&lt;p&gt;Our dataset will represent what we ate for lunch each day. Let us assume that each day we purchased:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;1 or 2 sandwiches&lt;/li&gt;
&lt;li&gt;Up to 2 apples&lt;/li&gt;
&lt;li&gt;The possibility of a bag of chips&lt;/li&gt;
&lt;li&gt;Up to 3 cookies (because we can all dream).&lt;/li&gt;
&lt;li&gt;$1 tip (a constant)&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#Set our seed to make sure our code is repeatable with consistent randomness
set.seed(101)

#Create our dataset
dataset&amp;lt;-as.data.frame(cbind(
  sandwich_count = sample(1:2, 100, replace=TRUE)
  , apple_count = sample(0:2, 100, replace=TRUE)
  , chip_count = sample(0:1, 100, replace=TRUE)
  , cookie_count = sample(0:3, 100, replace=TRUE)
))

#Peek at our dataset to make sure everything looks good
kable(head(dataset))&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;right&#34;&gt;sandwich_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;apple_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;chip_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;cookie_count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Now that we have our dataset, let us calculate the cost total cost for each day. Here are the menu prices:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;Sandwhich: $4&lt;/li&gt;
&lt;li&gt;Apple: $1.50&lt;/li&gt;
&lt;li&gt;Chips: $2.50&lt;/li&gt;
&lt;li&gt;Cookie: $.50&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before you start wondering how we know the costs of each item (which is what we are trying to find out), we are just calculating the total cost for each lunch which would have come from our bank statement. We will only show the model the count of each item and the total cost.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#create a total column and calculate total based on cost
dataset$total&amp;lt;-(
  dataset$sandwich_count*4 
 + dataset$apple_count * 1.5
 + dataset$chip_count * 2.5
 + dataset$cookie_count * .5
 + 1
)

#Peek at our dataset to make sure everything looks good
kable(head(dataset))&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;right&#34;&gt;sandwich_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;apple_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;chip_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;cookie_count&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;9.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;3&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;6.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;14.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;9.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;5.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;11.5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id=&#34;build-the-model&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Build the model&lt;/h2&gt;
&lt;p&gt;In our context, the linear model will look like:&lt;/p&gt;
&lt;blockquote&gt;
Total = (tip) + (cost of item A)x(number of item A) + (cost of item B)x(number of item B)…
&lt;/blockquote&gt;
&lt;p&gt;And the cost of each item will be the coefficients that the model is going to find.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#Build the model
lunch_model&amp;lt;-lm(total~ sandwich_count + apple_count + chip_count + cookie_count, data = dataset)

#Look at the coefficients (Intercept will be the amount of our tip)
kable(lunch_model$coefficients, col.names = &amp;quot;Cost&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;sandwich_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;4.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;apple_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;chip_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The coefficients (cost of the item) all match the cost of each item exactly. This is not at all a surprise since we built our dataset within the assumptions of linear models. As long as we operate precisely whithin all the assumptions, the model will be exact.&lt;/p&gt;
&lt;p&gt;Let us run a quick prediction to make sure that everything looks good. We will have 1 sandwich, and 2 apples (plus tip should be $8):&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;dataset_test&amp;lt;-as.data.frame(cbind(
  sandwich_count = 1
  , apple_count = 2
  , chip_count = 0
  , cookie_count = 0
))

predict(lunch_model, dataset_test)%&amp;gt;%
  as.numeric()&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] 8&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, let us change the dataset to incorporate more realistic scenarios that operate outside of these assumptions to see how it affects the model.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;number_one&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;1. Item Cost Increase&lt;/h2&gt;
&lt;p&gt;The first assumption we will break is that the cost of each item doesn’t change day-to-day. Let us assume that halfway through the year, our lunch shop increased the price of their cookie from $.50 to $1. Beyond the tragedy of costing more, this change pushes us outside of the realm of the assumptions made by a linear model that the price of each item is constant. Again, this doesn’t mean that we can’t use the model, only that it won’t fit perfectly as before. So let us examine the isolated effects of this change by looking at the coefficients if we alternate between not buying anything and only buying 1 cookie (and no tip).&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#dataset alternating between 1 and 2 cookies
dataset$cookie_count &amp;lt;-rep(0:1, 50)

#Update total to show change to price
dataset$total_pricechange&amp;lt;-(dataset$cookie_count * c(rep(.5, 50), rep(1, 50)))

#Build the model
lunch_model_pricechange&amp;lt;-lm(total_pricechange ~ cookie_count, data = dataset)

#Look at the coefficients (Intercept will be the amount of our tip)
kable(round(lunch_model_pricechange$coefficients, 2), col.names = &amp;quot;Cost&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.75&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;We can see that the model estimated the cost of a cookie as halfway between $.5 and $1. It is not a coincidence that the cost of the cookie changed halfway through the year and the coefficient is halfway between the old cost and the new cost. If it had changed later in the year, the cost would be closer to the original cost as we would have paid that price more often.&lt;/p&gt;
&lt;p&gt;We can do a quick check where it changed 3/4ths of the way through the year:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.630&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;Exact weighted average:&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.625&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Let us see how the price change half way through the year effects our model knowing that this situation is not perfectly modeled by linear regression:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;dataset$total_pricechange&amp;lt;-(
  dataset$sandwich_count*4 
 + dataset$apple_count * 1.5
 + dataset$chip_count * 2.5
 + dataset$cookie_count * c(rep(.5, 50), rep(1, 50))
 +  1
)

lunch_model_pricechange&amp;lt;-lm(total_pricechange~ sandwich_count + apple_count + chip_count + cookie_count, data = dataset)

kable(round(lunch_model_pricechange$coefficients, 2), col.names = &amp;quot;Cost&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;sandwich_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;4.03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;apple_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.48&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;chip_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.74&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The cost estimates for each item are very close, but they are slightly off. Now that our data no longer has linear coefficients, the model is going to attribute some of the changes to other items as it tries to minimize the squared error. Looking closely at the cookie coefficient, it is right about $.75, which we had seen before.&lt;/p&gt;
&lt;p&gt;In order to check our model, lets look at our previous lunch prediction which didn’t include a cookie, so it should be affected by the price increase (remember that it cost $8)&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;predict(lunch_model_pricechange, dataset_test)%&amp;gt;%
  as.numeric()%&amp;gt;%
  round(2)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] 7.95&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It still comes out to be $8, so the model still works okay in that situation. Now let us see what the model would show if we had a cookie. At the original price that would have been $8.50 and the new price would be $9&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;dataset_test_wcookie&amp;lt;-dataset_test
dataset_test_wcookie$cookie_count&amp;lt;-1
predict(lunch_model_pricechange, dataset_test_wcookie)%&amp;gt;%
  as.numeric()%&amp;gt;%
  round(2)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] 8.69&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As we would expect: halfway between the two prices (minus 1 cent). Lets take a minute and consider the consequences of this alteration. Assuming this is a predictive model, for each cookie we purchase in the future, our predictions will be under by $.25. In this simple example, that might not seem like a big deal, but as the complexity and cost of errors increases, this could have a major effect.&lt;/p&gt;
&lt;p&gt;There are a few major take-aways from this change. The first is that the number of cookies we bought at each price will directly affect the coefficient, and ultimately the prediction. The second is that if this is a permanent price change (as opposed to a periodic promotional price), our predictions will be continually off and will need a retrain to be more precise. This is where knowing the shop enough to remember that they changed their prices (domain expertise) or seeing that how far the model is off changed at a specific point (data exploration).&lt;/p&gt;
&lt;p&gt;As we can see from the chart below, our predictions before the change were mostly under and the predicitons from after are mostly over with a clear distinction between the two prices.&lt;/p&gt;
&lt;div id=&#34;htmlwidget-1&#34; style=&#34;width:100%;height:500px;&#34; class=&#34;echarts4r html-widget&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-1&#34;&gt;{&#34;x&#34;:{&#34;theme&#34;:&#34;&#34;,&#34;tl&#34;:false,&#34;draw&#34;:true,&#34;renderer&#34;:&#34;canvas&#34;,&#34;events&#34;:[],&#34;buttons&#34;:[],&#34;opts&#34;:{&#34;yAxis&#34;:[{&#34;show&#34;:true}],&#34;xAxis&#34;:[{&#34;type&#34;:&#34;value&#34;}],&#34;legend&#34;:{&#34;data&#34;:[&#34;Cookie at $.50&#34;,&#34;Cookie at $1&#34;]},&#34;series&#34;:[{&#34;data&#34;:[{&#34;value&#34;:[1,-0.00646647625867415]},{&#34;value&#34;:[2,-0.227034778877421]},{&#34;value&#34;:[3,-0.0333423409647676]},{&#34;value&#34;:[4,-0.19336691056522]},{&#34;value&#34;:[5,0.0162104522844248]},{&#34;value&#34;:[6,-0.232877773264631]},{&#34;value&#34;:[7,-0.016508406808674]},{&#34;value&#34;:[8,-0.266545641576828]},{&#34;value&#34;:[9,-0.00646647625889087]},{&#34;value&#34;:[10,-0.276587572126611]},{&#34;value&#34;:[11,0.0498783205966202]},{&#34;value&#34;:[12,-0.253910643583296]},{&#34;value&#34;:[13,0.0103674578972073]},{&#34;value&#34;:[14,-0.237076709427197]},{&#34;value&#34;:[15,0.033044386440522]},{&#34;value&#34;:[16,-0.259753637970512]},{&#34;value&#34;:[17,0.033044386440522]},{&#34;value&#34;:[18,-0.276587572126611]},{&#34;value&#34;:[19,0.0498783205966202]},{&#34;value&#34;:[20,-0.227034778877415]},{&#34;value&#34;:[21,-0.0106654124214575]},{&#34;value&#34;:[22,-0.253910643583296]},{&#34;value&#34;:[23,0.0162104522844236]},{&#34;value&#34;:[24,-0.253910643583296]},{&#34;value&#34;:[25,0.033044386440522]},{&#34;value&#34;:[26,-0.232877773264631]},{&#34;value&#34;:[27,-0.0233004104149893]},{&#34;value&#34;:[28,-0.210200844721316]},{&#34;value&#34;:[29,-0.0333423409647721]},{&#34;value&#34;:[30,-0.259753637970512]},{&#34;value&#34;:[31,0.033044386440522]},{&#34;value&#34;:[32,-0.227034778877415]},{&#34;value&#34;:[33,-0.0233004104149893]},{&#34;value&#34;:[34,-0.276587572126611]},{&#34;value&#34;:[35,-0.0501762751208707]},{&#34;value&#34;:[36,-0.276587572126611]},{&#34;value&#34;:[37,-0.0106654124214575]},{&#34;value&#34;:[38,-0.232877773264631]},{&#34;value&#34;:[39,-0.0333423409647721]},{&#34;value&#34;:[40,-0.259753637970512]},{&#34;value&#34;:[41,0.023002455890739]},{&#34;value&#34;:[42,-0.210200844721316]},{&#34;value&#34;:[43,-0.00646647625889087]},{&#34;value&#34;:[44,-0.193366910565218]},{&#34;value&#34;:[45,0.0498783205966202]},{&#34;value&#34;:[46,-0.253910643583296]},{&#34;value&#34;:[47,0.0498783205966202]},{&#34;value&#34;:[48,-0.259753637970512]},{&#34;value&#34;:[49,0.023002455890739]},{&#34;value&#34;:[50,-0.237076709427197]}],&#34;name&#34;:&#34;Cookie at $.50&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20},{&#34;data&#34;:[{&#34;value&#34;:[51,-0.016508406808674]},{&#34;value&#34;:[52,0.246089356416704]},{&#34;value&#34;:[53,-0.0106654124214575]},{&#34;value&#34;:[54,0.233454358423172]},{&#34;value&#34;:[55,0.023002455890739]},{&#34;value&#34;:[56,0.306633089434782]},{&#34;value&#34;:[57,-0.016508406808674]},{&#34;value&#34;:[58,0.279757224728901]},{&#34;value&#34;:[59,0.0498783205966202]},{&#34;value&#34;:[60,0.262923290572803]},{&#34;value&#34;:[61,0.033044386440522]},{&#34;value&#34;:[62,0.206578493717291]},{&#34;value&#34;:[63,-0.00646647625889087]},{&#34;value&#34;:[64,0.267122226735369]},{&#34;value&#34;:[65,0.0103674578972073]},{&#34;value&#34;:[66,0.246089356416704]},{&#34;value&#34;:[67,-0.0233004104149893]},{&#34;value&#34;:[68,0.246089356416704]},{&#34;value&#34;:[69,-0.0233004104149893]},{&#34;value&#34;:[70,0.233454358423172]},{&#34;value&#34;:[71,0.033044386440522]},{&#34;value&#34;:[72,0.206578493717291]},{&#34;value&#34;:[73,-0.0106654124214575]},{&#34;value&#34;:[74,0.240246362029488]},{&#34;value&#34;:[75,-0.00646647625889087]},{&#34;value&#34;:[76,0.267122226735369]},{&#34;value&#34;:[77,-0.0501762751208707]},{&#34;value&#34;:[78,0.206578493717291]},{&#34;value&#34;:[79,0.023002455890739]},{&#34;value&#34;:[80,0.267122226735369]},{&#34;value&#34;:[81,-0.0106654124214575]},{&#34;value&#34;:[82,0.279757224728901]},{&#34;value&#34;:[83,-0.016508406808674]},{&#34;value&#34;:[84,0.233454358423172]},{&#34;value&#34;:[85,-0.0333423409647721]},{&#34;value&#34;:[86,0.233454358423172]},{&#34;value&#34;:[87,-0.0501762751208707]},{&#34;value&#34;:[88,0.262923290572803]},{&#34;value&#34;:[89,-0.0233004104149893]},{&#34;value&#34;:[90,0.246089356416704]},{&#34;value&#34;:[91,0.0498783205966202]},{&#34;value&#34;:[92,0.206578493717291]},{&#34;value&#34;:[93,-0.0501762751208707]},{&#34;value&#34;:[94,0.240246362029488]},{&#34;value&#34;:[95,-0.0501762751208707]},{&#34;value&#34;:[96,0.22341242787339]},{&#34;value&#34;:[97,0.033044386440522]},{&#34;value&#34;:[98,0.22341242787339]},{&#34;value&#34;:[99,-0.0233004104149893]},{&#34;value&#34;:[100,0.22341242787339]}],&#34;name&#34;:&#34;Cookie at $1&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20}],&#34;title&#34;:[{&#34;text&#34;:&#34;Price Change Residuals&#34;,&#34;subtext&#34;:&#34;How far the model was off each day&#34;}]},&#34;dispose&#34;:true},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]}&lt;/script&gt;
&lt;/div&gt;
&lt;div id=&#34;number_two&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;2. Buy 2 And Save…&lt;/h2&gt;
&lt;p&gt;Let us assume that instead of changing the price of cookies part way through the year, cookies had a variable price, depending on how many you purchased. 1 cookie costs $1 but 2 cookies cost $.75 each. In our imaginary life where we eat cookies on a regular basis, lets assume that we alternate between 1 and 2 cookies repeatedly.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#Alternate between 1 and 2 cookies
dataset$cookie_count &amp;lt;-rep(1:2, 25)

#1 cookie costs $1 but 2 or more cookies cost $.75 each
dataset$total_buy2&amp;lt;-(
dataset$cookie_count * ifelse(dataset$cookie_count== 1, 1, .75)
)

#Build the cookie model
lunch_model_buy2&amp;lt;-lm(total_buy2 ~ cookie_count, data = dataset)

#Look at the model
kable(lunch_model_buy2$coefficients, col.names = &amp;quot;Cost&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Interestingly, the model assumed that each cookie cost $.50 and we gave a $.50 tip. If we chart this out, it actually makes sense why that is. The difference in cost between 1 cookie and 2 cookies is $.50, so the model assumed this is how much a single cookie cost and the rest it counted as tip:&lt;/p&gt;
&lt;div id=&#34;htmlwidget-2&#34; style=&#34;width:100%;height:500px;&#34; class=&#34;echarts4r html-widget&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-2&#34;&gt;{&#34;x&#34;:{&#34;theme&#34;:&#34;&#34;,&#34;tl&#34;:false,&#34;draw&#34;:true,&#34;renderer&#34;:&#34;canvas&#34;,&#34;events&#34;:[],&#34;buttons&#34;:[],&#34;opts&#34;:{&#34;yAxis&#34;:[{&#34;show&#34;:true,&#34;minInterval&#34;:0.5,&#34;maxInterval&#34;:0.5,&#34;axisLabel&#34;:{&#34;formatter&#34;:&#34;function(value, index) {\n        var fmt = new Intl.NumberFormat(&#39;en&#39;, {\&#34;style\&#34;:\&#34;currency\&#34;,\&#34;minimumFractionDigits\&#34;:2,\&#34;maximumFractionDigits\&#34;:2,\&#34;currency\&#34;:\&#34;USD\&#34;});\n        return fmt.format(value);\n    }&#34;}}],&#34;xAxis&#34;:[{&#34;data&#34;:[&#34;1 Cookie&#34;,&#34;2 Cookie&#34;],&#34;type&#34;:&#34;category&#34;,&#34;boundaryGap&#34;:true}],&#34;legend&#34;:{&#34;data&#34;:[&#34;Tip&#34;,&#34;Cookie_1&#34;,&#34;Cookie_2&#34;]},&#34;series&#34;:[{&#34;data&#34;:[{&#34;value&#34;:[&#34;1 Cookie&#34;,&#34;0.5&#34;]},{&#34;value&#34;:[&#34;2 Cookie&#34;,&#34;0.5&#34;]}],&#34;name&#34;:&#34;Tip&#34;,&#34;type&#34;:&#34;bar&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;stack&#34;:&#34;grp&#34;},{&#34;data&#34;:[{&#34;value&#34;:[&#34;1 Cookie&#34;,&#34;0.5&#34;]},{&#34;value&#34;:[&#34;2 Cookie&#34;,&#34;0.5&#34;]}],&#34;name&#34;:&#34;Cookie_1&#34;,&#34;type&#34;:&#34;bar&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;stack&#34;:&#34;grp&#34;},{&#34;data&#34;:[{&#34;value&#34;:[&#34;1 Cookie&#34;,&#34;0&#34;]},{&#34;value&#34;:[&#34;2 Cookie&#34;,&#34;0.5&#34;]}],&#34;name&#34;:&#34;Cookie_2&#34;,&#34;type&#34;:&#34;bar&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;stack&#34;:&#34;grp&#34;}],&#34;tooltip&#34;:{&#34;trigger&#34;:&#34;item&#34;},&#34;title&#34;:[{&#34;text&#34;:&#34;Buy 2 and Save Cost&#34;,&#34;subtext&#34;:&#34;Each cookie costs the same and the rest is constant&#34;}]},&#34;dispose&#34;:true},&#34;evals&#34;:[&#34;opts.yAxis.0.axisLabel.formatter&#34;],&#34;jsHooks&#34;:[]}&lt;/script&gt;
&lt;p&gt;Before we go back to the full lunch, let us look at increasing the number of cookies we buy each day. We will increase from 1 to 4 each time we buy lunch (just trying to make it through the week).&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#Cycle from 1 to 4 cookies
dataset$cookie_count &amp;lt;-c(rep(1:4, 25))

#1 cookie costs $1 but 2 or more cookies cost $.75 each
dataset$total_buy2_2&amp;lt;-(
dataset$cookie_count * ifelse(dataset$cookie_count== 1, 1, .75)
)

#Build the cookie model
lunch_model_buy2_2&amp;lt;-lm(total_buy2_2 ~ cookie_count, data = dataset)

#Look at the model
kable(lunch_model_buy2_2$coefficients, col.names = &amp;quot;Cost&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.675&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The model starts to spread out the error across all of the scenarios in order to split the difference based on the number of cookies at each price. One important thing to note is that the cookie coefficient is actually lower than the cost of the cookie, even when buying more than 2. The remaining cost of the cookie was bundled proporitonally into the constant (the tip) based on how many cookies we bought at each price.&lt;/p&gt;
&lt;div id=&#34;htmlwidget-3&#34; style=&#34;width:100%;height:500px;&#34; class=&#34;echarts4r html-widget&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-3&#34;&gt;{&#34;x&#34;:{&#34;theme&#34;:&#34;&#34;,&#34;tl&#34;:false,&#34;draw&#34;:true,&#34;renderer&#34;:&#34;canvas&#34;,&#34;events&#34;:[],&#34;buttons&#34;:[],&#34;opts&#34;:{&#34;yAxis&#34;:[{&#34;show&#34;:true,&#34;minInterval&#34;:0.1,&#34;maxInterval&#34;:0.1,&#34;axisLabel&#34;:{&#34;formatter&#34;:&#34;function(value, index) {\n        var fmt = new Intl.NumberFormat(&#39;en&#39;, {\&#34;style\&#34;:\&#34;currency\&#34;,\&#34;minimumFractionDigits\&#34;:2,\&#34;maximumFractionDigits\&#34;:2,\&#34;currency\&#34;:\&#34;USD\&#34;});\n        return fmt.format(value);\n    }&#34;}}],&#34;xAxis&#34;:[{&#34;data&#34;:[&#34;1 Cookie&#34;,&#34;2 Cookies&#34;,&#34;3 Cookies&#34;,&#34;4 Cookies&#34;],&#34;type&#34;:&#34;category&#34;,&#34;boundaryGap&#34;:true}],&#34;legend&#34;:{&#34;data&#34;:[&#34;1 Cookie&#34;,&#34;2 Cookies&#34;,&#34;3 Cookies&#34;,&#34;4 Cookies&#34;],&#34;show&#34;:false,&#34;type&#34;:&#34;plain&#34;},&#34;series&#34;:[{&#34;data&#34;:[{&#34;value&#34;:[&#34;1 Cookie&#34;,&#34;0.075&#34;]}],&#34;name&#34;:&#34;1 Cookie&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20,&#34;label&#34;:{&#34;show&#34;:true,&#34;position&#34;:&#34;top&#34;}},{&#34;data&#34;:[{&#34;value&#34;:[&#34;2 Cookies&#34;,&#34;-0.1&#34;]}],&#34;name&#34;:&#34;2 Cookies&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20,&#34;label&#34;:{&#34;show&#34;:true,&#34;position&#34;:&#34;top&#34;}},{&#34;data&#34;:[{&#34;value&#34;:[&#34;3 Cookies&#34;,&#34;-0.025&#34;]}],&#34;name&#34;:&#34;3 Cookies&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20,&#34;label&#34;:{&#34;show&#34;:true,&#34;position&#34;:&#34;top&#34;}},{&#34;data&#34;:[{&#34;value&#34;:[&#34;4 Cookies&#34;,&#34;0.05&#34;]}],&#34;name&#34;:&#34;4 Cookies&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20,&#34;label&#34;:{&#34;show&#34;:true,&#34;position&#34;:&#34;top&#34;}}],&#34;title&#34;:[{&#34;text&#34;:&#34;Buy 2 and Save Residual&#34;,&#34;subtext&#34;:&#34;Each cookie costs the same and the rest is constant&#34;}]},&#34;dispose&#34;:true},&#34;evals&#34;:[&#34;opts.yAxis.0.axisLabel.formatter&#34;],&#34;jsHooks&#34;:[]}&lt;/script&gt;
&lt;p&gt;Lets take what we just saw from the previous coefficients and try to imagine what we should expect from the full lunch model. We know that the tip will probably be about $.25 more than the $1 we actually put in, and the cookie will be less than even the $.75 we pay for 2 or more cookies.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;dataset$total_buy2_full_lunch&amp;lt;-(
  dataset$sandwich_count*4 
 + dataset$apple_count * 1.5
 + dataset$chip_count * 2.5
 + dataset$cookie_count * ifelse(dataset$cookie_count== 1, 1, .75)
 + 1
)

#Build the cookie model
lunch_model_buy2_full_lunch&amp;lt;-lm(total_buy2_full_lunch ~ sandwich_count + apple_count + chip_count + cookie_count, data = dataset)

#Look at the model
kable(round(lunch_model_buy2_full_lunch$coefficients, 2), col.names = &amp;quot;Cost&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;(Intercept)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;sandwich_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;3.99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;apple_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;chip_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;cookie_count&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.68&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;And that is exactly what we see happened.&lt;/p&gt;
&lt;p&gt;So what are the implications of this and how is this different than the previous scenario? When there was a discrete prices change, as in our previous section, the direction of the error was affected by the whether the price went up or down. Also, that change was proportional to how much the cookie changed in price and how many times we purchased the cookie at each price. In fact, each of those things still holds true. The real difference in this type of situation is that it didn’t just affect the cookie coefficient, as in the first situation, but it affected the constant. This means that our model is affected regardless of if we actually purchase a cookie. It also has the effect of possbily being under or over our prediction, depending on the number of cookies we purchase.&lt;/p&gt;
&lt;div id=&#34;htmlwidget-4&#34; style=&#34;width:100%;height:500px;&#34; class=&#34;echarts4r html-widget&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-4&#34;&gt;{&#34;x&#34;:{&#34;theme&#34;:&#34;&#34;,&#34;tl&#34;:false,&#34;draw&#34;:true,&#34;renderer&#34;:&#34;canvas&#34;,&#34;events&#34;:[],&#34;buttons&#34;:[],&#34;opts&#34;:{&#34;yAxis&#34;:[{&#34;show&#34;:true,&#34;name&#34;:&#34;Cost&#34;,&#34;nameLocation&#34;:&#34;center&#34;,&#34;nameGap&#34;:25,&#34;axisLabel&#34;:{&#34;formatter&#34;:&#34;function(value, index) {\n        var fmt = new Intl.NumberFormat(&#39;en&#39;, {\&#34;style\&#34;:\&#34;currency\&#34;,\&#34;minimumFractionDigits\&#34;:0,\&#34;maximumFractionDigits\&#34;:0,\&#34;currency\&#34;:\&#34;USD\&#34;});\n        return fmt.format(value);\n    }&#34;}}],&#34;xAxis&#34;:[{&#34;type&#34;:&#34;value&#34;,&#34;name&#34;:&#34;Cookies&#34;,&#34;nameLocation&#34;:&#34;center&#34;}],&#34;legend&#34;:{&#34;data&#34;:[&#34;Actual&#34;,&#34;Prediciton&#34;]},&#34;series&#34;:[{&#34;data&#34;:[{&#34;value&#34;:[1,2]},{&#34;value&#34;:[2,2.5]},{&#34;value&#34;:[3,3.25]},{&#34;value&#34;:[4,4]},{&#34;value&#34;:[5,4.75]},{&#34;value&#34;:[6,5.5]},{&#34;value&#34;:[7,6.25]}],&#34;name&#34;:&#34;Actual&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20},{&#34;data&#34;:[{&#34;value&#34;:[1,1.96]},{&#34;value&#34;:[2,2.63]},{&#34;value&#34;:[3,3.31]},{&#34;value&#34;:[4,3.98]},{&#34;value&#34;:[5,4.66]},{&#34;value&#34;:[6,5.33]},{&#34;value&#34;:[7,6.01]}],&#34;name&#34;:&#34;Prediciton&#34;,&#34;type&#34;:&#34;scatter&#34;,&#34;symbol&#34;:null,&#34;coordinateSystem&#34;:&#34;cartesian2d&#34;,&#34;yAxisIndex&#34;:0,&#34;xAxisIndex&#34;:0,&#34;symbolSize&#34;:20}]},&#34;dispose&#34;:true},&#34;evals&#34;:[&#34;opts.yAxis.0.axisLabel.formatter&#34;],&#34;jsHooks&#34;:[]}&lt;/script&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; it should be pointed out that if we had presented the model some lunches where we didn’t buy any cookies, it wouldn’t have had such a drastic impact, but for demonstrating the effects of these scenarios, these were omitted.&lt;/p&gt;
&lt;div id=&#34;additional-sections-to-be-completed.&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Additional Sections to be completed.&lt;/h4&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Hire Heroes</title>
      <link>http://mreevesdsba.hopto.org/project/hire-heroes/</link>
      <pubDate>Sun, 28 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/hire-heroes/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Hire Heroes USA is a 501c3 nonprofit organization that empowers U.S. military members, veterans and military spouses to succeed in the workforce. They have helped over 30,000 clients find job placement through a number of services. In order to ensure the highest rate of success, machine learning was leveraged in order to recommend offered services based on demographic information of the client.&lt;/p&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;h2 id=&#34;approach&#34;&gt;Approach&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Traditional linear models, while offering excellent interpretability, assume that each part is independent of each other part. Whereas, in reality, something like a client’s willingness to travel a longer distance would be more significant if they had more dependents or had more severe disabilities. Additionally, the services provided are not isolated either. Receiving help with interviews and resumes will have a stronger effect when combined with creating a Linkedin account. In order to capture these complex interactions, non-linear, ensemble model structures were selected. This means that the precise, direct correlation between the model feature and the prediction cannot be defined, but the relative information gained from that feature can be calculated.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;dashboard&#34;&gt;Dashboard&lt;/h2&gt;
&lt;hr&gt;
&lt;h4 id=&#34;prediction-view&#34;&gt;Prediction View&lt;/h4&gt;
&lt;p&gt;Through an interactive dashboard, users are able to quickly identify the best combination of services provided by Hire Heroes in order to either maximize the probability of being hired or the minimize the time between starting the search and finding a job. This was accomplished through exhaustive grid search that runs hundreds of thousands of combinations through the models and selects the optimized set of services.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/hirepred.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;hr&gt;
&lt;h4 id=&#34;client-view&#34;&gt;Client View&lt;/h4&gt;
&lt;p&gt;Users can also review existing client&amp;rsquo;s information with recommendations for which services would aid them the most and the percentage of improvement in probability.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/hireclient.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br/&gt;
&lt;hr&gt;
&lt;h4 id=&#34;service-analysis&#34;&gt;Service Analysis&lt;/h4&gt;
&lt;p&gt;More in-depth analysis of each service for that specific client can also be viewed in order to see the total isolated effect of that service in all combinations with other services&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/hireservice.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Specialty Produce AI</title>
      <link>http://mreevesdsba.hopto.org/project/specialty-produce/</link>
      <pubDate>Sun, 28 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/specialty-produce/</guid>
      <description>&lt;h3 id=&#34;__due-to-the-sensitive-nature-of-internal-financial-records-the-dashboard-is-currently-not-available-to-the-public__&#34;&gt;&lt;strong&gt;Due to the sensitive nature of internal financial records, the dashboard is currently not available to the public.&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Specialty Produce is a family owned and operated food service and retail fresh produce supplier located in San Diego, CA. They supply to local restaurants, business, and are also open to the public. This creates a particularly difficult task to predict volumes as orders can range from a single item to multiple palettes. In order to overcome this, machine learning was implemented in order to provide insights into current-day as well as future orders.&lt;/p&gt;
&lt;p&gt;Each product is modeled individually. This is a difficult task as they carry thousand of products, many of them perishable.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/specialtydash1.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Numerous models were created and incorporated into the AI:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Order Quantity Fit&lt;/li&gt;
&lt;li&gt;Order Quantity Upper Bound&lt;/li&gt;
&lt;li&gt;Order Probability&lt;/li&gt;
&lt;li&gt;Order Expiration Quantity&lt;/li&gt;
&lt;li&gt;Daily Order Quantity Sellout by Expiration Probability&lt;/li&gt;
&lt;li&gt;Expiration Order Quantity Sellout by Expiration Probability&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each of those sets of models are built for&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Current-Day&lt;/li&gt;
&lt;li&gt;Next-Day&lt;/li&gt;
&lt;li&gt;Two Days&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This data is all plotted on an interactive chart in order to monitor the status of the models&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Point: Actual Order Quantity&lt;/li&gt;
&lt;li&gt;Cross: Same-Day Order Quantity Fit Prediction&lt;/li&gt;
&lt;li&gt;Colored Bar: Error (Color indicates direction of error)&lt;/li&gt;
&lt;li&gt;Dark Grey Bar: Same-Day Order Quantity Fit and Upper Bound&lt;/li&gt;
&lt;li&gt;Light Grey Bar: Next-Day Order Quantity Fit and Upper Bound&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/specialtydash2.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Models are batched daily. Each model is incorporated into final prediction based on the cost of the product (loss) and the price to rush-order that item (cost). Upper bounds are predicted in order to account for the loss associated with that product in general is less than the cost of rush-ordering additional quantity last-minute.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Exploratory Data Analysis Dashboard</title>
      <link>http://mreevesdsba.hopto.org/project/eda-dashboard/</link>
      <pubDate>Sat, 27 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/eda-dashboard/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;This started simply as a proof of concept for feature classification, but has the potential to be a fully-automated machine learning tool.
The idea is that, while no automation is perfect, some are helpful. By aiming to account for 80% of decisions to be correct and the remainder to be intuitively guided by the dashboard, this process can be extremely streamlined and remove a lot of the manual exploration. There are several key distinctions of this dashboard from other EDA tools. The first is NLP of the column name. While columns are not guaranteed to be named consistently, enough are to make the process valuable. The second is sorting by functional data types and not simply by data storage standards. Rather than numeric/character distinctions, data is sorted by how it is used. Free-form text is used much differently than categorical variables, despite both being character data fields. By setting thresholds on really simple parameters, a high level of accuracy can be achieved to sort columns. Once sorted, this drives the model feature engineering process.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;current-state&#34;&gt;Current State&lt;/h2&gt;
&lt;hr&gt;
&lt;h4 id=&#34;project-overview&#34;&gt;Project Overview&lt;/h4&gt;
&lt;p&gt;Users can create a new project which will contain multiple data sets. Datasets are linked by primary-key-&amp;gt;foreign-key connections. These start by checking for columns with the same name and then verifying content, otherwise simply by content. Users can also select their own dataset connections.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edaprojectnetwork.PNG&#34; alt=&#34;&#34;&gt;
&lt;br&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&#34;dataset-overview&#34;&gt;Dataset Overview&lt;/h4&gt;
&lt;h5 id=&#34;column-names&#34;&gt;Column Names&lt;/h5&gt;
&lt;p&gt;Users select the individual dataset that they want to explore. NLP parses column names in a number of ways&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Prefix/Suffix
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolname1.PNG&#34; alt=&#34;&#34;&gt;&lt;/li&gt;
&lt;li&gt;Common Terms
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolname2.PNG&#34; alt=&#34;&#34;&gt;&lt;/li&gt;
&lt;li&gt;Topic Modeling
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolname3.PNG&#34; alt=&#34;&#34;&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
&lt;h5 id=&#34;column-type&#34;&gt;Column Type&lt;/h5&gt;
&lt;p&gt;Columns are automatically sorted into a number of functional categories, with the option for users to change those classifications. Users can highlight and filter columns based on the column name data in the previous step:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolcat1.PNG&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolcat2.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;By expanding each category and selecting a column, a summary chart is provided based on the data type.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolcat3.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;h5 id=&#34;column-network&#34;&gt;Column Network&lt;/h5&gt;
&lt;p&gt;Columns can also be visualized in a network. Color and shape can be selected by prefix/suffix or by column category. Columns can also be connected by mutual population (i.e. they are only populated when the other is also populated)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/edacolnet1.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;future-state&#34;&gt;Future State&lt;/h2&gt;
&lt;p&gt;The next steps are to incorporate data wrangling and column creation. There is also the opportunity to incorporate automated feature engineering. Once that is completed, users will be able to select a target variable and create models based on applicable column types.&lt;/p&gt;
&lt;h3 id=&#34;link-to-dashboardhttpmreevesdsbahoptoorgeda&#34;&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/eda/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Link to Dashboard&lt;/a&gt;&lt;/h3&gt;
</description>
    </item>
    
    <item>
      <title>Image Recognition For Specialty Produce</title>
      <link>http://mreevesdsba.hopto.org/project/specialty-image/</link>
      <pubDate>Sat, 27 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/specialty-image/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Specialty Produce has one of the most extensive &lt;a href=&#34;https://www.specialtyproduce.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;databases&lt;/a&gt; of information surrounding produce. In order to fully leverage all of this information in the most advanced way possible, a project was started to perform image classification based on each of their products. The most prohibitive portion of most image recognition is not computation power, but labeled data collection. Specialty Produce is in the unique circumstance to have ready access to thousands of products. This is a highly valuable asset that is difficult with which to compete. The largest hurdle is simply collecting the variety of images and have them properly labelled. Through hardware development and digital data augmentation this hurdle was overcome.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;approach&#34;&gt;Approach&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Image recognition requires labeled images of &amp;ldquo;real-world&amp;rdquo; examples for each class. If the image recognition is in a restricted environment like a laboratory or machine line, the image surrounding the object is less important to introduce maximum variance. However, given that the end-state of this product will be user-submitted images, the images need to be as diverse as possible. Rather than attempting to recreate these settings in real-world environments, data is collected in as uniform of environments as possible and then introduce this variation digitally. Currently, the PoC is only classifying bananas by ripeness (i.e. days to being overripe)&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;There are 5 main components to the hardware:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Computer (Raspberry Pi)&lt;/li&gt;
&lt;li&gt;Camera module&lt;/li&gt;
&lt;li&gt;Spinning platform&lt;/li&gt;
&lt;li&gt;Photo box&lt;/li&gt;
&lt;li&gt;RFID chip reader&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/imagerecog/hardware1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;The computer is connected to a camera and spinning platform that capture numerous images of the product from different angles. This not only ensures maximum information gain, but also naturally balances the variation within each class. The photo box provides a uniform background which makes it easy to remove during pre-processing. In order to fully streamline the process and ensure as few misclassifications as possible, RFID tags are assigned to each product. After the item is placed on the platform, the corresponding card is tapped. The product ID is captured from the card, the photos are taken, and each image is stored in a database. A single product can be scanned in as little as 15 seconds with essentially no input from the user other than the card tap.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;software&#34;&gt;Software&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The data capture code, image processing, and the neural network are written in Python.&lt;/p&gt;
&lt;br&gt;
&lt;h4 id=&#34;data-capture&#34;&gt;Data Capture&lt;/h4&gt;
&lt;p&gt;The code relies on several python hardware libraries to interface with the camera, stepper motor, and RFID tag, in addition to file system and SQL database packages to store the information. The number of images per full-rotation can be selected; however, there are diminishing returns as the images might not have enough variation if more are selected and the capture time will increase. Encoding of the RFID tags is handled separately.&lt;/p&gt;
&lt;br&gt;
&lt;h4 id=&#34;image-processing&#34;&gt;Image Processing&lt;/h4&gt;
&lt;p&gt;There are 3 steps to the pre-processing before they can be consumed by the model:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Remove Background&lt;/b&gt;: the background of the image must be removed otherwise when the model sees a real-world image, it will be confused because it does not look like the photo box&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Digital Augmentation&lt;/b&gt;: by stretching, skewing, and otherwise altering the original, we can produce multiple images from one. This step accomplishes two things. The first is that it allows for various real-world variances to be introduced. Images will not have the same lighting conditions, angles, item placement, or color balance as the captured data so this is all introduced artificially. The second is that it allows for multiple training images to be produced from a single image.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Random Backgrounds&lt;/b&gt;: the images are added on top of random backgrounds to simulate the variety of real-world images that will eventually be processed by the production model. This helps train the model to ignore everything but the original item. This is also where the image is resized to fit the model&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/imagerecog/process.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h4 id=&#34;neural-network&#34;&gt;Neural Network&lt;/h4&gt;
&lt;p&gt;The network was coded directly in TensorFlow. Transfer learning pretrained on ImageNet was utilized in order to expedite learning. Currently, the PoC is only classifying bananas by ripeness (i.e. days to being overripe) and has not been properly tuned. Once a larger set of the final data set has been collected, hyperparameter tuning will be performed more thoroughly.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;end-state&#34;&gt;End-State&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;A twitter app has already been developed, allowing the model to run on an image tweeted to a specific account. After the model has run, it retweets with a model score. Eventually, this project will be incorporated into the Specialty Produce mobile app.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/imagerecog/twitter.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Vintage Smart Remote</title>
      <link>http://mreevesdsba.hopto.org/project/remote/</link>
      <pubDate>Sat, 27 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/remote/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The  Zenith Space Command was the first commercially available remote. It was battery-free and worked by using ultra-sonic clicks in order to communicate with the television. In essence, it was a musical instrument that only the television could hear. The goal of this project was to modernize the remote, maintaining its original form-factor and styling but adding WiFi and IR capabilities.
&lt;br&gt;
There were several goals to the project:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;WiFi-enabled&lt;/li&gt;
&lt;li&gt;Able to control TV, stereo, and lights&lt;/li&gt;
&lt;li&gt;Dependable&lt;/li&gt;
&lt;li&gt;User-friendly
&lt;br&gt;
&lt;br&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;approach&#34;&gt;Approach&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;As WiFi is notoriously power-hungry, enabling it in a remote device is a challenge. Another challenge was the limited number of buttons available. The one positive aspect of the project is that the remote is fairly large, by today&amp;rsquo;s standards, which allowed for a lot of room to add components. An ESP8266 chip was selected for its WiFi capabilities. This was combined with a battery and wireless charger. The additional components were the IR transmitter for local devices and a vibration sensor for battery management.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;hr&gt;
&lt;h5 id=&#34;build&#34;&gt;Build&lt;/h5&gt;
&lt;p&gt;Many of the original components were removed and the button contacts were wired to the microcontroller. A new support was designed and 3d-printed to house all of the components and hold the battery.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/remote2.jpg&#34; alt=&#34;3D-printed housing with development board&#34;&gt;&lt;/p&gt;
&lt;h5 id=&#34;microcontroller&#34;&gt;Microcontroller&lt;/h5&gt;
&lt;p&gt;The ESP8266 chip is a common starting point for many similar projects. It has a small footprint and quite capable, in fact overly capable for this project.&lt;/p&gt;
&lt;h5 id=&#34;battery&#34;&gt;Battery&lt;/h5&gt;
&lt;p&gt;An 800mAh battery was used as it was the largest battery that would still fit in the given space. It provides a decent amount of power for the project, but not nearly enough for a reasonable remote control without adjustments.&lt;/p&gt;
&lt;h5 id=&#34;charging&#34;&gt;Charging&lt;/h5&gt;
&lt;p&gt;In order to be more dependable and user-friendly without sacrificing the aesthetics, wireless charging was incorporated to allow it to be charged on any Qi-enabled charge pad.&lt;/p&gt;
&lt;h5 id=&#34;additional-components&#34;&gt;Additional Components&lt;/h5&gt;
&lt;p&gt;IR was added for local components (i.e. TV and stereo). A vibration sensor was also added in order to reduce battery usage. Without modifications, the remote lasted around 4 hours with the WiFi connection. However, by going into deep sleep until the vibration sensor is activated, this has been extended to over a week on a single charge, depending on usage. There is no discernible difference in functionality due to deep sleep.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/remote1.jpg&#34; alt=&#34;Ensuring buttons and charging work before switching from dev to production board&#34;&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;software&#34;&gt;Software&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The microcontroller was programmed with the Arduino IDE. WiFi SSID is set with an WAP if no connection can be established. The WAP allows the user to scan the local WiFi networks, select the desired connection, and add a password.&lt;/p&gt;
&lt;h5 id=&#34;button-configuration&#34;&gt;Button Configuration&lt;/h5&gt;
&lt;p&gt;Due to the lack of inputs, each button has two input methods: short press and long press. In addition to short and long presses, a single press of the yellow button allows for each of 4 lights to be controlled individually. This means there are a total of 11 button functions instead of 4.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/button.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;h5 id=&#34;wifi-communication&#34;&gt;WiFi Communication&lt;/h5&gt;
&lt;p&gt;In order to ensure ease of updates, the remote does not communicate directly with each smart device. Instead, an MQTT message is sent to a broker run through FLASK on a cloud server. The server then sends the appropriate command to the specified device.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;results&#34;&gt;Results&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;While the functionality of the remote is not as user-friendly as hoped, the other aspects of the project were quite successful. The styling and innovation from nearly 70 years ago has been modernized to accommodate for current technologies.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/remote3.gif&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Budgeting App</title>
      <link>http://mreevesdsba.hopto.org/project/budget/</link>
      <pubDate>Fri, 26 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/budget/</guid>
      <description>&lt;h2 id=&#34;project-overview&#34;&gt;Project Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;I am currently in the process of purchasing a house. Because it is far from move-in ready, I wanted to ensure that I tracked my expenses as thoroughly as possible. I created this simple app in under 5 hours. It is not meant to be a full-fledged budgeting app, but to capture the minimum-viable functionality that I required. Those functions were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add new items to the budget&lt;/li&gt;
&lt;li&gt;Categorize expenses by stage, room, and type&lt;/li&gt;
&lt;li&gt;Mark items as purchased&lt;/li&gt;
&lt;li&gt;Upload and view receipts.&lt;/li&gt;
&lt;li&gt;Track important dates and phases of the process&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The app was developed in R using Shiny, is deployed to AWS EC2, and has a connection to a SQL database on RDS. Dynamic DNS allows it to be accessed from any internet connection.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;dashboard&#34;&gt;Dashboard&lt;/h2&gt;
&lt;hr&gt;
&lt;h5 id=&#34;overview&#34;&gt;Overview&lt;/h5&gt;
&lt;p&gt;The overview tab shows the current budget as well as the remaining funds in order to quickly asses the current state of the budget.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/total.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;A graph breaks down each budget item based on whether or not it is purchased and by the selected category
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/budget1.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;A detailed view is shown for the hovered section
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/budget2.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;The timeline shows upcoming important events as well as each stage of the process
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/timeline.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Notifications alert the user to upcoming events
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/notifications.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;line-items&#34;&gt;Line Items&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The line items tab lists each of the budgeted items.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/lineitem.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;A calendar shows how many purchases were made each day. Hovering over each day will highlight the items that were purchased that day.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/linetimecal.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;The user can click on items that have already been purchased and view the purchase info and receipt.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/receipt.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;add&#34;&gt;Add&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Items are added on the sidebar.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/menu.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h5 id=&#34;add-event&#34;&gt;Add Event&lt;/h5&gt;
&lt;p&gt;There are two kinds of events in the app: single-day and multi-day. Single-day events are categorized as Services or Documents and show up as pins on the timeline. Multi-day events are named individually and are shown as line segments.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/addevent.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h5 id=&#34;add-item&#34;&gt;Add Item&lt;/h5&gt;
&lt;p&gt;Each budget item has the following attributes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Stage:&lt;/b&gt; stage of the processes where incurred&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Room:&lt;/b&gt; which room the item is for (where applicable)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Type:&lt;/b&gt; what type of expense it is (e.g. furniture, material, service, etc.)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Amount:&lt;/b&gt; amount of the item&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Recurring:&lt;/b&gt; for tracking ongoing expenses&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/item.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h5 id=&#34;add-receipt&#34;&gt;Add Receipt&lt;/h5&gt;
&lt;p&gt;Receipts can be uploaded for tracking and tax purposes. The name of the store is selected as well as each of the budget items purchased and the total amount. The receipt can be uploaded from mobile or desktop. Once the save button is clicked, all of the items that were selected will bet marked as purchased and the receipt will be available to view.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/addreceipt.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h5 id=&#34;add-category&#34;&gt;Add Category&lt;/h5&gt;
&lt;p&gt;In case a category wasn&amp;rsquo;t added previously, it can be done on the fly.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/budget/category.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;While it might not be perfectly seamless from a UI perspective, the functionality completes the need and will be much easier than trying to track in an application like Excel since it can be done from mobile devices. Interactivity is not necessary, but the development time is so minimal that it is worth the time.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h3 id=&#34;link-to-dashboardhttpmreevesdsbahoptoorgwsshinyhousebudget&#34;&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/wsshiny/HouseBudget/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Link to Dashboard&lt;/a&gt;&lt;/h3&gt;
&lt;br&gt;</description>
    </item>
    
    <item>
      <title>HOA Management Opportunity Dashboard</title>
      <link>http://mreevesdsba.hopto.org/project/hoa/</link>
      <pubDate>Fri, 26 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/hoa/</guid>
      <description>&lt;h2 id=&#34;project-overview&#34;&gt;Project Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The dashboard was designed to allow for easy exploration of the individual metrics as well as simple identification of similar neighborhoods.&lt;/p&gt;
&lt;p&gt;Analytically, the dashboard takes the selected metrics and normalizes them (scaling to between 0 and 1 to ensure uniformity) and calculates the distance between all neighborhoods. It then presents the user with the list of most similar areas&lt;/p&gt;
&lt;p&gt;Special care was given to protecting client data. It is not saved anywhere on the server, it can be cleared within the session, and will reset with a refresh button or closing the window.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;dashboard&#34;&gt;Dashboard&lt;/h2&gt;
&lt;hr&gt;
&lt;h5 id=&#34;overview&#34;&gt;Overview&lt;/h5&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/hoa/Capture.JPG&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/hoa/Capture1.JPG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;data&#34;&gt;Data&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The dataset profiles 462 neighborhoods in Mecklenberg County includes 26 separate metrics across multiple years.
The dataset was created in partnership among the City of Charlotte, Mecklenburg County, the UNC Charlotte Urban Institute, with the towns of Cornelius, Davidson, Huntersville, Matthews, Mint Hill, and Pineville.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h3 id=&#34;link-to-dashboardhttpmreevesdsbahoptoorgwsshinyhoa&#34;&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/wsshiny/hoa/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Link to Dashboard&lt;/a&gt;&lt;/h3&gt;
&lt;br&gt;</description>
    </item>
    
    <item>
      <title>Unisex Names Dashboard</title>
      <link>http://mreevesdsba.hopto.org/project/unisex-names-dashboard/</link>
      <pubDate>Fri, 26 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/unisex-names-dashboard/</guid>
      <description>&lt;hr&gt;
&lt;h2 id=&#34;domain-introduction&#34;&gt;Domain Introduction&lt;/h2&gt;
&lt;p&gt;Gender and naming convention are constantly shifting, from names shifting gender connotation, to the rise of unconventional names in recent years. However, Unisex name and their usage have shifted from being known as names for a certain gender to the other over time, or having a even split of gender usage. This study focused on identify unisex name and the prevalence of those names in the US populace. The analysis was focused on the US Baby Names dataset issued by the Social Security Administration which contains data collected names of babies born in the US from 1880 to 2013. R was used to analyze and visualize the data. The output of this study is an interactive Shiny App that can be used as a research tool in social science that reflects changing attitudes towards genders in the US.&lt;/p&gt;
&lt;h2 id=&#34;dataset&#34;&gt;Dataset&lt;/h2&gt;
&lt;p&gt;The dataset consisted of five columns; year, sex, name, n and prop. The contents of the columns are: Year has numeric values that span from 1880 to 2013, Sex has a character data type and has two possible values, male and female, Name also has character data type and consists of all unique names recorded in the time frame, n shows the number of people holding a certain name and prop shows the percentage of newborns having a certain name from each sex.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/mf/table.PNG&#34; alt=&#34;Dashboard Unisex Names Dataset Tab Inputs&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;design&#34;&gt;Design&lt;/h2&gt;
&lt;h5 id=&#34;_unisex-name-definition_&#34;&gt;&lt;em&gt;Unisex Name Definition&lt;/em&gt;&lt;/h5&gt;
&lt;hr&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/mf/dashdataset.PNG&#34; alt=&#34;Dashboard Unisex Names Dataset Tab Inputs&#34;&gt;
An important part of the analysis was to give a clear definition of unisex names. The benefit of relying on an interactive dashboard is that it enables the user to manipulate this definition in several key ways. The user is presented two methodologies of identifying unisex names. In the first, the user is able to select the minimum usage of that name over time as well as the minimum percantage of either gender. Conceptually this allows the user to choose names that are more or less common and are more or less balanced. In the second, K Means clustering analysis is applied to the dataset based on the scaled log of count of male and female over time. The user is able to select the number of clusters. The plot automatically marks clusters as male, female, or unisex based on their mean composition.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/mf/dashdatasetplot.PNG&#34; alt=&#34;Dashboard Unisex Names Dataset Tab Plot&#34;&gt;&lt;/p&gt;
&lt;h5 id=&#34;_popularity-metric_&#34;&gt;&lt;em&gt;Popularity Metric&lt;/em&gt;&lt;/h5&gt;
&lt;hr&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/mf/dashtrend.PNG&#34; alt=&#34;Dashboard Unisex Names Trends Tab Inputs&#34;&gt;
The third tab allows the user to dive deeper into the usage of specific names. The visualizations are designed to focus on the trends and shifting usage of names given two metrics of popularity. The first relies on the mean between sexes in a given year. A historical mean (based on the median of the dataset) and a current mean is calculated and the metric is the ratio between these means. The second is the is based on the relative difference between sexes at the maximum year of each. This maximizes the Male/Female ratio at time of highest popularity for that sex in that year&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/mf/metric.PNG&#34; alt=&#34;Dashboard Unisex Names Trends Tab Plot&#34;&gt;&lt;/p&gt;
&lt;p&gt;Users can select either metric and direction as well as the top N names for that combination. They can also select any set of names (up to 12) to compare from the dataset table.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/mf/dashtrendplot.PNG&#34; alt=&#34;Dashboard Unisex Names Trends Tab Plot&#34;&gt;&lt;/p&gt;
&lt;h3 id=&#34;link-to-dashboardhttpmreevesdsbahoptoorgwsshinymfdashboard&#34;&gt;&lt;a href=&#34;http://mreevesdsba.hopto.org/wsshiny/mfdashboard/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Link to Dashboard&lt;/a&gt;&lt;/h3&gt;
</description>
    </item>
    
  </channel>
</rss>
