<?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 Étienne Labrie-Dion on Medium]]></title>
        <description><![CDATA[Stories by Étienne Labrie-Dion on Medium]]></description>
        <link>https://medium.com/@labriedion?source=rss-1419980e2d30------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E4Yx4JjTlHhtUX0IFWKmKg.jpeg</url>
            <title>Stories by Étienne Labrie-Dion on Medium</title>
            <link>https://medium.com/@labriedion?source=rss-1419980e2d30------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:11:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@labriedion/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Simple Way To Extract Topics From User Comments]]></title>
            <link>https://medium.com/workleap/simple-topic-modeling-for-user-comments-5902d81d292e?source=rss-1419980e2d30------2</link>
            <guid isPermaLink="false">https://medium.com/p/5902d81d292e</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <dc:creator><![CDATA[Étienne Labrie-Dion]]></dc:creator>
            <pubDate>Fri, 22 Nov 2019 15:25:49 GMT</pubDate>
            <atom:updated>2020-02-06T14:17:31.692Z</atom:updated>
            <content:encoded><![CDATA[<h4>How we want to help companies understand how their employees feel</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*2bgAuESE2MPiNgvS" /></figure><p>Pulse surveys are a big trend in HR. These short weekly surveys ask employees simple questions about how they feel at work. In <a href="https://www.officevibe.com/">Officevibe</a>, people are also invited to leave additional feedback when they fill out the survey.</p><p>And they have a lot to say! A typical manager receives about one comment every month from each of their team members. In medium to large companies (200+ employees), the amount of messages quickly gets out of hand and understanding what employees are trying to tell you becomes close to impossible.</p><p>Imagine being one of these overwhelmed managers, and having so many comments to read that important or sensitive feedback falls through the cracks. Your team members finally have a way to share how they’re feeling, but you can’t seem to get what’s actually going on. You know the information is there, but you just don’t know where to start!</p><p>We can use AI to give these managers superhuman hearing and make sure their employees feel heard, no matter how much is on the manager’s plate. We developed a simple unsupervised topic segmentation solution to address this problem. We called this proof-of-concept “Project <strong><em>Outline”.</em></strong></p><h3>Outline: How a word becomes a topic</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qgOfbhIXvT2tCdom" /><figcaption>Photo by <a href="https://unsplash.com/@headwayio?utm_source=medium&amp;utm_medium=referral">Headway</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Outline simplifies the exploration of a large number of user comments by automatically extracting relevant topics and trends. For example, Outline reads a comment such as <em>“I love the new break room!”</em>, and summarizes it into relevant <a href="https://en.wikipedia.org/wiki/Keyword_extraction">keywords</a> such as “office” or “break”. Over a large number of comments, these simple topics highlight the most important subjects discussed in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7T-SQcKT5ejvwra7bsuYrg.png" /><figcaption>Outline extracts the topics for each comment in the dataset for easy exploration</figcaption></figure><p>In the background, Outline goes through a list of possible topics and assigns a topic to a comment when <strong>their meanings are close together</strong>. This is made possible with a model called <strong><em>Word2vec</em></strong>, a technology developed at Google that <strong>can transform text into a series of numbers (also called vectors)</strong>. This process, called word embedding, is a common way of transforming text into something a computer can understand. Outline can then compare the meaning of words because the mathematical distance between word vectors in a word embedding is a reliable measure of their similarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypRxUJrzxuaXNRBUWywGZQ.png" /><figcaption>Using word embeddings produced by word2vec, the word “office” can be converted into a series of numbers, or vector, that represents the meaning of the word in a computer-readable way</figcaption></figure><h4>How we built Outline</h4><p>One of the keys to our solution is that we trained our own word embeddings for Word2vec over 4 million + anonymized user comments. When we use our own embeddings, Outline works fine. But when we tried pre-trained embeddings from the Wikipedia corpus, the results were a disaster. Why is that? We believe that since our embeddings are trained on comments relating only to the workplace, they capture important semantic relations that generic embeddings fail to grasp. For example, in our dataset, “manager” usually refers to one’s immediate manager at work, whereas on Wikipedia, “manager” can be any kind of manager, such as a campaign manager.</p><p>Next, we built a list of common English words that can be featured as topics. We removed stop-words, overly frequent words and also generic ones such as “anybody”. The list is fairly long (6000+), so as not to limit the possible topics. Note that because we find the topics in this list rather than in the comments, comments can be tagged with words it doesn’t contain.</p><figure><img alt="How Outline extract topics from short comments." src="https://cdn-images-1.medium.com/max/1024/1*8qv5JRKuYO2EJG5saGTtDw.png" /><figcaption>How Outline works in the background</figcaption></figure><p>We then calculated all vectors for each comment and each keyword from the topic list. Comments were made into a single word vector by averaging the vectors of all the important words inside the comment. Although this operation can wash out some finer meaning in the sentence, it’s been <a href="https://www.aclweb.org/anthology/P16-1089">widely reported as a strong baseline in practice</a>.</p><blockquote>Surprisingly, simply averaging word embeddings of all words in a text has proven to be a strong baseline or feature across a multitude of tasks (Kenter et al., 2016)</blockquote><p>The next step is to measure the distance between vectors to compare the semantic similarity between the keywords and the comments. We used a common measure for word vectors, the cosine distance. We then empirically determined a significance threshold; if the distance between two words was smaller than this threshold, then the word was considered a topic describing that particular comment.</p><p>Finally, we used this distance to assign topics to user comments and build our solution.</p><h3>A jump-start for exploration</h3><p>Outline outputs simple comment counts for each topic. Our idea is to aggregate these over a period of several months to show trending topics over time. We believe that companies and their managers will benefit from being able to quickly assess what were the most important topics, and then decide what subject to explore in-depth. Here’s a mock-up of how we see this playing out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*C35ufvh6GlXBb6Z4wOARyQ.png" /><figcaption>How Outline’s output could be implemented</figcaption></figure><p>For each topic, you can see the number of individual feedbacks left for a given period of time. Several pages can be available, depending on the number of topics found.</p><p>The next two columns, “Monthly Sentiment var.” and “Sentiment”, rely on a sentiment analysis model we built especially for Outline to predict whether comments are positive or not. I won’t go into details on the sentiment model here; maybe in a future blog post.</p><p>The most interesting part of Outline is also how easy it is to look at trending topics through time. For example, imagine you’re looking at your own business’ user comments and you want to have an idea of how often and when people talk about stress. In the following graph, there’s a period at the end of the summer where lots of positive comments were left about stress. By going through those specific comments, you might discover that your employees are way less stressed right after their summer vacations — and might consider, for example, introducing extra days off throughout the year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*PNG-y-RkVKJoNSLBI1eTNQ.png" /><figcaption>Quickly visualize a topic’s popularity and sentiment throughout the year</figcaption></figure><h3>Conclusion</h3><p>Outline was built with non-expert users in mind, such as managers and executives, to help them easily explore large amounts of unstructured text.</p><p>Some of the advantages of our technique over other unsupervised topic segmentation models are:</p><ul><li>Topics can be extracted from<strong> any dataset size</strong>, even just a single sample (although aggregated results will be more interesting with larger amounts of data).</li><li>Once the word embedding model is trained and the vectors are calculated, <strong>processing even very large datasets is extremely fast </strong>(4 million+ comments in a few seconds on a laptop).</li><li>Topics are formed by <strong>single words and are easy to interpret</strong>, as compared with other topic models such as <a href="https://en.wikipedia.org/wiki/Latent_Dirichlet_allocation">Latent Dirichlet allocation</a> (LDA).</li><li>The extracted topics are simple data points, well suited for<strong> trend analysis and emerging topic detection</strong>.</li></ul><p>We believe this technique would be applicable to a wide variety of other tasks since it doesn’t require any domain knowledge, human intervention, topic naming or interpretation to give meaningful results.</p><p>Stay in touch with for news about our other AI projects!</p><p><strong><em>Acknowledgements: </em></strong><em>Outline was built with the collaboration of Hugo Tremblay Ledoux and Anastasia Artemova. Big thanks to Hugo for the mock-ups.</em></p><p><strong><em>References: </em></strong>Kenter et al. (2016). “ Siamese CBOW: Optimizing Word Embeddings for Sentence Representations”. arxiv: <a href="https://arxiv.org/pdf/1606.04640.pdf">1606.04640</a></p><p>Mikolov, Tomas; et al. (2013). “Efficient Estimation of Word Representations in Vector Space”. arvix: <a href="https://arxiv.org/abs/1301.3781">1301.3781</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5902d81d292e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/workleap/simple-topic-modeling-for-user-comments-5902d81d292e">A Simple Way To Extract Topics From User Comments</a> was originally published in <a href="https://medium.com/workleap">Workleap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anomaly Detection in Cloud Costs Without False Positives]]></title>
            <link>https://medium.com/workleap/anomaly-detection-in-cloud-costs-without-false-positives-988477ea8804?source=rss-1419980e2d30------2</link>
            <guid isPermaLink="false">https://medium.com/p/988477ea8804</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <dc:creator><![CDATA[Étienne Labrie-Dion]]></dc:creator>
            <pubDate>Tue, 24 Sep 2019 20:16:21 GMT</pubDate>
            <atom:updated>2019-09-25T14:30:24.489Z</atom:updated>
            <content:encoded><![CDATA[<h4>Safeguarding against false positives doesn’t have to be complicated</h4><p>Most IT teams don’t have the time or means to properly monitor the evolution of their cloud environment. A good first step to keep costs under control is using monitoring software such as <a href="https://sharegate.com/products/sharegate-overcast">ShareGate Overcast</a>, our solution for Microsoft Azure cost management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7RlHMuWhGdAJDf0Y.png" /></figure><p>The problem is, unless the IT team reviews their current cloud spend every day,<strong> sudden spikes in resource costs can remain undetected for weeks.</strong> These unexpected increases are usually only caught when their impact is so large it shows in the monthly totals.</p><p>How do you make sure IT teams are aware of any spikes in their cloud spend? We addressed this with an alert system based on <a href="https://en.wikipedia.org/wiki/Anomaly_detection">anomaly detection</a>. Our project code-named <strong>Oddity </strong>detects all unexpected variations in resource costs and shows them to the user.</p><p>Although it’s relatively easy to identify large cost spikes, our system initially generated tons of irrelevant alerts for smaller increases. We had to fix that. No IT team wants to deal with hundreds of false alarms a week!</p><h4>The problem of false positives</h4><p>Even the best models end up generating several false positives for every true positive.</p><p>To illustrate this, let’s say your model always detects any anomaly, but it also wrongly flags an event as anomalous 1% of the time. If your dataset contains one anomaly out of a 100 events, then your model will detect it along with one false positive (1% of 100). Thus, only 1 out of 2 alerts is a true positive, even though your model is pretty good.</p><p>Now, imagine your dataset still contains only one anomaly, but this time out of 1000 events. Your model still generates 1% false positives, which is 10 false positives out of 1000 events. This “excellent” model now produces 10 false positives for every true positive!</p><p>This concept is properly described as the <a href="https://en.wikipedia.org/wiki/Base_rate_fallacy">base rate fallacy</a>. The following paper describes the importance of the base rate fallacy in anomaly detection: <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.137.5981&amp;rep=rep1&amp;type=pdf"><em>The Base-Rate Fallacy and the Difficulty of Intrusion Detection</em></a>.</p><p>This is why our main concern while building our Oddity was to eliminate false positives. Usually, there’s no straightforward way to filter out false positives without also significantly reducing the chances of catching anomalies. Thankfully, costs are a bit more amenable. They are easily compared and their value is directly relevant for businesses. Since every resource is metered and tied to a real-life cost, then each alert can be evaluated in importance according to its cost.</p><h3>Oddity: Anomaly detection without the false positives</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NZ6SrpUrE4SC-VGX" /></figure><p>Oddity automatically detects abnormal spikes in spending for each Azure cloud resource. Our approach is similar to the method described in the following paper: <a href="https://www.researchgate.net/publication/329792334_DeepAnT_A_Deep_Learning_Approach_for_Unsupervised_Anomaly_Detection_in_Time_Series">DeepAnT: A Deep Learning Approach for Unsupervised Anomaly Detection in Time Series</a>.</p><p>Here’s how it works:</p><ul><li>Every day, the <strong>forecasting model</strong> outputs a predicted cost for each resource. This model is a deep neural network with multiple 1-dimension convolutional layers, similar to <a href="https://medium.com/gsoft-tech/the-technology-behind-our-first-ai-product-256ff27c8802">one of our previous solutions</a>.</li><li>Oddity then calculates the difference between the predicted cost and the actual resource cost on that day. We call this the<strong> prediction error</strong>.</li><li>An <strong>anomaly </strong>is detected if the prediction error is higher than a given threshold<strong>.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tuIdd3gxX9BwK3JPnWuNpg.png" /></figure><p>Oddity uses two thresholds to filter out false positives:</p><ul><li><strong>The base threshold </strong>is a hard-coded dollar value determined by the user. It’s the amount below which a user considers an anomaly to be irrelevant. For example, a large company might decide they don’t want to be bothered by anything less than a hundred dollars.</li><li><strong>The sensitivity threshold</strong> is a moving average of the prediction error over the last 15 weeks. Basically, if Oddity recently made very few errors in predicting costs, the sensitivity threshold is going to be small and allow the detection of smaller anomalies. On the other hand, when the prediction error is very high (which can mean this resource’s costs are hard to predict), higher values will be needed to trigger an alert. Thus, the sensitivity threshold is self-correcting in nature and will lower the amount of false positives generated.</li></ul><h4>Oddity in action</h4><p>Here’s an example of Oddity’s output with a base threshold of 5$. The sensitivity threshold is shown below as a purple shaded zone. The costs and predictions are shown as the yellow squares and purple line. Oddity detected an anomaly on September 5th; you can see it under the red star.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8u6lMN-i52kGrXxF_Ug3A.png" /><figcaption>Oddity flags values outside the sensitivity threshold (shaded zone) and higher than the base threshold (5$ here) as anomalies (red star)</figcaption></figure><p>Oddity detects anomalies when a yellow square is out of the shaded zone — i.e., when a cost is outside the sensitivity threshold. Oddity will then check if the prediction error is above the base threshold, and if so, flag the cost as an anomaly. Here, the value on September 5th is outside the shaded zone and the size of the prediction error (about 13$) is also above the base threshold, so it’s shown as an anomaly.</p><p>You can observe a few cases where yellow squares are not flagged as anomalies (for example August 27th, September 4th) because the prediction error is lower than the base threshold of 5$.</p><p>One important thing to note about the sensitivity threshold is that it will always be wider after detecting an anomaly. You can see this clearly in the graph: the threshold before vs after detecting an anomaly is clearly different. So much that an event on September 17th would’ve been flagged as an anomaly had it not been for the larger event on September 5th. This reduces the amount of events generated by a single resource and lowers the overall false positive rate.</p><h3>An anomaly in anomaly detection?</h3><p>The trade-off between sensitivity and noise in anomaly detection is hard to calibrate properly. For most tasks, there’s no shorthand that can directly solve this problem. In the case of cloud spend anomalies, their cost makes it possible to easily figure out which anomalies bring the most business value.</p><p>Anomalies vary wildly between use cases and your specific task determines how much of a challenge is filtering out false positives. Focus on your business case and consider simple solutions to filter out the noise.</p><p>Thanks for reading! Be sure to check out the <a href="https://medium.com/gsoft-tech">GSoft Tech blog</a> for more news about our AI experiments.</p><p><strong><em>Acknowledgements: </em></strong><em>Oddity was built with the collaboration of Hugo Tremblay Ledoux, with invaluable input from Stéphane Lapointe.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=988477ea8804" width="1" height="1" alt=""><hr><p><a href="https://medium.com/workleap/anomaly-detection-in-cloud-costs-without-false-positives-988477ea8804">Anomaly Detection in Cloud Costs Without False Positives</a> was originally published in <a href="https://medium.com/workleap">Workleap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The technology behind our first AI product]]></title>
            <link>https://medium.com/workleap/the-technology-behind-our-first-ai-product-256ff27c8802?source=rss-1419980e2d30------2</link>
            <guid isPermaLink="false">https://medium.com/p/256ff27c8802</guid>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[convolutional-network]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Étienne Labrie-Dion]]></dc:creator>
            <pubDate>Tue, 02 Apr 2019 13:49:46 GMT</pubDate>
            <atom:updated>2019-04-02T20:51:04.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_6PEdcrky7nKgjbv" /></figure><p>A few years ago, <a href="https://www.gsoft.com/en">GSoft</a> made a commitment to being data-driven. We built a diverse data team and solid data practices that percolated throughout the organization into an amazing data culture. So, when faced with a problem only AI could solve, it just felt natural for GLab (our R&amp;D team) to jump head first into building our very first AI product.</p><h3>Predicting the future</h3><p><a href="https://en.wikipedia.org/wiki/Virtual_machine">Virtual machines</a> (VMs) account for a significant and growing part of cloud costs. Unmonitored <a href="https://azure.microsoft.com/en-ca/services/virtual-machines/">pay-as-you-go VMs in Azure</a> can easily amount to hundreds, if not thousands, of dollars each month. Here at GSoft, many of our own VMs sit idle more than half the time. We set up fixed ON/OFF schedules (also called <em>runbooks</em>) for some of our VMs, but this is an <a href="https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management">inconvenient, error-prone process</a> that doesn’t scale with our evolving VM usage.</p><p>Two years ago, we built a prototype (Snoozit 1.0!) to help simplify runbook configuration. We wanted to replace the usual <a href="https://docs.microsoft.com/en-us/azure/automation/automation-first-runbook-textual-powershell">PowerShell scripts</a> with a simple interface. But as it turns out, the solution to runbooks is not easier runbooks, it’s no runbooks at all. At the time, we weren’t ready to properly automate VM scheduling. Because to do that, you need to predict the future.</p><p>Let me explain.</p><p>Turning off a VM is not a big challenge in itself. You can always monitor a given VM and shut it down if it hasn’t been active enough lately, and even <a href="https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management#scenario-3-startstop-automatically-based-on-cpu-utilization">Microsoft offers a solution</a> for this. But this approach (even Microsoft’s) presents two challenges. Problem #1: How do you determine if a period of inactivity is going to persist? Problem #2: When do you know it’s time to turn the VM back on again? You wouldn’t want your VMs to start shutting down because you had an impromptu three-hour meeting, and then have to wait for the next morning to have this corrected by your hard-coded schedules.</p><p>The only way to really solve problems #1 and #2 is to make an assumption on what the future holds. You could do that in several ways, for example by averaging the VM’s CPU activity over the last month, or using auto-regressive methods such as <a href="https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average">ARIMA</a>. The problem with these methods, however, is that they are limited to the current sequence and can’t integrate other data sources.</p><p>This is why we decided to try and solve these problems with modern machine learning techniques. AI algorithms can be trained over a large corpus of sequences and variables to improve on these baseline methods. In fact, these techniques can even guess how a VM is going to be used even when its full behavior hasn’t been seen yet.</p><h3><strong>Snoozit: Deep learning &amp; rule-based logic</strong></h3><p>We structured <a href="https://snooz.it/">Snoozit</a> into two main components: a forecasting layer and a decision layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*EULcp59GhgR418QlNZdVTQ.png" /><figcaption><a href="https://snooz.it/">Azure virtual machines auto-scheduling with AI</a></figcaption></figure><h4>The forecasting layer</h4><p>This layer is a neural network made of 1-dimensional convolution neural networks (<a href="https://en.wikipedia.org/wiki/Convolutional_neural_network">CNNs</a>) and two fully-connected layers (just the typical layers in a neural net). With one month of CPU usage data, this deep neural network will forecast the next 4 hours of CPU activity. These predictions can be included in a feed-forward loop to produce week-long forecasts that are then used by the decision layer (using the predicted value as new values for the next predictions).</p><p>CNNs are <a href="https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/">usually used for image recognition</a> with 2-dimensional data. In our case, the neural networks read the VM activity as a 1-dimensional image. It’s a surprisingly powerful technique to extract meaningful patterns and trends over a long sequence.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8dace695b845dae23b7d5ab2d385d05c/href">https://medium.com/media/8dace695b845dae23b7d5ab2d385d05c/href</a></iframe><p>We settled on this solution after trying many different combinations of network structure, loss functions, forecast length, etc. We first tried to use long short-term memory networks (<a href="https://en.wikipedia.org/wiki/Long_short-term_memory">LSTMs</a>), which are sequence-based neural networks, but the training time was extremely long. So long that, by the time we had a working solution with LSTMs, we had what would become our final solution with 1D CNNs, which can be trained <a href="https://stats.stackexchange.com/q/262222">much more quickly</a>.</p><p>Fun fact: We actually had the solution for the forecasting layer for months and kept trying — and failing — to beat it.</p><h4>The decision layer</h4><p>This layer encapsulates the forecasting layer with traditional rule-based logic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NF1AXHx2du-ET9UkzAZDWw.png" /><figcaption>Snoozit’s decision layer</figcaption></figure><ol><li>The first step is to determine if the VM is currently being used or not. We use a simple threshold of 5% CPU activity (which happens to be the default setting in Microsoft’s <a href="https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management#scenario-3-startstop-automatically-based-on-cpu-utilization">automatic shutdown solution</a>). We calculate the activity level over the past three hours.</li><li>Then, if the VM is flagged as being unused, the algorithm reads the forecast to determine if this inactivity period is going to persist for a number of hours. This step solves Problem #1.</li><li>If it determines that the VM is not going to be used in the next few hours, the algorithm produces a week-long forecast, then searches for the next predicted high-CPU activity period. If a high-activity period is found in this forecast, Snoozit starts the process of shutting down the VM. The software then sets up a start time an hour before this high-activity period. If no high-activity period is found within the next week, then the VM stays on, but the algorithm will re-evaluate its decision in an hour. This step solves Problem #2.</li><li>Check that the VM is still unused.</li><li>Shut it down.</li></ol><h3><strong>GSoft’s first AI product</strong></h3><p>We have been managing our own VMs with <a href="https://snooz.it/">Snoozit </a>for a while without any major hiccups. Our IT team had some concerns when we first tested it, but they’ve learned to love it because of its simplicity and adaptability.</p><p>Developing Snoozit was really exciting. At the time, I thought it was because we were making progress on a brand new product. But now I realize that we knew, even then, that we were doing something bigger by getting GSoft started on a journey into artificial intelligence.</p><p>Stay tuned — we have lots more in the works.</p><p>Étienne</p><p><strong><em>Acknowledgements: </em></strong><em>The algorithm was built in collaboration with the incredible Hugo Tremblay Ledoux. My amazing colleagues at the GLab built Snoozit: Éric Routier, Guillaume Chalifoux, Sébastien Crevier, Southisack Johnny Kounlavout, Antoine Jagueneau and Maxime Dupras.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=256ff27c8802" width="1" height="1" alt=""><hr><p><a href="https://medium.com/workleap/the-technology-behind-our-first-ai-product-256ff27c8802">The technology behind our first AI product</a> was originally published in <a href="https://medium.com/workleap">Workleap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Started with Deep Learning using Keras]]></title>
            <link>https://medium.com/data-science/get-started-with-deep-learning-using-keras-a45ee421f3ef?source=rss-1419980e2d30------2</link>
            <guid isPermaLink="false">https://medium.com/p/a45ee421f3ef</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Étienne Labrie-Dion]]></dc:creator>
            <pubDate>Tue, 18 Sep 2018 02:12:10 GMT</pubDate>
            <atom:updated>2018-10-05T13:25:28.356Z</atom:updated>
            <content:encoded><![CDATA[<p>Deep Learning is at the forefront of the AI revolution, and for good reasons — incredible advances in natural language processing, image recognition, and even computer playing Go, have all been made thanks to the help of deep neural networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K1K4XK90c5RaBj4V" /><figcaption>Alexa in the Amazon Echo uses deep learning to understand human language. <a href="https://unsplash.com/@andresurena?utm_source=medium&amp;utm_medium=referral">Andres Urena</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Because of the complexity of the tasks most neural networks have to accomplish, most people would expect that it’s hard to set up a neural network. Yeah, maybe 5 years back that would’ve been completely true and you would’ve had to set up your neural network from scratch. But today, with open-source frameworks such as <a href="https://keras.io/">Keras</a>, it can be quite simple to get started. Here’s how. (<a href="https://gist.github.com/labriedion/9e1480a22d2e259f460b56c84a01a186">Here’s the full script</a> if you want to skip ahead!)</p><h3>The problem: predicting a salary using demographic variables</h3><p>First, let’s find a toy problem to get started with. Here’s one I found: <a href="https://www.kaggle.com/johnolafenwa/us-census-data">US Adult income data from the 1994 US Census Database</a>. We will try using several fully connected neuron layers to predict a given person’s salary in the census.</p><p>To be honest, deep neural networks are probably a tad overkill for this task. Traditional data science techniques such as logistic regression are perfectly suited for this and infinitely easier to interpret. Still, this is a good way to get started with Keras.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZVOxixntbsemuR58" /><figcaption><a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Imports</h4><p>To follow with this code, first install <a href="https://www.python.org/downloads/">Python 3</a>. When this is done, open your OS terminal, and type the following:</p><p>pip install <strong>pandas</strong></p><p>Then install the following packages after pandas: <strong>sklearn</strong>, <strong>tensorflow</strong>, and finally, <strong>keras</strong>.</p><p>First, we’ll start with our imports. This script will need:</p><ol><li><strong>pandas</strong> for the data manipulation,</li><li><strong>numpy</strong> for some quick operations,</li><li><strong>sklearn</strong> for data scaling and performance measurements,</li><li>and finally, <strong>keras</strong>, our deep learning framework.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f5319b959ed3110eecd6d69893b39e5/href">https://medium.com/media/2f5319b959ed3110eecd6d69893b39e5/href</a></iframe><h4>Loading the dataset</h4><p>Our dataset contains variables such as the age of the worker, his or her education level, the number of years of education, marital status, job title, etc. The last value included in this dataset is the salary range, either lower or higher than $50,000. We will be using the former variables to predict this target.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3d4a2bb0b8d4c346b2478923fb2d87c/href">https://medium.com/media/e3d4a2bb0b8d4c346b2478923fb2d87c/href</a></iframe><h4>Preparing the dataset</h4><p>The next step is to prepare our dataset for Keras. We need to do the following:</p><ol><li><strong>Balance the classes. </strong>Unbalanced classes will interfere with training.</li><li>Transform the categorical variables (occupation, for example) <strong>into one-hot encoded variables</strong>. Basically making a new column for each label with a value of 0 or 1.</li><li><strong>Extract the X </strong>(variables) <strong>and y </strong>(targets) <strong>values</strong> for the training and testing datasets.</li><li><strong>Scale</strong> the variables.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c9d264d5dcbf0847c3c468902df9948/href">https://medium.com/media/7c9d264d5dcbf0847c3c468902df9948/href</a></iframe><h3>The model in Keras</h3><p>Now for the good part! Building the Keras model. There’s two interfaces to build models in Keras, the sequential model API and the functional API. Today, we will be using the sequential model API since it’s easier to follow and to build.</p><p>Here’s what we need to do.</p><ol><li>First, we will be setting up a <strong>ModelCheckpoint</strong> object to allow us to save the best results during the training process.</li><li>Then, we’ll create a <strong>Sequential</strong> model object unto which we will add the different neural layers.</li><li>We will need to choose the appropriate <strong>activation</strong> functions, <strong>optimizer</strong> and <strong>loss</strong> functions to build our <strong>binary classification model </strong>(we are trying to predict values of 0 or 1 for one variable).</li><li>Finally, we will <strong>train</strong> our network.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ed6828900d599eb19b5f2430d65848c/href">https://medium.com/media/6ed6828900d599eb19b5f2430d65848c/href</a></iframe><h4>Evaluating the model’s performance</h4><p>How did we do? Let’s measure our model’s performance! We will measure the <a href="https://en.wikipedia.org/wiki/Precision_and_recall">precision</a>, a value of the amount of exact classifications.</p><ol><li>We will need to <strong>load the weights</strong> we saved during the model training and <strong>compile the model</strong> with those weights.</li><li><strong>Predict the values</strong> in the test dataset using the model.</li><li><strong>Compare</strong> the <strong>predicted</strong> salaries to the <strong>actual</strong> salaries in the test dataset.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/213169d144db496997049586ce74826d/href">https://medium.com/media/213169d144db496997049586ce74826d/href</a></iframe><p>In the end, this model gets a precision of about 87% for salaries below 50K and a precision of about 72% for salaries higher than 50K.</p><p>Not bad for a model with no feature engineering whatsoever…</p><p>The whole script is available <a href="https://gist.github.com/labriedion/9e1480a22d2e259f460b56c84a01a186">here on GithubGist</a>.</p><p>I hope you enjoyed my tutorial!</p><p>Étienne</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a45ee421f3ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/get-started-with-deep-learning-using-keras-a45ee421f3ef">Get Started with Deep Learning using Keras</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>