<?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 Floor Eigenhuis on Medium]]></title>
        <description><![CDATA[Stories by Floor Eigenhuis on Medium]]></description>
        <link>https://medium.com/@floor-eigenhuis?source=rss-631799ed816------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*PQ135_CC6voGx217rHYlKg.jpeg</url>
            <title>Stories by Floor Eigenhuis on Medium</title>
            <link>https://medium.com/@floor-eigenhuis?source=rss-631799ed816------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:26:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@floor-eigenhuis/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[Platform thinking: do’s and don’ts when designing a cloud-native platform from scratch]]></title>
            <link>https://medium.com/incentro/platform-thinking-dos-and-don-ts-when-designing-a-cloud-native-platform-from-scratch-27b4c68e1d72?source=rss-631799ed816------2</link>
            <guid isPermaLink="false">https://medium.com/p/27b4c68e1d72</guid>
            <category><![CDATA[platform]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Floor Eigenhuis]]></dc:creator>
            <pubDate>Fri, 21 May 2021 07:33:35 GMT</pubDate>
            <atom:updated>2021-05-21T12:16:35.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6zDOADlmiNr1Gm62VlDnJw.jpeg" /><figcaption>Cloud-native, of course. Photo by <a href="https://unsplash.com/@dianamia?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">C Dustin</a> on <a href="https://unsplash.com/s/photos/cloud?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Fellow engineers: how does the following (often untrue) tale sound to you?</p><p>You are a software engineer. You get the opportunity to design a platform that has the potential to reach millions of users. The platform plays perfectly into CSR(corporate social responsibility). You have no legacy software to work with and you have complete control over how you want to design the platform. The only requirements to the platform are that it is built in a future-proof way and that security and privacy are built into the platform from the start. How does that sound to you? Well, if someone would say this to me I’d say there’s no such thing. Being a software engineer, 95% of the time you have to build on whatever has been built already. Nonetheless, this is exactly the opportunity we had and I’m going to tell you aaaaaalll about it in this blog. Let’s go! 🚀</p><h3>The idea.</h3><p>Working at an agency that helps its customers with their digital transformations, we rarely have startups as customers. Of course, hiring external consultants costs money, which is something startups rarely have access to. Once in a blue moon, there’s a startup with a really innovative idea that has managed to get some funding but has no IT knowledge. The name of that startup is The Social Handshake, and that is where we came in 😎.</p><p>We designed and built a platform called LoonGift, in which doing good is made easy by enabling employees to directly donate part of their salary to a charity of their choice. The amount you want to donate is deducted directly from your pay stub and your employer has no access or insights into which charities you donate to. At the end of a fiscal year, you get tax benefits over the amount that you donated to charity. It’s easy for participants to sign up and change their donations. Another added benefit is that employers pay for the use of the platform, so the entire donation from the employee goes to the charity. Also, the charity cannot ask you for more money or send you any other information if you haven’t signed up for it and the charities don’t pay retention costs or acquisition costs.</p><p>The concept behind LoonGift is called <em>payroll giving. </em>Payroll giving has already been popular in several countries throughout Europe, for example in Germany and England. Nothing like this existed in the Netherlands, however.</p><h3>The how.</h3><p>So how did we go about doing this? Given the fact that nothing like this exists in the Netherlands yet and given the fact that the concept has proved itself in other European countries, we had a unique opportunity to design a platform that can potentially be <em>huge</em> from scratch! Truly cloud-native. ☁️ Since we (Incentro) are a Google Cloud partner and Google Cloud Platform is AWESOME, we built everything on GCP.</p><p>We did use some techniques that were new to us. Usually, we help our customers with their digital transformation. That means that we have to work with whatever the customer already uses in their IT landscape, which usually consists out of REST APIs. In this project, we had the opportunity to work with some techniques that were new to us. In this case, we made a gRPC backend over HTTP2. Especially when using microservices that have to communicate with each other, gRPC is very useful. gRPC allows the backend microservices to communicate and interact with each other as if they were using a local object to call functions from. Together with protocol buffers, payload size is also drastically compressed. On the downside, gRPC does not work well with frontend applications directly, so the requests from the frontend had to be routed through an ESPv2 proxy, in combination with Cloud Endpoints.</p><blockquote>It’s a constant tradeoff between ‘good-enough-for-now’ and ‘future-proof’</blockquote><p>Unfortunately, the fairytale has to end somewhere: we did not have unlimited time and resources to build this amazing platform🥲. Like in all software projects, we had to make choices about where to focus our time and energy on and which features could be delayed. Building such a platform from scratch is tricky because it’s a constant tradeoff between ‘good-enough-for-now’ and ‘future-proof’. Luckily for you, I’ll share our tips, tricks and struggles here, so you don’t have to find out the hard way 😉.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w5anxi9pPrMgpgLN" /><figcaption>Containers eeeeeverywhere. Photo by <a href="https://unsplash.com/@osgcontainers?utm_source=medium&amp;utm_medium=referral">OSG Containers</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Platform thinking</h3><p>So, you want to design a platform that is future proof. How do you go about this?</p><blockquote>Make sure that the technical debt you’re creating is as replaceable as possible.</blockquote><ol><li>Think ahead<br>It’s impossible to know everything you want in the future. There are multiple <em>known unknowns</em>. You inherently build in some technical debt from the start. This does not mean that you can just start building and see where you end up! You have to have an idea of what you’re designing for. Together with our UX and UI designers, we made a prototype of ‘the dream’ first. ‘The dream’ was a prototype of the complete platform, validated by potential end-users. With ‘the dream’ in mind, we had an idea of what we should work towards and how functionalities should work in the future. After we prototyped ‘the dream’, we could decide on what our MLP (Minimum Lovable Product) was going to look like. With ‘the dream’ done, we could also make architectural and technical decisions that were perhaps not strictly necessary for the MLP but are crucial to long-term success for LoonGift.</li><li>Make the inevitable technical debt replaceable <br>Even with designing with the future in mind, it’s impossible to know everything beforehand. So, with these known unknowns, make sure that the technical debt you’re creating is as replaceable as possible. This means that you might want to replace some functionality, even in another programming language. So, obviously, like most modern applications, adopt a microservice design. Make sure that every microservice is responsible for its data and its own data only. Modifying another services’ data is never allowed. This way, you make sure that you can relatively easily replace a service if needed. Keep your API documentation in one place: define your objects and endpoint definitions once, and make sure that every service ‘knows’ the objects that exist in your landscape. Ideally, choose a way to structure your data that enables multiple programming languages to work with the same object specification. A great way to specify and serialize your objects is Protobuf — and available in many languages. Our services were mostly written in Java, but if we’d decide tomorrow we want to write a service in Python, this should not be a problem. The new Python service can read from our existing data structure proto files.</li><li>Security by design<br>Sometimes, security, user-friendliness, time, and budget might be a little bit of a trade-off, but security should never suffer. Especially if you work with sensitive data, think about the unhappy flows upfront. What realistically can go wrong, will go wrong. There are still enough edge cases you have not thought about yet, I promise. Make sure that the edge cases you can think of are covered. In these cases, with a limited budget and high ambitions, I like to use managed services as much as possible. Managed services on cloud platforms have built-in security. Especially in a project like this where resources are limited, always prefer the managed services for security and ease of use. For example, on Google Cloud Platform, you can use containers with Kubernetes (obviously). Its managed sibling is called Cloud Run, and it takes care of a lot of the things you don’t want to worry about. For example, it’s super simple to close off your Cloud Run instance and not allow unauthenticated invocations (and it’s super scalable out of the box!). Firebase Authentication is a great way to handle logins without having to store the passwords yourself.</li><li>Prepare for ‘smart data things’<br>Machine learning is hot right now (obviously). And even if you don’t have a specific use case in your mind right now, prepare for the future! Make data flow freely throughout your microservice architecture. Have every service produce data, and have another service pick the data up. Every service that has subscribed to the data from the producing service (and, of course, is allowed to see the data) can do whatever they want with it. This is a perfect architecture to combine data from different sources to potentially perform machine learning or large scale data analysis on! My colleague Hayo wrote an excellent blog about this, you can find his article <a href="https://medium.com/incentro/there-is-no-data-8ce119f816bc">here</a>.</li></ol><h3>The takeaways.</h3><p>Most of the things I told you in this blog we found out the hard way. We were so excited to design a new platform from scratch that we wanted to use the newest technologies. With the newest, I mean really the newest — several products and managed services that we used were still in beta. For example; we deployed our microservices on Cloud Run in combination with gRPC, Cloud Endpoints and an ESPv2 proxy, which was still in beta at the time we started on the platform. It worked well until… it didn’t. Running into issues with timeouts and CORS is never fun, but especially not when you have strict deadlines to work with. I shouldn’t need to tell you that using stuff that’s in beta can cause some troubles in production environments, especially if resources are limited. We pulled it off, but for the sake of your sanity, I would advise against it 😄 .</p><p>Also, try to challenge the stakeholders. We wrote the gRPC microservices in Java because that’s what our customer wanted. However, in hindsight, Python might have been better. Especially if you work with decoupled microservices, and really <em>micro</em> microservices, think about the start time of your containers. Cloud Run scales down to zero, and if the microservices communicate in some way or another, think about the impact your design and programming language has on the start time of your container. Java is a language that is notoriously slow to start up, so slow we had to deal with timeouts from the ESPv2 proxy. Of course, there are ways to circumvent this, but the question remains if it hadn’t been easier if we had just written everything in Python from the start.</p><p>Pages turned and lessons learned, the result is really something to be proud of. A scalable, cloud-native, future-proof platform with no infrastructural maintenance (thank you, managed services! 🙏). Go check it out on <a href="https://platform.loongift.nl/">platform.loongift.nl</a> and if you’re in the Netherlands, check out if your employer can join too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27b4c68e1d72" width="1" height="1" alt=""><hr><p><a href="https://medium.com/incentro/platform-thinking-dos-and-don-ts-when-designing-a-cloud-native-platform-from-scratch-27b4c68e1d72">Platform thinking: do’s and don’ts when designing a cloud-native platform from scratch</a> was originally published in <a href="https://medium.com/incentro">incentro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rethinking retargeting with machine learning: a technical quest]]></title>
            <link>https://medium.com/incentro/rethinking-retargeting-with-machine-learning-a-technical-quest-bd7ee956da6?source=rss-631799ed816------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd7ee956da6</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[recurrent-neural-network]]></category>
            <category><![CDATA[retargeting]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Floor Eigenhuis]]></dc:creator>
            <pubDate>Fri, 20 Sep 2019 07:28:46 GMT</pubDate>
            <atom:updated>2019-09-20T07:28:46.074Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGzNf_LvR3XSQA93djN2lw.jpeg" /><figcaption>Now, who wouldn’t want to be retargeted for a vacation like this? Photo by <a href="https://unsplash.com/@fezbot2000?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Fezbot2000</a> on <a href="https://unsplash.com/search/photos/beach?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><p>Retargeting. The practice of persuading potential customers to come back to a website after they have failed to convert on your website. Everyone who shops online has been subject to retargeting at one point or another; you just go about your business, and suddenly you see banners of a product you just looked at <em>everywhere</em>. So far, retargeting works. The problem is that often you did not intend to buy that product, or that you have, in the meantime, already purchased a similar product. This does not only make retargeting annoying for you, but it also means the company you’re targeted by wasted marketing spend on you.</p><p>There has to be a smarter way to tackle this problem, we thought at Incentro. And there is. In this blog, I will take you on our quest to build a custom machine learning model to help a Dutch start-up to retarget customers smarter. If you’re not technical, don’t be scared! I’ll keep you interested, but it does help if you have at least some basic machine learning knowledge.</p><p><em>tl;dr: machine learning-powered retargeting caused conversions to rise by </em><strong><em>100%</em></strong><em>!</em></p><h3>first things first: the case.</h3><p>This was a real problem for a real customer of Incentro: <a href="https://www.vakanties.nl/">vakanties.nl</a>. Vakanties.nl is a Dutch start-up that sells dynamically composed package vacations tailored to a customer’s needs. They were struggling with how to spend their marketing budget exactly; they wanted to make sure to retarget customers with the highest likelihood of converting. Their strategy up until that moment was to retarget customers that had clicked on certain buttons on the website. Even though human intuition says that clicking on a button probably means you are more interested in the product, this is not a given. There might be other things that are way more indicative of a person’s willingness to buy, for example, the time someone has spent on a page or the time of day. The problem is that these patterns are hard for humans to find because humans are not good at analyzing millions of website log lines to find causal relationships. Enter the wonderful world of <em>machine learning</em> 🌞</p><p>It was our task to, for every person that visited the website and did not end up buying a vacation, estimate the probability that the customer would buy a vacation if (s)he would come back to the website. This is not a trivial task (or I would not be writing a blog about this right now). How did we do this? It all boils down to taking all the steps a website visitor has taken on the vakanties.nl website into account. I will explain to you precisely what we did, but first a little intermezzo about recurrent neural networks.</p><h3>intermezzo: recurrent neural nets</h3><p>If you’re not a machine learning engineer, chances are you have never heard of recurrent neural networks (RNNs). Recurrent neural networks are not your typical vanilla, plain neural network. To illustrate this, take the following picture depicting a ‘regular’ deep neural network. If you have any experience with machine learning, this image will probably look familiar to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ij-L25INBTPbTawq" /><figcaption>A regular neural network. <a href="https://en.wikipedia.org/wiki/Artificial_neural_network#/media/File:Artificial_neural_network.svg">Image source</a></figcaption></figure><p>What the image depicts is a neural network with three input nodes, one hidden layer with four nodes, and one output layer with two nodes. This means that we have some input, and input goes to hidden nodes which will apply some weights to the input, which will, in turn, go on to the output nodes. Information that you feed into the model will <em>never</em> touch the same node twice. If we try to solve the vakanties.nl case with a neural network like this, we run into a problem.</p><p>Let’s start with the output layer. There are two nodes, representing the probability that a website visitor does not convert and the probability the website visitor does convert. These probabilities, of course, add up to 1 as there is no alternative option in this world of website conversions. So far, so good. However, what is our input? The number of clicks? The total amount of time spent on the website? All valid features of a machine learning model, but one thing a regular neural network can’t do is capture a notion of time. For example, there is no straightforward way to feed into this example neural network that a website visitor has first filtered the search results on vakanties.nl on dates, then on country, and then filtered on specific hotels. But this might be valuable information that you do want the neural network to know about. One other way we could try is feeding each step of a website visitors journey into the model, but a regular neural network has no way to represent these separate pieces of information as one customer journey.</p><p>Luckily for us, in the ’80s, some brilliant people figured out a solution to this problem in the form of <em>recurrent neural networks</em>.</p><p>What makes recurrent neural networks so unique? Like I explained to you above, regular neural nets have no notion of time and cannot represent data that involves sequences. Information goes through the model without touching a node twice.</p><p>With recurrent neural networks, the nodes have regular inputs just like the neural network depicted above, but the nodes have a second input, which is a representation of everything they have seen before in the same sequence. Let’s illustrate this by another image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W5FEgGp33LvNXjLU" /><figcaption>Visualization of a recurrent neural network. <a href="https://en.wikipedia.org/wiki/Recurrent_neural_network#/media/File:Recurrent_neural_network_unfold.svg">Image source</a></figcaption></figure><p>Here, <em>x</em> represents an input node, the blue block denoted by <em>h</em> is a hidden node, and the red circle denoted by <em>o</em> is an output node. As you can see, instead of the information passing straight from input-hidden nodes-output, the hidden layer feeds information of everything it has seen so far back to itself. This means the RNN can take into account the entire history of the customer journey when making a prediction!👏👏👏👏👏</p><p>(note: there are many different ‘flavors’ of RNNs. As much as I would love to tell you all about them, this is probably not the time and place 😢. If you would like to learn more, <a href="https://colah.github.io/posts/2015-08-Understanding-LSTMs/">this</a> is an excellent place to start!)</p><h3>let the programming begin.</h3><p>So, now that we had figured out that recurrent neural networks were probably the way to go, the easiest part of our job was done (deciding what we had to do). Now, we actually had to do it.</p><p>This is a strange case in the sense that we really didn’t have any data on the type of customers that should be retargeted: customers that were on the website and left, but then came back and converted. So, we decided to go about this a little differently. In the end, the last step of a customer (let’s call this customer A) that we might want to retarget is always <em>leaving the website before converting</em> (because if they <em>had</em> converted, we wouldn’t have to retarget them). The last step of a visitor that <em>has</em> converted (let’s call this customer B) is always the conversion. We don’t include this final step of customer B in the training of the model, because if we want to predict the probability of conversion of customer A, the journey of customer A never includes the last step of customer B (the conversion step).</p><p>The underlying assumption we do is as follows: <em>if customer X and Y leave the website, and customer X had a higher probability of converting in the moment right before leaving the website than customer Y then customer X still has a higher probability of converting after leaving the website</em>.</p><h4>input features and model architecture.</h4><p>It seems logical that there is probably a positive correlation between the number of clicks a customer has made on the website and whether a customer converts or not. To make sure the model does not blindly predict customers with longer sessions to convert based only on the journey length, we reproduce the journeys of customers that have converted four times. So, if a customer that converts has made forty clicks, the model might see the same journey during training four times: one time with only ten click, one time with the first twenty clicks, one time with the first thirty clicks and one time with all the clicks (all with the label ‘converted’ attached to it). This also came in handy because we had many more customer journeys of customers that had not converted than had converted. Using this technique, we solved some of the imbalance between the occurrence of labels converted/does not convert.</p><p>So, what we did: feeding lots of customer journeys of customers that <em>did</em> convert and <em>did not</em> convert to the model, and try to let the model predict whether or not whether a given customer will convert <strong>at any given point in the customer journey.</strong></p><p>We had two types of features; features that were specific to one step in the customer journey (such as the button the customer clicked on, the time of the click) and context features that were applicable to the entire customer journey (for example device type the customer uses and through which channel the customer entered website). The problem with RNNs is that they are less proficient in representing those context features, so we decided on going with the best of both worlds: a hybrid RNN and DNN model 😎 See our model architecture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*CiLts2ElbmdPVg3t" /><figcaption>Our model architecture.</figcaption></figure><h4>building the model.</h4><p>When we were developing the model (early 2019), there were no out-of-the-box models that were suitable for this use case, so we decided upon building a custom model in TensorFlow 1.14 (in Python), using the tf.estimator.estimator class. This was easier said than done, and we have spent many, many days staring at our computer screens in utter desperation. Lesson learned: it will save you a lot of time and frustration if you do find an out-of-the-box machine learning model that is suitable for your use case.</p><p>I’m going to show you a little bit of code now (DON’T BE SCARED) to show you how (relatively) simple the basic building blocks of the model are. The following code snippet denotes our model, consisting out of a single GRU layer (a particular type of RNN cell) with a DNN layer:</p><pre>def rnn1_model(features, mode):<br>    cell = tf.nn.rnn_cell.GRUCell(RNN1_SIZE)<br>    outputs, state = tf.nn.dynamic_rnn(cell, tf.stack(seq_features, axis=2), dtype=tf.float32)</pre><pre>if len(ctx_features) == 0:<br>        x_dnn = state<br>    else:<br>        listed = [state, tf.stack(ctx_features, axis=1)]<br>        x_dnn = tf.concat(values=listed, axis=1)<br>    probabilities = tf.layers.dense(x_dnn, 1, activation=tf.sigmoid)</pre><pre>return probabilities</pre><p>Looks simple enough, right? Well, it is, but constructing the model architecture is just a small part of making a machine learning model successful.</p><h4>the model learns!!! or does it?</h4><p>After all those days in desperation about why our model would not work, imagine our joy when the model finally started training. However, just the fact that a model trains does not mean it also learns. See below a graph of the loss of the model during a training round:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*s3Zthcp0fIwkPBrm" /><figcaption>The loss during the first training rounds of our model.</figcaption></figure><p>This is typical of a model that cannot seem to find a connection between the input and the output: there are lots of spikes, and there does not seem to be any consistent downward trend in the loss. In other words: the model did not converge. We did solve this problem (🎉), but it took multiple changes to the model:</p><ul><li>we did not have the right set of hyperparameters for the RNN. We discarded the DNN temporarily and first did hyperparameter tuning for the RNN. After that, we added the DNN back to the model</li><li>we increased the batch size: we did this because we assumed that the gradient of the loss function was so spiky due to the relatively low amount of ‘converged’ labels. Boosting the batch size to a value of 2048 or 4096 started the converging behavior.</li><li>we had to be patient. One single epoch was not enough to escape the vanishing gradients. Instead, we had to run training for multiple epochs.</li></ul><p>This all caused the model to converge, and we FINALLY had a model that was ready to work!</p><h4>total architecture</h4><p>As said before, the actual model is just a part of the whole application. I know I skipped over a lot of the details, but I still wanted to give you a high-level overview of the application. Below is a diagram of the entire architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8bBSihuYz1cdyAfQ" /><figcaption>Our application architecture. Note: Cloud ML Engine has now been renamed to AI Platform.</figcaption></figure><p>So, the entire architecture is as follows: when a customer visits the website of vakanties.nl, the events are, with the help of cloud pub/sub and dataflow, sent to BigQuery. Then, again through Dataflow, we took the data out of BigQuery and converted the data into a format that was used as input for the machine learning model (TF-records), and it was stored in Cloud Storage. The model then reads the data from Cloud Storage to train, and the trained model is exported back to Cloud Storage from where the model is exported to Cloud ML Engine (now renamed to AI Platform). Every time a customer leaves the website is then sent to the deployed model, and the model outputs the likelihood that the customer will convert!</p><h3>results</h3><p>While I could write down the theoretical results here, we also have real-world results since the model has been live for a while now. Some facts and figures:</p><ul><li>the number of conversions rose by <strong>100%</strong> by this machine learning-powered retargeting 😎</li><li>costs per transaction dropped with 50–100% compared to a situation without the machine learning model and using smart remarketing lists</li><li>acquisition costs decreased by 50%</li></ul><p>Pretty cool right? Many machine learning blogs out there concern toy examples, this is a relatively rare example of a custom machine learning model that’s not only used in production but has had a significant impact on the day-to-day operations. Keep in mind, this time it was for a website that sells vacations, but the same algorithm can be applied to any website that sells anything. Shoes, skateboards, books: you name it. The model just needs to be retrained.</p><p>Well, that’s all for today! I hope you found this interesting and if you have any questions, you know where to find me. 🙋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd7ee956da6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/incentro/rethinking-retargeting-with-machine-learning-a-technical-quest-bd7ee956da6">Rethinking retargeting with machine learning: a technical quest</a> was originally published in <a href="https://medium.com/incentro">incentro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Life’s not fair. Is machine learning making it worse?]]></title>
            <link>https://medium.com/incentro/lifes-not-fair-is-machine-learning-making-it-worse-cf3880a5abc1?source=rss-631799ed816------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf3880a5abc1</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[fairness]]></category>
            <dc:creator><![CDATA[Floor Eigenhuis]]></dc:creator>
            <pubDate>Fri, 03 May 2019 10:03:16 GMT</pubDate>
            <atom:updated>2019-05-03T11:20:43.852Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0fnEojuWe0gYMapylnpJA.jpeg" /><figcaption>Are machine learning models treating everyone equally? Photo by <a href="https://unsplash.com/photos/1xF8e3hicMU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joel &amp; Jasmin Førestbird</a> on <a href="https://unsplash.com/search/photos/lady-justice?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Machine learning. It’s the buzzphrase at every tech meetup and the term that sounds like magic to many people. Machines that learn, awesome! Machines that learn from objective data are fairer and faster in their decision making, and might see connections that humans fail to see. They are better at taking in much more information at a time, and most of all, they are not plagued by the many fallacies that humans experience in decision making, right?</p><p>You probably know where I’m going with this, and you probably know that the last question was a rhetoric one. Machine learning algorithms can very well be plagued by the same biases humans suffer from. The difference is, though, that a <a href="https://en.wikipedia.org/wiki/List_of_cognitive_biases">biases in human decision making</a> are well-known among everyone who’s ever taken a psychology 101 class. On the other hand, machine learning algorithms are hyped for their good performance and biases that can occur in them have been undiscovered or ignored for a long time. It has not been until fairly recently that the fairness in machine learning algorithms has been critically assessed.</p><p>“Why should I care, though? I don’t make machine learning models.”, you might think. You see, that’s a valid question. However, think about your daily routine. First, you wake up by your alarm clock. You might use an alarm clock app on your phone that analyses <a href="https://www.sleepcycle.com/">your sleep</a> to decide the right time to wake you up. You then look at your phone, which automatically unlocks because it knows your face or your fingerprint. You decide to, before you actually get out of bed, check your social media. Uncoincidentally, you immediately see when one of your best friends posted something, because their changes always show up first in your feed. You decide to get dressed and have breakfast, and turn on your “Discover Weekly” playlist on spotify, which is tailored to your taste in music. Before you leave for work, you check the traffic on your route in Google Maps and decide to wait for another 20 minutes before leaving for work in the hopes of not spending much time in traffic. I hope you all know this, but this is all powered by machine learning. You might not build the models, but you definitely use them.</p><p>Machine learning impacts every one of us daily in ways we don’t even think about. And as we move into an age where machine learning models will decide whether we <a href="https://www.forbes.com/sites/bernardmarr/2018/12/14/the-amazing-ways-how-unilever-uses-artificial-intelligence-to-recruit-train-thousands-of-employees/#675b1bf06274">get a job</a>, <a href="https://www.americanbanker.com/news/where-bank-of-america-uses-artificial-intelligence-and-where-its-worries-lie">get a loan</a>, or <a href="https://en.wikipedia.org/wiki/COMPAS_(software)">get out of prison</a>, machine learning concerns all of us and everyone should be able to critically assess the decisions made by a machine learning algorithm. Machine learning is everywhere. Pedro Domingos sums it up nicely in his book <em>The Master Algorithm</em>, saying: <em>“People worry that computers will get too smart and take over the world, but the real problem is that they’re too stupid and they’ve already taken over the world.”</em></p><p>So, this blog is about fairness in machine learning. However, what <em>is</em> fairness when it comes to machine learning?</p><p>There is not a simple answer to this question. There have been several suggestions to what it means for a machine learning algorithm to be fair. For example, COMPAS, a machine learning algorithm which calculates the recidivism risk score for prisoners, which plays a part in the decision whether to let prisoners out on parole or not. COMPAS was heavily criticised for not being fair because ProPublica found out that among all defendants who were released on parole and did not reoffend, <a href="https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing">blacks were far more likely than whites to receive a high risk score</a>. However, when confronted with the criticism, the company that made the COMPAS system, Northpointe, pointed out that their system <em>is</em> fair. The scores produced by COMPAS mean the same regardless of race (e.g. <a href="https://www.washingtonpost.com/news/monkey-cage/wp/2016/10/17/can-an-algorithm-be-racist-our-analysis-is-more-cautious-than-propublicas/?utm_term=.9331b76061f5">a risk score of 7 means that a defendant has a risk of 60% to reoffend</a>, regardless of race). .</p><p>This sounds contradictory. Can a machine learning algorithm produce outcomes that are both fair and unfair? Several researchers <a href="https://www.washingtonpost.com/news/monkey-cage/wp/2016/10/17/can-an-algorithm-be-racist-our-analysis-is-more-cautious-than-propublicas/?utm_term=.9331b76061f5">argued in the Washington Post</a> that it’s not only possible, it’s actually inevitable given the fairness criteria above. It’s mathematically impossible for any algorithm to satisfy both fairness criteria at the same time. This begs the question, what definition of fairness should we focus on?</p><p>A<a href="https://arxiv.org/pdf/1902.04783.pdf"> study by researchers from Stanford and ETH Zurich</a> tried to answer the question what the most appropriate definition is in the context of our society. They did this by testing ‘lay people’ and finding out what they see as the most appropriate definition of fairness. Their conclusion was that when people were presented with several fairness criteria, people tend to go with the most mathematically simplistic one, even when presented with more sophisticated and complicated alternatives<em>.</em> This means that what people who don’t work with algorithms every day view demographic parity- that the percentage of correct predictions is the same among every group. In the example of COMPAS above, this would mean that the definition of fairness from Northpointe actually holds. However, I guess everyone can see that the criticism from ProPublica is also justified.</p><p>I could go on and on about this discussion, but regardless of what definition we choose, it’s a fact that many machine learning models are not fair in ways that everyone can agree are wrong. <a href="http://proceedings.mlr.press/v81/buolamwini18a/buolamwini18a.pdf">From facial recognition that works almost perfectly on the faces of white men with an error rate of only 0.8% but has an error rate of up to 34.7% on the faces of black women,</a> to text embedding models that associate <a href="https://developers.googleblog.com/2018/04/text-embedding-models-contain-bias.html">Afro-American names with ‘unpleasant’ and Euro-American names with ‘pleasant’</a>, machine learning models start to hurt and discriminate against real people in real ways, and we need to be aware of it.</p><p>Luckily, awareness about unfairness in machine learning starts to grow. Through interviews and surveys,<a href="https://arxiv.org/pdf/1812.05239.pdf"> Microsoft researchers</a> set to find out what the industry actually needs to not only be aware of unfairness, but also to proactively take responsibility for the results their model produces. It turns out that the industry is lacking concrete, domain-specific guidelines on <em>how</em> to check their models for fairness. One interviewee said that they actually don’t systematically check their models for fairness: <em>“You’ll just have to put your model out there, and then you’ll know if there’s fairness issues if someone raises hell online.” </em>That this approach is problematic goes without saying. Companies, especially large ones, need to formulate their own fairness criteria <em>before</em> they start programming.</p><p>Next to these specific instructions, there are some things that IT companies can start to take into account <em>now</em>. As Joy Buolamwini explains <a href="https://www.ted.com/talks/joy_buolamwini_how_i_m_fighting_bias_in_algorithms#t-416086">in her TED talk</a>, there are three general things to think about when we want to make software and machine learning models that perform equally well for <em>all</em> people. First of all, <strong>who</strong> codes matters: it’s important to create teams that consist of different individuals. That way, blind spots held by certain individuals are more likely to be noticed by other individuals. Secondly, <strong>how</strong> we code matters: think about fairness every step of the way. As the Dutch expression says: to prevent is better than to cure. Lastly, <strong>why</strong> we code matters. Is the model that you’re trying to make going to make the world worse? Can it be used to worsen inequality in the world?</p><p>It’s time to start shifting our focus from <em>can </em>we do this to <em>should </em>we do this. I hope this blog has, for some of you, created awareness about what it means for a machine learning model to be fair. I like to be realistic and I know that not every every machine learning model is going to make the world a better place to live in. My goal is only to not make machine learning models that will make the world a <em>worse</em> place to live in. That’s not too much to ask, right?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf3880a5abc1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/incentro/lifes-not-fair-is-machine-learning-making-it-worse-cf3880a5abc1">Life’s not fair. Is machine learning making it worse?</a> was originally published in <a href="https://medium.com/incentro">incentro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>