<?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 Paul Désigaud on Medium]]></title>
        <description><![CDATA[Stories by Paul Désigaud on Medium]]></description>
        <link>https://medium.com/@pauldes?source=rss-eb83abdee88------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Paul Désigaud on Medium</title>
            <link>https://medium.com/@pauldes?source=rss-eb83abdee88------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:03:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pauldes/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[Conquering Position Bias]]></title>
            <link>https://medium.com/manomano-tech/conquering-position-bias-d64880104fd4?source=rss-eb83abdee88------2</link>
            <guid isPermaLink="false">https://medium.com/p/d64880104fd4</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[bias]]></category>
            <dc:creator><![CDATA[Paul Désigaud]]></dc:creator>
            <pubDate>Mon, 21 Oct 2024 14:36:59 GMT</pubDate>
            <atom:updated>2024-10-28T14:33:27.103Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why this phenomenon makes your machine learning systems under-perform and how you can handle it.</h4><p>Sunday night at home — you’re scrolling through Netflix’s new programs. A cool thumbnail titled <em>Wednesday</em> catches your eyes at the second position. You like magic movies, so you click it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qczDp1jHrZzD5zNFyHyeCg.png" /><figcaption>Screenshot from Netflix.com</figcaption></figure><p>Bad idea : have you scrolled a bit further to the right, you would have seen a much more appealing thumbnail at the sixth position : <em>Viking Wolf</em> !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*crSTd7rl6doQnm9TUBvalA.png" /><figcaption>Screenshot from Netflix.com</figcaption></figure><p>But since you stopped before, you sent Netflix an implicit signal that <em>Wednesday</em> was a good recommendation (and maybe that <em>Viking Wolf </em>was not, depending on how their system is designed).</p><p>This is a classic example of position bias at play. Our tendency to engage with items presented at the top rather than explore further can lead us to miss out on movies, products, or content that were better for us.</p><h3>Position bias is everywhere</h3><p>On an e-commerce website like <a href="https://www.manomano.fr/">ManoMano.fr</a>, the position biases are <strong>everywhere</strong>. On a product search page, we can easily spot a number of them: horizontal listing (left to right), vertical listing (top to bottom), scroll-able sponsored brand widget, brand filters, delivery type filter, page navigation…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9I9lhwSVoggf322H2Y78Gw.png" /><figcaption>Product search page for a drill <a href="https://www.manomano.fr/perceuse-1146">(source</a>).</figcaption></figure><h3>How big of a deal is it ?</h3><p>On the Google Search page, the top-ranked result is clicked almost <strong>twice</strong> as much as the second one. The second one is in turn clicked twice as much as the fourth one. Try it yourself : does the top-ranked result looks twice more relevant than the second one ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKM4ftZrq_yMdZLM3E1uJg.png" /><figcaption>Google CTR per ranking (<a href="https://www.sistrix.com/blog/why-almost-everything-you-knew-about-google-ctr-is-no-longer-valid/#285-of-Google-users-click-the-first-organic-result">source</a>).</figcaption></figure><p>All the more worrying : in a mobile app store, researchers <a href="https://github.com/tangxyw/RecSysPapers/blob/main/Debias/%5B2019%5D%5BHuawei%5D%5BPAL%5D%20a%20position-bias%20aware%20learning%20framework%20for%20CTR%20prediction%20in%20live%20recommender%20systems.pdf">demonstrated</a> that <strong>the</strong> <strong>same application</strong> will be clicked 30% less if ranked 2nd instead of 1st, 75% less if ranked 4th.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgeFuErpvPiBPTxCrtKPYg.png" /><figcaption>Left : Average CTR per ranking ; right : CTR per ranking of a same item (<a href="https://github.com/tangxyw/RecSysPapers/blob/main/Debias/%5B2019%5D%5BHuawei%5D%5BPAL%5D%20a%20position-bias%20aware%20learning%20framework%20for%20CTR%20prediction%20in%20live%20recommender%20systems.pdf">source</a>).</figcaption></figure><h3>The issue with position bias</h3><p>Generally, an ML-based ranking system will use past interactions to sort items. For instance, at ManoMano, the number of clicks on a product during the previous month used to be a strong feature of a model ranking the products on a listing.</p><p>Since users click on the first items, the ones that are equally (or more) relevant but are shown in further positions receive lower engagement and won’t improve their rank, perpetuating a self-reinforcing cycle. Good products entering the catalog never get the chance to reach the first positions (the famous <a href="https://en.wikipedia.org/wiki/Cold_start_(recommender_systems)">cold-start problem</a>). Along with this self-reinforcing feedback loop, a <a href="https://developers.google.com/machine-learning/guides/rules-of-ml#rule_36_avoid_feedback_loops_with_positional_features">malpractice in machine learning</a>, comes a sub-optimal ranking and an opportunity cost in engagement (or revenue in the e-commerce case).</p><p>However, the case is not lost : a number of methods can be used to try and reduce the position bias in ranking systems. Here are 3 of them.</p><h3>3 ways of mitigating position bias</h3><h4>#1 Shuffling items</h4><p>A very intuitive approach is to introduce randomness in the positions. The more randomness we introduce, the more we reduce position bias, but the more we impact user experience and ignore our relevance predictions — much like an <a href="https://en.wikipedia.org/wiki/Exploration-exploitation_dilemma">exploration-exploitation dilemna</a>. Here is a selection of shuffling-based methods :</p><ul><li><a href="https://dl.acm.org/doi/pdf/10.1145/2911451.2911537"><strong>RandTopN</strong></a><strong> </strong>randomly shuffles the top N items uniformly — effectively removing all position biases. Although good for collecting initial engagement data, it prevents us from actually using our relevance estimates.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sRq26X8AM8TLyraUCrj1_Q.png" /><figcaption>An example of RandTopN with N=3.</figcaption></figure><ul><li><a href="https://arxiv.org/pdf/1608.04468.pdf"><strong>RandPair</strong></a><strong> </strong>switches N random pairs of products, limiting the adversarial impact to 2N items. Depending on N, a lot of traffic might be needed to cover enough cases.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsuZChUqidD2wRHqxJ4H0Q.png" /><figcaption>An example of RandPair : pairs 1/3 and 2/4 get switched.</figcaption></figure><ul><li><a href="https://arxiv.org/pdf/cs/0605037.pdf"><strong>FairPair</strong></a><strong> </strong>switches consecutive pairs of products, keeping the overall ranking consistent with our relevance predictions. The de-biasing can be pretty limited depending on the UI though.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSkpm00zVWl_qqqEXO0viQ.png" /><figcaption>An example of FairPair : pairs 1/2 and 3/4 get switched.</figcaption></figure><ul><li><a href="https://www.researchgate.net/publication/306075233_A_Survey_of_Serendipity_in_Recommender_Systems"><strong>Position-based Serendipity</strong></a><strong> </strong>consists in multiplying the initial ranks by a factor drawn from a normal distribution whose parameters define the exploration-exploitation tradeoff. Items are then sorted by ascending result.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gDoXqzopoy7qr8EsatIxsQ.png" /><figcaption>An example of position-based serendipity</figcaption></figure><ul><li><a href="https://www.researchgate.net/publication/306075233_A_Survey_of_Serendipity_in_Recommender_Systems"><strong>Score-based Serendipity</strong></a><strong> </strong>consists in multiplying the initial ranking score (for example, the predicted CTR) by a factor drawn from a normal distribution. That way, consecutive products with a bigger gap in relevance stay in their initial order on average, while products with similar relevance score are switched more often. Caution: the score must be correlated with the relevance, which is not always the case with Learning-To-Rank models like <a href="https://www.microsoft.com/en-us/research/uploads/prod/2016/02/MSR-TR-2010-82.pdf">LambdaRank</a>.</li><li><a href="https://arxiv.org/pdf/1705.10257.pdf"><strong>Boltzman Exploration</strong></a><strong> </strong>translates ranking scores into a probability to get ranked at the Nth place by dividing each one by the sum of the scores of all items not yet drawn.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42u1nlx7UfJIteONW_sh4A.png" /><figcaption>Example of Boltzman exploration. Items 3 and 4 have close scores and get switched.</figcaption></figure><h4>#2 Exploiting inherent randomness</h4><p>Sometimes, the same item will naturally appear at different positions. Without intrusive interventions, one can collect past data about whether users interacted presented with the item depending on the position it was displayed at. This data can be used to estimate the position bias and eventually counter it (although <a href="https://arxiv.org/pdf/1812.05161">not as trivial as it sounds</a>).</p><p>Typically, in an e-commerce search engine, a product might appear at various positions depending on the date :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RTNU75pXT6OXSXg3Wa2HA.png" /><figcaption>The same product appears at the 3rd and 2nd position depending on the date.</figcaption></figure><p>The issue is that a change of position correlates with a change of context : if the date changes, the users change and might have a different behavior (a conversion rate typically varies along the week). The cause for the change could also be that a preceding product, which was way more relevant, gets out of stock. The difference in interaction does not result from the position only.</p><p>In the following example, the same product is recommended in 3 different playlists, at various positions, but on the same product page, at the same date and to the same user : the context is similar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9MDcr6pd9rOdnuWq4L9otw.png" /><figcaption>The black nails get recommended at the 5th, 1st and 4th positions on the same page.</figcaption></figure><p>However, even with the same context, some biases are present : these 3 playlists are distributed vertically on the web page — automatically subjecting them to yet another position bias which must be accounted for and countered.</p><h4>#3 Bias-aware modelling frameworks</h4><p>If we are unable to remove the position bias from the observed behavioral data we are trying to model, why not model the bias ?</p><p>A common and intuitive approach is to use the <a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2017/04/main-1.pdf"><strong>position as a feature</strong></a> : for training the predictive model, incorporate the position at which the product was displayed into an ordinal feature. Then, when making predictions, set this feature to a constant. That way, all items are processed on equal terms — particularly helpful when the model is used to rank them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0kMJEZCiaEarKbNNgY3dMw.png" /><figcaption>Position as a feature, with the position set to a constant 1 during inference.</figcaption></figure><p>However, empirically, it appears the <a href="https://github.com/tangxyw/RecSysPapers/blob/main/Debias/%5B2019%5D%5BHuawei%5D%5BPAL%5D%20a%20position-bias%20aware%20learning%20framework%20for%20CTR%20prediction%20in%20live%20recommender%20systems.pdf">model output will vary greatly depending on the chosen constant</a>, making the ranking unstable if not irrelevant past the first position — something we also observed at ManoMano. And making the constant vary to find the optimal item at each position is <a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2017/04/main-1.pdf">computationally too expensive</a>.</p><p>As a result, a new approach was developed : <strong>position bias as a module</strong> (named <a href="https://github.com/tangxyw/RecSysPapers/blob/main/Debias/%5B2019%5D%5BHuawei%5D%5BPAL%5D%20a%20position-bias%20aware%20learning%20framework%20for%20CTR%20prediction%20in%20live%20recommender%20systems.pdf">PAL : Position-bias Aware Learning framework</a>). In PAL, the observed interaction (a click on the item) is considered as a product of two components, hence the nickname two-tower model:</p><ol><li>The probability for the item to be seen given its position ;</li><li>The probability for the item to be clicked given it is seen.</li></ol><pre>p(click|features, position) = p(seen | position) * p(click|features, seen)</pre><p>These two modules are optimized jointly and simultaneously on the training data. Then, in an online setting, predictions are made using solely the model predicting the probability for the item to be clicked given it is seen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hkg8BJF4FxoZEeD5NimfZQ.png" /><figcaption>Position bias as a module in PAL.</figcaption></figure><p>This approach has been found to <a href="https://github.com/tangxyw/RecSysPapers/blob/main/Debias/%5B2019%5D%5BHuawei%5D%5BPAL%5D%20a%20position-bias%20aware%20learning%20framework%20for%20CTR%20prediction%20in%20live%20recommender%20systems.pdf">outperform</a> the position-as-a-feature one and has been the sate-of-the-art for a while.</p><p>A slightly different version, ready to use in production systems, is implemented in the open-source distributed gradient-boosting framework <a href="https://lightgbm.readthedocs.io/en/latest/Advanced-Topics.html#support-for-position-bias-treatment">LightGBM</a> and ready to use in production systems. LightGBM uses an idea of Generalized Additive Models (GAM) to linearly decompose the item score <em>s </em>into the sum of a relevance component <em>f</em> and a positional component <em>g.</em></p><pre>s(features, position) = f(features) + g(position)</pre><h3>Conclusion : on position bias, a sneaky saboteur of ML-based ranking systems.</h3><p>Position bias makes it hard for items to get noticed, just like how the first relevant movie you see on Netflix gets chosen over better options further down the list. To counter this phenomenon, a number of methods can be used :</p><ul><li><strong>Shuffling items</strong>, perhaps the most intuitive one, ideal at the beginning of the lifetime of a ranking system to generate new interactions, or improve a biased model without getting your hands dirty ;</li><li><strong>Exploiting natural variations, </strong>good to reduce the adversarial impact to the minimum but requires quite some work to be made properly ;</li><li>Using a <strong>bias-aware framework, </strong>specifically PAL or LightGBM, a simple yet powerful approach that we successfully incorporated in some of our ranking systems at ManoMano.</li></ul><p>So, next time you’re about to click, take a moment to scroll down. Whether online or in real life, dig a little deeper and explore beyond the first option!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d64880104fd4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/manomano-tech/conquering-position-bias-d64880104fd4">Conquering Position Bias</a> was originally published in <a href="https://medium.com/manomano-tech">ManoMano Tech team</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towards less discrimination in Artificial Intelligence systems]]></title>
            <link>https://medium.com/data-science/towards-less-discrimination-in-artificial-intelligence-systems-78b8a6e162e5?source=rss-eb83abdee88------2</link>
            <guid isPermaLink="false">https://medium.com/p/78b8a6e162e5</guid>
            <category><![CDATA[discrimination]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[fairness-and-bias]]></category>
            <category><![CDATA[bias]]></category>
            <dc:creator><![CDATA[Paul Désigaud]]></dc:creator>
            <pubDate>Fri, 05 Feb 2021 14:04:22 GMT</pubDate>
            <atom:updated>2021-02-09T15:50:47.408Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/tagged/fairness-and-bias">Fairness and Bias</a></h4><h3>Towards Less Discrimination in Artificial Intelligence Systems</h3><p>With the rise of <a href="https://cloud.google.com/automl">auto-ML platforms</a>, it has never been easier to design machine learning systems without prior knowledge of the math behind, but also without awareness of the heavy ethical issues they can raise. However, following recent scandals, experts are starting to work on bringing more fairness in Artificial Intelligence, and you can contribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryeIKqBE1x2Qh53SFMwPaQ.jpeg" /><figcaption>[Collage of captures from <a href="https://news.google.com/">Google News</a> by the author]</figcaption></figure><p>Back in June 2020, a heated debate started on Twitter between two AI specialists: Turing Award Winner and Facebook Chief AI Scientist Yann LeCun, and research scientist, co-founder of the “Black in AI” group, and former technical co-lead of the Ethical Artificial Intelligence Team at Google Timnit Gebru. The root of the debate was this <em>Face-Depixelizer</em> model that generates hi-res pictures of blurred face photos. A tester tweeted the result of the model on a blurred photo of Obama and it looked like the model tended to generate white faces even when the blurred photo was of a Black person.</p><h3></h3><p>🤔🤔🤔 pic.twitter.com/LG2cimkCFm</p><p>LeCun reacted saying that ML systems are biased when data is biased, and that this was due to the model being trained on a data set with a majority of white faces. Gebru on the other hand replied that we cannot just reduce harms caused by ML to data set bias. In her talks at <a href="https://sites.google.com/view/fatecv-tutorial/schedule?authuser=0">FATE/CV</a> earlier that year, she had just insisted that social and structural problems could not be solved by simply diversifying data set. Things escalated pretty quickly, both camps being joined or attacked by thousands of people, from amateurs to high-profile AI researchers, LeCun ending up apologizing while Gebru insisted his reaction was a pattern of marginalization. LeCun even quit Twitter as a consequence of the attacks he received.</p><p>We can learn 2 things from this story :</p><ul><li>The good thing is these fairness issues are being talked about more and more, and we can hear ethics expert sharing their work on the matter ;</li><li>The bad thing is most people disagree on — or have no idea — how to achieve fairness in AI.</li></ul><h4><strong>It is not easy to identify and avoid discriminating bias when building ML/AI systems.</strong></h4><p>Why ? Because biases are often hidden patterns, hence difficult to detect. For example, a model that predicts housing loan allocation may favor males because of the gender pay gap. A model trained on raw historical data to model a human process will inherently reproduce its biases, and the bad news is biases are so deeply rooted into society that even experts do not know what <a href="https://www.nytimes.com/2016/10/07/upshot/were-all-a-little-biased-even-if-we-dont-know-it.html">an unbiased society would look like</a>. But biases can actually appear during any step of a machine learning pipeline, from the data collection to the way in which the results are presented to the user, through labeling data, choosing a performance metric or deploying a model. If you are building your own supervised model, outliers (examples whose characteristics are rare) are often mis-predicted ; and when the data points are people, minorities will be the outliers and will suffer a lack of performance. If you are not building the data set or the model by yourself, either you are working with public datasets or pre-trained neural networks, it is even harder to track the bias inherent to the data you’ll use. Furthermore, there is not a big number of available open-source datasets, for example text or face datasets, hence not a wide diversity.</p><p>Besides, fairness itself is a complex matter, difficult to apprehend for the average data scientist alone who, despite their good will, may not have a good understanding of it. Here is an example of a dilemma that a data scientist may face : should he favor <a href="https://www.researchgate.net/post/Equality-implies-sameness-Equity-implies-fairness-What-is-the-difference-between-Equality-Equity-Please-give-your-opinion">fairness by equity or fairness by equality</a>? Everyone (more or less) knows the law and the principles of impartiality, accessibility and diversity it requires. Yet it is not easy to convert them into KPI and technical specs. Existing <a href="https://arxiv.org/pdf/1610.07524.pdf">equity metrics </a><a href="https://www.liebertpub.com/doi/abs/10.1089/big.2016.0047?journalCode=big">cannot be optimized simultaneously</a>, a trade-off between them must be made to satisfy one or another: there is no optimal strategy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5uA5mizMm5n27OQP.png" /><figcaption>Sometimes, equality is not enough to fix unfairness. [Reproduced from <a href="http://www.rwjf.org/">Robert Wood Johnson Foundation</a>]</figcaption></figure><p>One last note : ethical issues in AI suffer a severe lack of popularity among AI communities. Most data science trainings do not mention at all potential fairness issues generated by ML. More and more <a href="https://www.infoworld.com/article/3430788/automated-machine-learning-or-automl-explained.html">auto-ML</a> tools appear on the market and everyone can train and deploy AI models without knowing what’s going on underneath and what could possibly go wrong.</p><p>This panorama may sound quite pessimistic, yet everyone can already act to limit, if not prevent, discriminating bias in the ML systems they are building at work or at home.</p><h4>Here are a few solutions to start acting.</h4><p>First, people interacting with ML systems, from the data scientists who build them to the user who uses them, must be informed of the risks of hidden discriminating bias. Unbiased systems do not exist, we can only monitor and limit biases we are aware of. Furthermore, knowing a system is biased in some ways, the user can use the algorithm result accordingly.</p><p>To avoid bias, we may tend to exclude protected variables (gender, age, race…) from our datasets at the data collection stage, and never look back. But instead, one may want to keep them, not for modeling but for analyzing both the distribution of the source datasets and the model performances along these variables. <a href="https://www.institutmontaigne.org/ressources/pdfs/publications/algorithmes-controle-des-biais-svp-resume.pdf">The renowned Montaigne Institute calls this<em> active equity</em></a>. By blindly removing protected variables from our datasets, we are ignoring society bias.</p><p>It can be pretty easy to turn an unfair classifier into a fairer one, if you know what metrics to look at. For instance, with threshold-based classifiers (such as logistic regression), one can adapt the threshold based on the population subgroup to favor equity between subgroups. Imagine you work at a bank building a ML system that is used to grant loan. In this scenario, we wish that of the people who can pay back a loan, the same fraction in each subgroup should actually be granted a loan <a href="https://arxiv.org/abs/1610.02413">(a concept called <em>equal opportunity</em></a>). In data science jargon, this translates to an identical<em> true positive rate </em>or <em>recall </em>between subgroups and it is easy to choose a<a href="https://research.google.com/bigpicture/attacking-discrimination-in-ml/"> threshold that will address this constraint</a>. On the contrary, we do not specifically wish all subgroups to receive the same number of loans (a concept called <em>demographic parity</em>); this would have translated to an identical <em>positive rate</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qL4UKCoG4dWYxy2arFBQQ.png" /><figcaption>A visual explanation of how to reach <em>equal opportunity with threshold-based classifiers. [Image by author]</em></figcaption></figure><p>Despite these tools, it would be counter-productive to ask data scientists to become fairness experts and re-define the concept. Some other disciplines have spent decades studying what is fair and what is not, to come up with different definitions of fairness. By putting computer scientists into conversation with ethicists, philosophers, or sociologists, we can build tools that will promote equity. Data scientists could start new ML projects by reading sociology studies identifying the existing bias to expect in the data collected and the process to be modeled.</p><p>To help data scientists to handle these topics, some organizations have started working on “Ethics AI” policies, with equity criteria and practices clearly defined, a dedicated governance and team. The idea is then to apply it on every data project by providing tools and metrics to enforce it. One of the practices should always be to build project teams that represent diversity and include historically unprivileged groups. This is not the easiest solution : for example, as of today <a href="https://www.bcg.com/fr-fr/press/20feb2020-15-percent-women-data-scientists">only 15% of the data scientists are women</a>. This disparity may find its root in a <a href="https://news.usc.edu/164120/teacher-bias-math-skills-girls-students-of-color/">science education bias</a> towards women.</p><p>On a more positive note, ML researchers are starting to acknowledge the importance of ethics in their work. For instance, some researchers have started to work on the widespread data coverage issue in faces dataset (the likely cause of the <em>Face-Depixelizer</em> bias towards skin color). <a href="https://arxiv.org/abs/2004.03355">In this paper</a>, the authors propose a new model known as <em>IMLE-GAN</em> that achieves competitive image quality while ensuring improved coverage of minority groups. These advanced pieces of work are great but should not make you forget the most basic but necessary step towards equity : taking the time to wonder, in every ML project, if there might be a bias that may discriminate a group of people.</p><p><strong>I hope this post gave you some hints about how to start working towards less discrimination in your future AI projects. Feel free to share good ideas you have heard of to fight equity issues !</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78b8a6e162e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/towards-less-discrimination-in-artificial-intelligence-systems-78b8a6e162e5">Towards less discrimination in Artificial Intelligence systems</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>
        <item>
            <title><![CDATA[Double-blind random studies : how to prove properly that a therapy works]]></title>
            <link>https://medium.com/data-science/double-blind-random-studies-how-to-prove-properly-that-a-therapy-works-532ce47b0fd3?source=rss-eb83abdee88------2</link>
            <guid isPermaLink="false">https://medium.com/p/532ce47b0fd3</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[causation]]></category>
            <category><![CDATA[correlation]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[medicine]]></category>
            <dc:creator><![CDATA[Paul Désigaud]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 15:34:37 GMT</pubDate>
            <atom:updated>2024-08-09T12:57:10.011Z</atom:updated>
            <content:encoded><![CDATA[<h4>Since the spread of COVID-19, we have heard all sorts of people debating the validity of some medical studies presenting a drug as a cure. In this post, I will present one of the most trusted scientific methods to demonstrate the impact of an event on another one, e.g. the impact of a therapy on a medical condition.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tpWS9n5itkxfwAfF" /><figcaption>Photo by <a href="https://unsplash.com/@chernus_tr?utm_source=medium&amp;utm_medium=referral">Taras Chernus</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Proving causation with experimental studies</h3><p>The challenge of proving causation, i.e. the impact of an event (or a characteristic) on another one, is a famous challenge for the data scientist. It is easy to get an historical data set, plot data points and find a correlation between two variables. However, correlation does not imply causation :</p><ul><li>It may be impossible to know which variable is the cause of the other one and which one is the consequence ;</li><li>Correlation may be pure coincidence ;</li><li>A third, unknown variable may be the cause of both studied variables.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iBkvpswDawa9Phm6yBpnDQ.png" /><figcaption>Do people fall down the stairs while rushing into Apple stores ? Or does the population growth explain both series ? Maybe it is only pure coincidence ? More fun examples at<em> </em><a href="https://www.tylervigen.com/spurious-correlations"><em>tylervigen.com/spurious-correlations</em></a></figcaption></figure><p>To tackle these issues, researchers design <strong>experimental studies</strong>. As opposed to observational studies that consist in studying historical data, experimental studies consist in setting up creating our own data by repeating an experiment with a controlled variation : only one variable changes between the experiments, and that’s the variable we want to study the influence on a target variable. If the target value changes consistently when the variable changes, then there is causation.</p><h3>Defining the double-blind study</h3><p>Now, let’s say we want to prove the efficiency of a new drug to cure a specific disease. The typical set-up will consists in dividing patients affected with the disease in 2 groups, give the drug to one group only, and compare the number of cured patients in each group. But in order to avoid any bias that may influence the results, we will add extra steps :</p><ul><li>To eliminate response bias, we will give placebos to the patients of the non-treated group and they will obviously be blinded to the treatment allocation ;</li><li>To eliminate statistical bias, we will constitute the groups randomly ;</li><li>To eliminate confirmation and observer biases, the researcher and medical staff will also be blinded to treatment allocation.</li></ul><p>This configuration defines a <strong>double-blind random study</strong>.</p><h3>Experiment results analysis</h3><p>For the sake of simplicity, our 2 groups are considered to be of the same size <strong><em>n</em></strong> but the analysis is very similar with groups of different sizes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IEx8eRvnNrYdjbGCFkpPEw.png" /><figcaption>Observed results of the simplified experiment</figcaption></figure><p>Now we can formulate two hypothesis :</p><ul><li><em>Null hypothesis </em>: the drug has no effect and the cure rate is similar between the 2 groups ;</li><li><em>Alternative hypothesis </em>: the drug is efficient and the cure rate is significantly higher in the group provided with drug.</li></ul><p>Under the null hypothesis, theoretical results would look like that :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60v4EgEZSHJbbODjLyoFVg.png" /><figcaption>Results under the null hypothesis : no differences between the groups.</figcaption></figure><p>We will now perform the <a href="https://en.wikipedia.org/wiki/Chi-squared_test"><strong>chi-squared test</strong></a>. This widely-used test checks for statistical link (dependence) between two variables. Here, our two binary variables are :</p><ol><li>The use of drug (columns of the table)</li><li>The cure of a patient (rows of the table)</li></ol><p>The chi-squared statistics is the sum, for every cell of the table, of the squared differences between observed cell value and cell value under null hypothesis, divided by the value under null hypothesis :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eMCjpjGJ-bZBzGo6Od3afg.png" /><figcaption>chi-squared statistics formula for our simplified case study</figcaption></figure><p>The last thing to do is to compare that value to a reference table to accept or reject the null hypothesis. <em>In our example, we have 1 degree of freedom : the number of values less 1 of one variable times the number of values less 1 of the other one is 1.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UF7DlX5_43zwhoeQFPC6oQ.png" /><figcaption>Table of chi-squared values from <a href="https://en.wikipedia.org/wiki/Chi-square_distribution#Table_of_%CF%872_values_vs_p-values">Wikipedia</a></figcaption></figure><p>Let’s take the following example and compute the chi-square value. At first, we may think the drug is effective :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uhqtHZgvh0TfHFhzGOspg.png" /></figure><p>If we want a confidence of 95% (this is often the case in medicine), since our chi-squared value is 4.8 and 4.8&gt;3.84, we can reject the null hypothesis and consider the drug has an effect compared to the placebo.</p><p><strong>That’s it !</strong> Do not forget to look for the type of effect (positive or negative).</p><p><em>Note : for the chi-square test to be effective, it is recommended to have E≥5 for every cell of our table under null hypothesis.</em></p><h3>Advanced analysis : numerical target variable</h3><p>Sometimes, the target variable is not binary, but a continuous numerical variable : number of days to cure, glucose level, blood pressure… In this case, it is irrelevant to build a result table. We will use a different approach.</p><p>First, we will register the value of the target variable for every patient in each group. Plotting the value distribution for each group is a first clue to evaluate if the drug has an impact on the target variable (here, the number of days for the patient to cure).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cr6Y2rFw9GVoJr_kWrvpug.png" /><figcaption>Should we consider the drug has an effect if our results look like example A ? And example B ?</figcaption></figure><p>A rigorous way to compare the 2 groups would be to compare the expected value of their distributions. However, we do only know the sample mean of the patients we studied. So we are going to estimate the expected value of the two distributions using a property of <a href="https://en.wikipedia.org/wiki/Student%27s_t-distribution">Student’s t-distributions</a> (a prerequisite is obviously to check whether the distributions are normal). This property defines a confidence interval for the expected value of a distribution, based on a sample mean :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*6k3WaguAZdewNYqDMRZERw.png" /><figcaption>Student’s law for expected value confidence interval</figcaption></figure><p>α is the confidence level. <em>n </em>is the sample size (number of patients).<em> t </em>is the Student factor. We can find its value in the reference table :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ILBg3jZUrENhgxqhYGFPg.png" /><figcaption>Table of Student factor values from <a href="https://en.wikipedia.org/wiki/Student&#39;s_t-distribution#Table_of_selected_values">Wikipedia</a></figcaption></figure><p>For example, let’s say we have 2 groups of 100 persons (<em>n=100</em>), we want a confidence of 95%, and we study the example B as seen before :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGLqDauMt2irYUslvjI5hQ.png" /><figcaption>Confidence intervals for Example B</figcaption></figure><p>The confidence intervals for expected value do not overlap, so the distributions are not the same : we can consider the drug is effective on the number of days to cure, compared to the placebo.</p><h3>A conclusion</h3><p>The double-blind random study is one of the most trusted way of proving a drug is effective, but its usage goes way beyond medicine research. For example, you may know the A/B tests that are often used in advertising, UX design or even machine learning : the philosophy is the same. This kind of study can be used anytime we want to know if a variable has an impact on another one. At my company, we used a similar approach to evaluate the impact of tank characteristics on alcohol evaporation for one of our clients.</p><p>However, when performing double-blind studies is possible (and that is not always the case — how do you provide placebos for surgical interventions?), a major disadvantage arises : if the tested drug is effective, it means the “placebo” group did not benefit from it and certainly regret it. Is it ethical to administrate placebos to patients suffering from incurable diseases ? Maybe one day, some of the new approaches intending to solve this <em>regret </em>issue in the context of A/B testing, for example the <a href="https://netflixtechblog.com/artwork-personalization-c589f074ad76">reinforcement-learning-based Netflix artwork personalization</a> system, will benefit to medicine research.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=532ce47b0fd3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/double-blind-random-studies-how-to-prove-properly-that-a-therapy-works-532ce47b0fd3">Double-blind random studies : how to prove properly that a therapy works</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>
        <item>
            <title><![CDATA[Grand Débat National : Elles sont fraîches, mes données personnelles !]]></title>
            <link>https://pauldes.medium.com/contributions-au-grand-d%C3%A9bat-national-elles-sont-fra%C3%AEches-mes-donn%C3%A9es-personnelles-c80890ad1bfb?source=rss-eb83abdee88------2</link>
            <guid isPermaLink="false">https://medium.com/p/c80890ad1bfb</guid>
            <category><![CDATA[grand-débat]]></category>
            <category><![CDATA[personal-data]]></category>
            <category><![CDATA[data-leak]]></category>
            <dc:creator><![CDATA[Paul Désigaud]]></dc:creator>
            <pubDate>Thu, 14 Mar 2019 09:21:39 GMT</pubDate>
            <atom:updated>2021-03-10T13:42:37.568Z</atom:updated>
            <content:encoded><![CDATA[<h3>Grand Débat National : Elles sont fraîches, mes données personnelles !</h3><h4>Noms, adresses mails, adresses postales et numéros de téléphone apposés à des opinions politiques : les données des contributions au Grand Débat sont une mine de données personnelles.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*IXfSLvwKBU5cFrv9YWq1Hw.png" /></figure><p><em>En tant que data scientist chez </em><a href="https://medium.com/u/29d9c11971ae"><em>Wavestone Consulting,</em></a><em> quand j’ai appris que toutes les contributions des français au </em><a href="https://granddebat.fr/"><em>Grand Débat National</em></a><em> (qui a lieu du 15 janvier au 15 mars) étaient accessibles librement, j’ai décidé de prendre de l’avance sur les conclusions d’OpinionWay et appliquer mes outils sur ce jeu de données massif. Mon but ? Analyser les participants et leurs réponses afin de cerner qui sont les acteurs du Grand Débat et ce qu’ils proposent, mais aussi les limites d’un tel moyen d’échange avec la population.</em></p><p>Avez-vous lu la <a href="https://granddebat.fr/pages/politique-de-confidentialite">politique de confidentialité</a> de la plateforme utilisée pour le Grand Débat National lors de votre participation ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*CYzuvImzlKNnu19F0upL0Q.png" /><figcaption>Extrait de la politique de confidentialité du site granddebat.fr</figcaption></figure><p>Non ? Alors, vous ne savez peut-être pas que <strong>toutes les informations</strong> (hors adresse mail) <strong>que vous entrez sur le site du Grand Débat National sont rendues publiques</strong>. On ne peut pas vous en vouloir : cela n’est pas affiché durant la phase d’inscription ni durant la phase de participation. En fait, il faut descendre tout en bas de la page pour cliquer sur la rubrique Politique de confidentialité et l’afficher.</p><p>Alors, bien sûr, certains n’y pensent pas.</p><p>J’ai mené une rapide analyse de l’ensemble des contributions déposées sur la plateforme au 2 mars afin de trouver d’éventuelles données personnelles : nom, numéro de téléphone, adresses mails voir adresses postales si nous sommes chanceux. Pas besoin d’une quelconque intelligence artificielle ici : nous allons utiliser de simples <a href="https://fr.wikipedia.org/wiki/Expression_r%C3%A9guli%C3%A8re">expressions régulières</a> (sortes de motifs définissant le format d’une chaîne de caractère recherchée). Voilà mes résultats…</p><h4>Numéros de téléphone</h4><p>Plus de 40 contributeurs ont donné leur numéro de téléphone dans leurs contributions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*qCpg8bMu1vXjCjC8-KVPww.png" /><figcaption>Extrait (partiellement masqué) des numéros de téléphone trouvés dans le jeu de données.</figcaption></figure><h4>Adresses mails</h4><p>Plus de 180 personnes ont donné volontairement leur adresse mail dans leur contribution. Certaines sont des adresses hébergées par des entreprises (@laposte.net exemple), ce qui nous renseigne également sur leur travail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0I7QQ279x-JDSAl4UexgGA.png" /><figcaption>Extrait (partiellement masqué) des adresses mails trouvées dans le jeu de données.</figcaption></figure><h4>Noms et adresses postales</h4><p>Il est plus difficile de détecter correctement une adresse postale avec une expression régulière, mais j’ai pu en extraire quelques-unes du corpus avec succès.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*NMh8_U3OhPNHJKmpz3Bw2w.png" /><figcaption>Extrait (partiellement masqué) des adresses postales trouvées dans le jeu de données.</figcaption></figure><h4>Mais pourquoi ces personnes ont-elles donné leurs informations personnelles ?</h4><p>Il s’agit la plupart du temps de personnes qui se proposent d’être recontactées pour discuter des idées qu’elles ont soumises : justifier leurs arguments, approfondir leurs propositions, mettre en place des mesures…</p><p>Une pratique louable mais non sans risque.</p><h4>Pourquoi est-ce dangereux de divulguer ses données personnelles sur la plateforme du Grand Débat ?</h4><p>Exposer ses données personnelles sur ce genre de site ne vous exposera pas à du ciblage publicitaire traditionnel — sauf si vous indiquez dans votre contribution que vous adoreriez partir en vacances aux Maldives. Cependant les conséquences risquent d’être plus dramatiques.</p><ul><li>D’abord, ce qui arrivera sans doute, votre adresse mail risque d’être repérée par un <a href="https://en.wikipedia.org/wiki/Email_address_harvesting"><em>web-crawler</em></a><em> </em>qui l’utilisera pour vous envoyer des spams en tout genre.</li><li>Ensuite, vous vous exposez à des harcèlements ou une exposition publique par des personnes qui ne seront pas d’accord avec vos idées — voire du chantage.</li><li>Et enfin, il ne faut pas oublier que votre nom sera associé à des idées politiques. Une partie des contributions montrent clairement quel est le bord politique de l’auteur. Toutes montrent quelles sont les convictions de l’auteur — et donc, quels leviers un homme politique doit actionner pour s’octroyer sa sympathie, voire son vote. En fait, non anonymisé, ce jeu de données serait formidable pour une entreprise comme <a href="https://www.lemonde.fr/pixels/article/2018/03/22/ce-qu-il-faut-savoir-sur-cambridge-analytica-la-societe-au-c-ur-du-scandale-facebook_5274804_4408996.html">Cambridge Analytica,</a> au service de Trump pendant sa campagne pour convaincre les électeurs indécis.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Z5AoY5ddxfZgbMDD5IJlA.png" /><figcaption>Dominique le confesse, il a voté Macron en 2017.</figcaption></figure><h3>Pour conclure …</h3><p>Il est vrai que le nombre de personnes qui ont renseigné leurs noms, adresses ou e-mails est trop petit pour influencer une élection ou les ventes d’un produit. Mais ces personnes se retrouvent exposées à de potentiels harcèlements ou expositions suite à leurs déclarations.</p><p>Ma préconisation pour les organisateurs du Grand Débat est la suivante : <strong>filtrer</strong> toutes les informations personnelles ne représente que quelques lignes de code (les mêmes qui m’ont servies pour cette étude) et ne coûte pas grand chose à effectuer avant de publier les données. Et bien évidemment,<strong> rien ne vaut un rappel clair et visible sur le formulaire de participation</strong> que toute contribution sera publiée et accessible en ligne par le monde entier.</p><p><strong><em>Vous voulez en savoir plus sur le Grand Débat ? Retrouvez mon étude des participants </em></strong><a href="https://medium.com/@pauldes/la-data-science-au-service-du-grand-d%C3%A9bat-national-partie-1-les-participants-c886d5bd7e0e"><strong><em>ici </em></strong></a><strong><em>et mon étude des propositions sur le thème de l’environnement [à paraître].</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c80890ad1bfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grand Débat National : Une analyse des participants]]></title>
            <link>https://pauldes.medium.com/la-data-science-au-service-du-grand-d%C3%A9bat-national-partie-1-les-participants-c886d5bd7e0e?source=rss-eb83abdee88------2</link>
            <guid isPermaLink="false">https://medium.com/p/c886d5bd7e0e</guid>
            <category><![CDATA[grand-débat]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Paul Désigaud]]></dc:creator>
            <pubDate>Wed, 27 Feb 2019 17:28:42 GMT</pubDate>
            <atom:updated>2021-03-10T13:41:33.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>Grand Débat National : Une analyse des participants</h3><h4>Qui sont les participants au Grand Débat ? Sont-ils représentatifs des français ? Quelles populations sont oubliées ? Comment certains essayent-ils de truquer les résultats ? Quelle est la bonne manière d’aborder les données et d’en tirer des conclusions ?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9DKO1qmWC2tr9U-2Ubgeg.png" /></figure><p><em>En tant que data scientist chez </em><a href="https://medium.com/u/29d9c11971ae"><em>Wavestone Consulting,</em></a><em> quand j’ai appris que toutes les contributions des français au </em><a href="https://granddebat.fr/"><em>Grand Débat National</em></a><em> (qui a lieu du 15 janvier au 15 mars) étaient </em><a href="https://www.data.gouv.fr/fr/datasets/donnees-ouvertes-du-grand-debat-national/"><em>accessibles librement</em></a><em>, j’ai décidé de prendre de l’avance sur les conclusions d’OpinionWay et appliquer mes outils sur ce jeu de données massif. Mon but ? Analyser les participants et leurs réponses afin de cerner qui sont les acteurs du Grand Débat et ce qu’ils proposent, mais aussi les limites d’un tel moyen d’échange avec la population. J’ai mené mon analyse sur l’un des 4 thèmes proposés, intitulé : “La transition écologique”.</em></p><p><strong><em>Dans ce billet, nous allons étudier les participants au Débat, sans analyser les réponses aux questions.</em></strong></p><h3>Le jeu de données</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zSCvMmyenSlrnfcsFbmRw.png" /><figcaption>Un extrait du jeu de données issu des participations au Grand Débat mis à disposition par le gouvernement.</figcaption></figure><p>On retrouve deux types d’informations dans notre jeu de données :</p><ul><li>Quelques informations sur le contributeur et sa réponse. Les plus pertinentes sont le type et le code postal de l’auteur (attention cependant : aucune vérification n’a lieu sur la véracité des informations renseignées par le contributeur).</li><li>Les réponses à un ensemble de questions à choix multiples ou à champ libre (ou les deux…). Il y en a 16 au total pour ce thème.</li></ul><p>64669 contributions ont été apportées sur ce thème. Il s’agit bien d’un nombre de participations et non de participants. Le nombre de participants (mails uniques) est de 58035. Cela représente un peu moins de 0.1% de la population française. Au 25/02, d’après le site <a href="https://granddebat.fr/">https://granddebat.fr</a>, le nombre de participants était passé à 69110.</p><blockquote><strong>Qu’a-t-on appris dans cette partie ?</strong></blockquote><blockquote>› Les données accessibles pour l’instant en open-data ne sont qu’une partie de l’ensemble des contributions.</blockquote><blockquote>› Les données comportent des réponses aux questions et quelques informations utiles sur le contributeur.</blockquote><blockquote>› Une même personne physique peut avoir contribué plusieurs fois, avec la même adresse mail ou avec des adresses mails différentes.</blockquote><h3>Origine des contributeurs</h3><p>Quels sont les 10 codes postaux et les 10 départements les plus représentés parmi les contributeurs ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsz1aGP71GKMIc9p4ojqgg.png" /><figcaption>Top 10 des codes postaux et des départements les plus répandus parmi les contributeurs.</figcaption></figure><p>Sans surprise, les codes postaux parisiens sont les plus représentés. Le département de Paris est également le plus représenté, suivi du Rhône (dont la ville de Lyon, 2ème aire urbaine française) et des Hauts-de-Seine (métropole du Grand Paris).</p><p>Maintenant, comment vérifier qu’un département est « bien » représenté, c’est-à-dire que la part du département dans les contributeurs est cohérente avec la part du département dans la population française ? En comparant le nombre de participant au nombre d’habitants, obtenu grâce aux <a href="https://www.insee.fr/fr/statistiques/1893198">données de l’INSEE</a> :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwuIz_5li5PR7dkeTNWe1A.png" /><figcaption>Part parmi la population française et part parmi les contributeurs pour les 5 départements les plus répandus parmi les contributions.</figcaption></figure><p>On note donc des écarts entre la part des départements parmi les contributeurs et parmi la population française. Le département du Rhône par exemple (préfecture : Lyon) sur-représenté : il est le deuxième département le plus représenté avec 4.08% des contributions, alors qu’il est le troisième département le plus peuplé après les Bouches-du-Rhône (préfecture : Marseille) qui lui est sous-représenté.</p><p>Voyons quels départements sont représentés de manière extrême :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eKmF81D__-m9b5_Qf1k-Ng.png" /><figcaption>Top 5 des départements les plus sous-représentés dans les contributions (écart négatif).</figcaption></figure><p>Les habitant du Nord sont les moins impliqués : ils représentent 2.42% des contributeurs mais presque 4% de la population française, soit un écart de -1.6 points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Az7FZs-flIk0idEWcD0kxA.png" /><figcaption>Top 5 des départements les plus sur-représentés dans les contributions (écart positif).</figcaption></figure><p>Les habitant de Paris sont les plus impliqués : ils représentent 5.73% des contributeurs mais seulement 3.30% de la population française, soit un écart de +2.4 points.</p><p>Un axe d’analyse similaire est le calcul le taux de participation par département :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qg1FEg7m5OJ-VrYV86TyFA.png" /><figcaption>Top 5 des départements au plus haut (à gauche) et au plus bas (à droite) taux de participation au Grand Débat.</figcaption></figure><p>La Seine-Saint-Denis est donc le département au plus bas taux de participation (les chiffres sont arrondis à l’affichage mais l’ordre est choisi selon la part exacte). On peut maintenant afficher le taux de participation par département sur une carte :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*55ZDUqLW_3EVX5s7_LOj8w.png" /><figcaption>Taux de participation au Grand Débat par département.</figcaption></figure><p>Les territoires fortement impliqués dans le Grand Débat sont la région Rhône-Alpes, la côte méditerranéenne et la côte Atlantique et plus généralement le Sud et l’Ouest, la région parisienne. Les territoires moins impliqués sont le Nord et Nord-Est et les espaces péri-parisiens.</p><p>A quoi peut-on comparer cette carte pour tirer des conclusions ? Voilà quelques idées :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*Wy8GJypEd1DTerwBUv1X9g.png" /><figcaption>Quelques idées de cartographies à comparer à celle du taux de participation au Grand Débat.</figcaption></figure><blockquote><strong>Qu’a-t-on appris dans cette partie ?</strong></blockquote><blockquote>› Les départements ne sont pas représentés avec fidélité relativement à leur population. On ne peut donc pas vraiment utiliser les contributions comme un sondage de la population.</blockquote><blockquote>› Le taux de participation varie beaucoup par département. Cette variation paraît corrélée à première vue avec la fragilité des territoires : moins un territoire est fragile, plus il est représenté dans les contributions. Les contributions sont donc principalement issues des territoires favorisés.</blockquote><h3>Types de contributeurs</h3><p>Lors de l’inscription au Grand Débat, il est proposé de donner l’entité que l’on représente. Cette information est enregistrée comme “type de contributeur”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nq67qYS3GEIbIN5iM6Cigg.png" /><figcaption>Répartition des types de contributeurs au Grand Débat. Une partie importante des contributeurs n’ont pas donné cette information.</figcaption></figure><p>Cette information nous permet de nous rendre compte que certains ont contribué en tant qu’organisation et non en tant que personne individuelle. Outre leur légitimité à s’exprimer en tant qu’organisation, que nous ne pouvons vérifier, ces personnes s’expriment peut-être au nom d’un ensemble d’individus — 2,10, 100? — qui constituent l’organisation. Dès lors, il convient de traiter leur réponses avec attention.</p><p>Pour la suite, cette information nous permettra d’étudier les réponses aux questions par type (par exemple, voir si l’avis des citoyens et des élus divergent sur une problématique). Encore une fois cependant, il faudra se méfier de la véracité de cette information qui n’est ni vérifiée ni vérifiable.</p><blockquote><strong>Qu’a-t-on appris dans cette partie ?</strong></blockquote><blockquote>› Les citoyens constituent la majorité des contributeurs au Débat. Cependant, des organisations, qui représentent peut-être plusieurs personnes s’étant concertés afin de donner une réponse unifiée, ont également participé au Débat.</blockquote><h3>Volume des contributions</h3><p>La première contribution inscrite dans le jeu de données date du 22 janvier, la dernière du 17 février. Les contributions sont ouvertes jusqu’au 15 mars. Notre jeu de données actuels couvre donc une plage temporelle incomplète. Peut-on s’attendre à de nombreuses nouvelles contributions après le 17 janvier, ce qui rendrait une analyse peu pertinente aujourd’hui ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aaiu4ETpdK3VwbEc4ta7sg.png" /><figcaption>Nombre de contributions par jour et évolution du nombre cumulatif total entre le 22 janvier et le 17 février. On remarque un creux les 02 et 03 février : il semblerait que les français n’aiment pas contribuer le week-end !</figcaption></figure><p>Le nombre de soumissions par jour (barres rouges) a été décroissant au cours du temps. Après le 17 février, ce nombre devrait soit continuer à décroître en suivant la tendance générale, soit se stabiliser comme cela semble être le cas les derniers jours ; à moins qu’un évènement particulier (annonce du gouvernement, visibilité dans les médias…) vienne relancer les contributions.</p><p>On se rend compte avec la courbe du nombre total (aire bleue) que chaque jour les nouvelles contributions continuent à grossir le total de manière non négligeable.</p><blockquote><strong>Qu’a-t-on appris dans cette partie ?</strong></blockquote><blockquote>› Pendant le premier mois de mise en service du Grand Débat, chaque jour apportait son lot de nouvelles contributions. Il conviendra de relancer notre analyse avec un jeu de données complet — s’il est disponible à temps : au 26 février, les données Open Data s’arrêtaient au 17 février.</blockquote><h3>Outil détourné et contributions “truquées”</h3><p>Un outil d’appels aux contributions sur Internet, libre et aux enjeux potentiels forts, comme la plateforme du Grand Débat, peut donner envie à certains d’utiliser des techniques pour se faire entendre un peu plus fort que les autres et être mieux représenté dans les résultats.</p><p>Pour détecter ce genre de comportements, nous pouvons commencer par chercher des traces de contributions massives et soudaines qui auraient pu être orchestrées par un <a href="https://fr.wikipedia.org/wiki/Bot_informatique">bot</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33zeq6IhhNBc9PXCr1kWVQ.png" /><figcaption>Extraits de 4 contributions déposées exactement au même moment</figcaption></figure><p>Le nombre maximum de contributions déposées au même moment est 4, un nombre peu suspect. Ces contributions déposées dans la même seconde sur le site semblent bien provenir d’auteurs différents : les réponses aux questions sont différentes et ne sont pas l’œuvre d’un bot. Il n’est pas à exclure cependant qu’un bot plus discret, espaçant ses requêtes, ait été à l’œuvre — sachant notamment que le formulaire d’inscription ne comporte pas de systèmes <a href="https://fr.wikipedia.org/wiki/CAPTCHA">captcha</a>. Pour tenter de détecter cela, nous allons chercher non pas des contributions déposées au même moment, mais des contributions identiques qui chercheraient à faire ressortir le même message.</p><p>Voilà la première question qui est posée dans le formulaire du thème transition écologique :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v41SadeZoGybgRWwxMYo0Q.png" /><figcaption><em>Capture d’écran </em><a href="https://granddebat.fr/"><em>https://granddebat.fr</em></a></figcaption></figure><p>Regardons quelles réponses ont été le plus données par les contributeurs :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VnFFdaWuBNq3HDo7OHTwmA.png" /><figcaption>Top 8 des réponses les plus données à la première question</figcaption></figure><p>…et un peu plus loin…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0k3aGHB9_PRUzoYSICdBtQ.png" /><figcaption>Top 20 à 26 des réponses les plus données à la première question</figcaption></figure><p>Surprise : une réponse longue, très bien rédigée, a été donnée 18 fois dans le champ de texte libre. Sans suspecter un bot, nous avons ici ce qui ressemble à une action concertée « massive », typiquement, une vingtaine de personnes qui se sont mises d’accord sur un message précis à faire passer sur le nucléaire. Une <a href="https://savoie-antinucleaire.fr/2019/02/13/participons-au-grand-debat-pour-denoncer-larme-nucleaire/">recherche Internet </a>nous permet de trouver par quel organisme ce message a été écrit.</p><blockquote><strong>Qu’a-t-on appris dans cette partie ?</strong></blockquote><blockquote>› Des contributeurs se sont concertés sur les réponses à donner et propositions à faire afin d’avoir un plus grand impact lors de l’analyse. Ce procédé a pu être exécuté à plus grande échelle sur d’autres questions ou d’autres thèmes, peut-être de façon moins visible, et fausser les résultats.</blockquote><h4><strong>Dans ce billet, nous avons étudié les participants au Débat et fait d‘intéressantes découvertes. Maintenant, nous connaissons un peu mieux les 64669 contributeurs !</strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c886d5bd7e0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift: encore une stratégie gagnante pour le nouveau langage d’Apple]]></title>
            <link>https://medium.com/%C3%A9cosyst%C3%A8me-des-langages-de-programmation/swift-est-depuis-2010-le-langage-d%C3%A9velopp%C3%A9-par-les-ing%C3%A9nieurs-apple-pour-remplacer-lobjective-c-e29e8d0dea8f?source=rss-eb83abdee88------2</link>
            <guid isPermaLink="false">https://medium.com/p/e29e8d0dea8f</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[insa-lyon]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Paul Désigaud]]></dc:creator>
            <pubDate>Sun, 26 Feb 2017 18:40:45 GMT</pubDate>
            <atom:updated>2017-05-02T09:33:58.776Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGRFw_-fR_qrrFSsNrpBdw.jpeg" /></figure><p><em>Swift</em> est depuis 2010 le langage développé par les ingénieurs Apple pour remplacer <em>Objective-C</em> sur tous les terminaux de la marque à la Pomme — iPhone, Mac, iPad ou encore Apple TV. C’est d’abord <a href="http://nondot.org/sabre/">Chris Lattner</a> (LLVM, Xcode) qui a passé ses soirs et ses weekends, seul, dans l’ombre, à poser les bases du langage, puis a présenté son projet à ses patrons. Lesquels ont immédiatement adhéré à sa vision et en ont fait un des objectifs principaux de la société, en plaçant de nombreux autres ingénieurs sous la direction de Lattner.</p><p>Présenté dans sa première version officielle en 2014, <em>Swift</em> contraste avec le vieux <em>Objective-C</em> qui a fêté ses 30 ans il y a quelques années: plus de pointeurs et de <a href="https://developer.apple.com/swift/">gestion manuel </a>de la mémoire, sources d’erreurs; <a href="https://www.wired.com/2014/07/apple-swift/">syntaxe réduite</a> pour un code concis et plus propre (plus de <em>break</em> dans les <em>switch</em>, de point-virgules, support d’Unicode); <a href="https://www.quora.com/Why-did-Apple-switch-from-Objective-C-to-Swift/answer/Prateek-Malik">débogage automatique par REPL</a> (read-eval-print loop); <a href="https://developer.apple.com/swift/">fonctionnalités modernes</a> comme les tuples, les retours à plusieurs valeurs ou les itérations rapides dans les collections.</p><blockquote>“Swift is the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language” — Apple</blockquote><p>Des améliorations qui permettent une adaptation aux méthodes modernes de développement, une exécution plus rapide des applications et surtout une courbe d’apprentissage plus inclinée: les “nouveaux” programmeurs, notamment ceux habitués aux langages récents comme <em>Python,</em> seront plus incités à se lancer dans <em>Swift</em>. <em>Swift</em> reste compatible avec la syntaxe <em>Objective-C</em> pour permettre une transition douce des grands développeurs iOS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*iTk0cTeWgsoEjOi_QxXPmA.jpeg" /><figcaption>Lancement de Swift 1.0 à la WWDC 2014</figcaption></figure><p>Pourtant, d’autres langages modernes comme <em>Ruby</em>, <em>Go</em> ou <em>Javascript</em> possèdent plus ou moins les même spécificités tout en étant développés depuis plusieurs années. Alors pourquoi <em>Swift </em>? Tout d’abord pour posséder le code, le modifier selon les propres envies et besoins d’Apple et sans devoir en référer à l’entière communauté Open-Source ou à une autre société avant cela. C’est d’abord la garantie d’un langage optimisé pour les produits à la Pomme.</p><p><em>Swift</em> marque une première dans l’histoire Apple en 2015, 1 an après sa sortie: le code du langage est <a href="https://github.com/apple/swift">diffusé en Open-Source</a> sous licence Apache 2.0, incluant le compilateur et les bibliothèques standard du langage. Apple affirme que des contributions de la communauté seront acceptées et encouragées même si la direction du projet reste sous son contrôle. Un but apparaît clairement: convertir le plus de monde possible à la programmation d’applications iOS. Ce but est appuyé par un effort d’Apple en matière d’enseignement: en plus d’un livre présentant <em>Swift</em> en 500 pages mis à disposition gratuitement sur iTunes le jour de la sortie, iTunes a collaboré avec un professeur de la Southern Methodist University (Dallas, Texas) pour mettre au point un <a href="https://itunes.apple.com/fr/course/developing-ios-9-apps-swift/id1104579961?ign-mpt=uo%3D4">cours gratuit enseignant <em>Swift</em></a> en s’appuyant sur des ressources en accès libre sur GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yaMR3VSVPd3fZpkpKdASGQ.jpeg" /><figcaption>Swift Playgrounds, interface d’apprentissage rapide et ludique développée par Apple (disponible sur iPad). Les changements de code sont injectés dans l’application en cours d’exécution, sans délai de compilation.</figcaption></figure><p>Autre nouveauté: 1 an après sa sortie, Apple a sorti les librairies <em>Swift</em> pour distributions Linux. Cependant, l’éditeur de code xCode et le très pratique Playgrounds, interface de développement interactive et ludique à compilation instantanée spécialement adaptée pour l’apprentissage de <em>Swift</em> restent cantonnés aux systèmes Apple.</p><p>Si Apple vante les mérites de ce nouveau langage, son utilisation dans les OS est restée mineure un moment après sa sortie: sur iOS 8 sorti fin 2014, on relevait une seule application écrite en <em>Swift</em> — <a href="https://medium.com/ios-os-x-development/is-apple-using-swift-4a6c80f74599#.ys1fsjpqx">seules 2 classes sur 22 étaient encore écrites en <em>Objective-C</em></a>. Car <em>Swift</em>, comme tout nouveau langage, comportait une certaine quantité de bugs. Là encore, la communauté Open-Source a permis d’impliquer plus de collaborateurs dans le processus de débogage des librairies <em>Swift</em>.</p><p>Les résultats de la politique menée par Apple avec <em>Swift</em> sont visibles: en février 2017, le TIOBE Index plaçait <em>Swift</em> deux positions au-dessus du <em>Go </em>de Google dans le classement des langages les plus populaires, avec un écart cependant très faible (moins de 0.1 point).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*vabUmaquFUO7ebCrtpLalQ.jpeg" /><figcaption>L’Index TIOBE des langages les plus populaires en février 2017 — tiobe.com</figcaption></figure><p><em>Swift</em> a donc rapidement rattrapé le langage d’un de ses concurrents qui était pourtant développé avec 5 ans d’avance par les plus grands noms de la programmation. Il a en fait été massivement adopté dans le monde comme jamais auparavant un langage ne s’était répandu — pas même Java dans les années 90 ou C# dans les années 2000. Même si les deux langages, tout comme<a href="https://www.wired.com/2014/03/facebook-hack/"> le langage <em>Hacker </em>développé par Facebook</a>, tentent de faire le pont entre la vitesse d’exécution des langages compilés et l’absence de délais de compilation des langages interprétés, leur domaine d’utilisation diffère pour l’instant sensiblement. Cependant, la communauté fortement impliquée dans <em>Swift</em>, activement poussée par Apple, tend à en faire un langage à usages multiples et donc un sérieux concurrent de <em>Go </em>pour le backend. La société <a href="http://perfect.org/">PerfectlySoft</a> a ainsi sorti une version de Swift dédiée aux serveurs liés aux applications iPhone. Une orientation que n’aurait sûrement pas envisagé Apple au commencement du projet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e29e8d0dea8f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%C3%A9cosyst%C3%A8me-des-langages-de-programmation/swift-est-depuis-2010-le-langage-d%C3%A9velopp%C3%A9-par-les-ing%C3%A9nieurs-apple-pour-remplacer-lobjective-c-e29e8d0dea8f">Swift: encore une stratégie gagnante pour le nouveau langage d’Apple</a> was originally published in <a href="https://medium.com/%C3%A9cosyst%C3%A8me-des-langages-de-programmation">Ecosystèmes des langages de programmation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>