<?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 Alejandra Pedroza Marchena on Medium]]></title>
        <description><![CDATA[Stories by Alejandra Pedroza Marchena on Medium]]></description>
        <link>https://medium.com/@alejandra-pedroza?source=rss-3bd33dc6411e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xAPascsswKafYVGf.jpg</url>
            <title>Stories by Alejandra Pedroza Marchena on Medium</title>
            <link>https://medium.com/@alejandra-pedroza?source=rss-3bd33dc6411e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 11:54:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alejandra-pedroza/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[Docs-As-Code, my first approach]]></title>
            <link>https://alejandra-pedroza.medium.com/docs-as-code-my-first-approach-51bbc4e4750a?source=rss-3bd33dc6411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/51bbc4e4750a</guid>
            <category><![CDATA[software-documentation]]></category>
            <category><![CDATA[docops]]></category>
            <category><![CDATA[docs-like-code]]></category>
            <category><![CDATA[technical-writing]]></category>
            <category><![CDATA[docs-as-code]]></category>
            <dc:creator><![CDATA[Alejandra Pedroza Marchena]]></dc:creator>
            <pubDate>Tue, 06 Jul 2021 19:51:03 GMT</pubDate>
            <atom:updated>2021-08-16T13:18:13.419Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfHXdJk6EPWCOJISLkRijw.png" /><figcaption>Image: sdtimes.com</figcaption></figure><p>I was watching some videos about Technical Writing trends when I got speechless. At that moment, I realized that the tools and techniques I used for my daily work as a Tech Writer were kind of outdated. I think that was the first time I heard about “Docs-As-Code”.</p><p>I was so curious and excited about learning how to treat my documentation like code that I wanted to learn about adopting automation pipelines, dev tools, and a DevOps mindset for documentation purposes.</p><p>At Wizeline, I had the opportunity to join the DocOps Taskforce that we put together within the Technical Writing team; that is how we learned, experimented, and propagated this documentation approach.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfvVusHA5ISw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfvVusHA5ISw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfvVusHA5ISw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/58695fc683e1d53f5ace017b250927ed/href">https://medium.com/media/58695fc683e1d53f5ace017b250927ed/href</a></iframe><p>Then, my friend and colleague Silvia Alvarado and I wrote an article about our experience implementing Docs Like Code and the solution we ideated. In the article, we explain the challenges we faced using our previous process, the steps we took to build a better solution, and the benefits of the new approach.</p><p>We wrote it on behalf of the DocOps Taskforce (Armando Salazar, Arunabh Nag, Isaí Cortés, Roberto Antelo, and José Luis Zapata) and the rest of the Technical Writing Team.</p><p>The article “Implementing a Docs Like Code Solution at Wizeline” was published on <a href="https://www.wizeline.com/blog/">The Pulse</a>, which is the official Wizeline’s blog.</p><p><em>To read the complete article, visit the following link: </em><a href="https://www.wizeline.com/implementing-a-docs-like-code-solution-at-wizeline/?fbclid=IwAR0aQqu1GuGAjE5pbz5M_lYmZZe_7UGc14HpWT--j_3iuiJ7hUQFKU7IeU8">https://www.wizeline.com/implementing-a-docs-like-code-solution-at-wizeline/?fbclid=IwAR0aQqu1GuGAjE5pbz5M_lYmZZe_7UGc14HpWT--j_3iuiJ7hUQFKU7IeU8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51bbc4e4750a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting gender-based hate speech in Spanish with Natural Language Processing]]></title>
            <link>https://becominghuman.ai/detecting-gender-based-hate-speech-in-spanish-with-natural-language-processing-cdbba6ec2f8b?source=rss-3bd33dc6411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdbba6ec2f8b</guid>
            <category><![CDATA[hate-speech]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gender-equality]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alejandra Pedroza Marchena]]></dc:creator>
            <pubDate>Mon, 05 Oct 2020 16:02:45 GMT</pubDate>
            <atom:updated>2020-12-01T15:28:08.957Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By: </em><a href="https://medium.com/@alejandra.pedroza"><em>Alejandra Pedroza</em></a><em>, </em><a href="https://medium.com/@lilianabsmath"><em>Liliana Badillo</em></a><em>, and </em><a href="https://medium.com/@ivanovishado"><em>Iván Galaviz</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8vQ7UMwx-oCC3CPL" /><figcaption><strong>Figure 1. Hate Speech Illustration. Source: istock.com</strong></figcaption></figure><p>Chances are that you have been involved in a situation of violence against women and you didn’t even notice it. You could have been the victim or you could have been the victimizer and, again, you didn’t notice it.</p><p>How is it possible to be the victim or victimizer without being aware of it? Violence against women takes different forms and one of the most common manifestations seems to be so normalized that it unconsciously comes up in our daily life: verbal violence.</p><p>We materialize verbal violence in our daily speech and, nowadays, one part of our daily speech has moved to social media. For this reason, we need effective methods to detect this hate speech that takes place online.</p><p>In this article, we explain how we used <a href="https://becominghuman.ai/a-simple-introduction-to-natural-language-processing-ea66a1747b32">Natural Language Processing</a> (NLP) techniques to detect online gender-based hate speech in Mexican Spanish.</p><p>We call this project <strong>Violentómetro Online.</strong> It was the result of the work we did as part of the <a href="https://www.facebook.com/watch/live/?v=305770720729799"><strong>Social Data Challenge</strong></a><strong> </strong>contest, powered by<strong> </strong><a href="http://datalab.mx/"><strong>Datalab Community</strong></a> in Guadalajara, México. With this effort, we won the 3rd place of the contest.</p><h3>Trending AI Articles:</h3><blockquote><a href="https://becominghuman.ai/how-to-automatically-deskew-straighten-a-text-image-using-opencv-a0c30aed83df">1. How to automatically deskew (straighten) a text image using OpenCV</a></blockquote><blockquote><a href="https://becominghuman.ai/explaining-yolov4-a-one-stage-detector-cdac0826cbd7">2. Explanation of YOLO V4 a one stage detector</a></blockquote><blockquote><a href="https://becominghuman.ai/5-best-artificial-intelligence-courses-for-beginners-in-2020-38db08617b12">3. 5 Best Artificial Intelligence Online Courses for Beginners in 2020</a></blockquote><blockquote><a href="https://becominghuman.ai/a-non-mathematical-guide-to-the-mathematics-behind-machine-learning-4b71d9e16dcd">4. A Non Mathematical guide to the mathematics behind Machine Learning</a></blockquote><h3>Problem</h3><p>In this section, we problematize the gender violence and online violence topics. We also present some theory that helps to better understand the phenomenon.</p><h4>Gender Violence</h4><p>Worldwide, three out of 10 women have suffered any type of violence <a href="https://www.who.int/es/news-room/fact-sheets/detail/violence-against-women">(WHO, 2017)</a>. The situation in Mexico is more critical. From the 46.5 million Mexican women aged 15 and over, six out of 10 (30.7 million) have faced any type of violence at some point in their lives <a href="https://www.inegi.org.mx/contenidos/saladeprensa/aproposito/2018/violencia2018_Nal.pdf">(INEGI, 2017, p. 1 ).</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*jEjoK6sMmPhTvJLF" /><figcaption><strong>Figure 2. Gender Violence Statistics</strong></figcaption></figure><p>Violence against women gets materialized in different ways <a href="https://www.inegi.org.mx/contenidos/saladeprensa/aproposito/2018/violencia2018_Nal.pdf">(INEGI, 2017)</a>:</p><p>● Emotional</p><p>● Physical</p><p>● Sexual</p><p>● Economic</p><p>● Discrimination</p><p>● Verbal</p><p>To differentiate <a href="https://web.stanford.edu/~eckert/PDF/Chap1.pdf">gender-based</a> violence from other forms of violence, we have to pay attention to the cause. In these cases, there is no other motivation for such abuse than gender. These are women who have been abused in public or private life and there is no other crime (like robbery or drug trafficking) involved as a detonator <a href="https://www.who.int/es/news-room/fact-sheets/detail/violence-against-women">(WHO, 2017).</a></p><h4>Online Verbal Violence</h4><p>Verbal violence is a type of abuse that does not cause physical injury. Due to its nature, verbal violence is manifested through hate speech <a href="https://bmchealthservres.biomedcentral.com/articles/10.1186/1472-6963-5-54">(Carmi-Iluz, Peleg, Freud, &amp; Shvartzman, 2005</a>; <a href="https://mainweb-v.musc.edu/vawprevention/research/defining.shtml">Mouradian, s.f.).</a></p><p>Nowadays, hate speech has moved to new forums because of the proliferation of information and communication technologies. Currently, it is necessary to talk about “online violence”, which can go unnoticed from a screen<a href="https://comunicacionymedios.uchile.cl/index.php/RCM/article/view/32375"> (Ruiz, 2014).</a></p><figure><a href="https://aijobsboard.com/?fbclid=IwAR0GcsLs8A6CFM-fynrZMM3sTgo_Zpbto2CjglJm0Dmi6otC6YWc7CDFpQk"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAlwXfVrtYspdCzmC8iADw.png" /></a><figcaption>Big Data Jobs</figcaption></figure><p>The Internet itself stimulates aggressiveness and creates an environment in which even non-aggressive people can have aggressive behaviors in their interactions <a href="http://dissoc.org/ediciones/v04n04/DS4(4)Banon.html">(Bañón Hernández, 2010)</a>. This is because the media in the Internet have properties related to:</p><p>● <strong>Anonymity:</strong> Provides a hidden identity to the victimizer.</p><p>● <strong>Distance:</strong> Makes the victim invisible.</p><p>● <strong>Ubiquity:</strong> Provides a greater exposure and availability to hate speech.</p><p>● <strong>Disinhibition:</strong> Establishes absence of regulations for content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*49idCVIhwCE501zS" /><figcaption><strong>Figure 3. Screenshot of Gender-Based Hate Speech. Source: </strong><a href="https://wecounterhate.com/"><strong>https://wecounterhate.com/</strong></a></figcaption></figure><h3>Solution</h3><p>In this project, we aimed to develop an effective method to automatically detect online gender-based hate speech in Spanish. To achieve this goal, we worked within the field of Machine Learning and took advantage of Natural Language Processing techniques.</p><p>In this section, we describe the tools and data we used in our project. We also report the cleaning and preprocessing methods we applied to better process our data. We explain how we executed the experiments using different Machine Learning models and parameters, and how we obtained the best model. Finally, we present the web application prototype we developed to make <strong>Violentómetro Online</strong> a user-friendly product.</p><h4>Tools</h4><p>The following are the tools we used to obtain, preprocess, analyze, and model the data, as well as to develop the web application prototype:</p><ul><li><a href="https://www.python.org/"><strong>Python:</strong></a><strong> </strong>To develop the code for the data processing and for the web application development. We used the following libraries:</li><li><a href="https://spacy.io/">SpaCy</a></li><li><a href="https://scikit-learn.org/stable/">Scikit-learn</a></li><li><a href="https://seaborn.pydata.org/">Seaborn</a></li><li><a href="https://www.streamlit.io/">Streamlit</a></li><li><a href="https://github.com/"><strong>Github:</strong></a><strong> </strong>To control the version of the code we developed collaboratively.</li><li><a href="https://colab.research.google.com/"><strong>Google Colab:</strong></a><strong> </strong>To develop our code collaboratively online.</li><li><a href="https://www.heroku.com/"><strong>Heroku:</strong></a><strong> </strong>To host the web application prototype.</li></ul><h4>Data</h4><p>In this project, we used the following datasets:</p><ul><li>Facebook Comments</li><li>MEX-A3T Train Aggressiveness</li><li>Final Dataset</li></ul><p><strong><em>Facebook Comments</em></strong></p><p>Previous to the Social Data Challenge, one member of our team gathered this dataset using the Facebook API. It was obtained from comments published in news’ posts related to International Women’s Day in the week of March 6 to 13, 2018. The news were published on the Facebook accounts of the following media:</p><ul><li><a href="https://www.facebook.com/CNNee/">CNN en Español</a></li><li><a href="https://www.facebook.com/AristeguiOnline/">Aristegui Noticias</a></li><li><a href="https://www.facebook.com/traficozmg/">Tráfico ZMG</a></li></ul><p>We manually tagged the dataset to identify specific hate speech against women. The dataset ended up with the following characteristics:</p><ul><li><strong>1, 968 records</strong></li><li><strong>2 columns</strong></li><li><strong>2 categories:</strong></li><li>1 = Contains hate speech against women</li><li>0 = Does not contain hate speech against women</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/0*L9lakSALfwkxEKWu" /><figcaption><strong>Figure 4. Facebook Comments Dataset</strong></figcaption></figure><p><strong><em>Train Aggressiveness</em></strong></p><p><a href="https://sites.google.com/view/mex-a3t/"><em>MEX-A3T: Fake News and Aggressiveness Analysis</em></a> is an event organized by the NLP community in Mexico to detect fake news and text with hate speech. The researchers that organize this event shared the training dataset with us. The dataset has the following characteristics:</p><ul><li><strong>7 mil 332 records</strong></li><li><strong>2 columns</strong></li><li><strong>2 categories:</strong></li><li>1 = Contains general hate speech</li><li>0 = Does not contain general hate speech</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/0*KfSD8zgqYz4FoKZL" /><figcaption><strong>Figure 5. Train Aggressiveness Dataset</strong></figcaption></figure><p><strong><em>Final Dataset</em></strong></p><p>To perform the experiments, we joined the two datasets described before. The Facebook Comments dataset was modified so that category 1 was replaced by 2 (hate speech against women). We also performed some feature engineering and added more columns (for more details, see the <a href="https://docs.google.com/document/d/1fjpklgTnUzQSfuyYvFilgJ6cj5B0lCXQcO9LEUN4IzU/edit#heading=h.keqmtzsl4pno">Preprocessing</a> section). The final dataset resulted in the following characteristics:</p><ul><li><strong>9,300 records</strong></li><li><strong>5 columns</strong></li><li><strong>3 categories:</strong></li><li>2 = Contains hate speech against women</li><li>1 = Contains general hate speech</li><li>0 = Does not contain any type of hate speech</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*O2ijSAlo4TcWEdyM" /><figcaption><strong>Figure 6. Final Dataset</strong></figcaption></figure><h4>Preprocessing</h4><p>We performed some preprocessing with both cleaning and feature engineering techniques. The cleaning techniques were useful to prepare the dataset for the analysis, whereas the feature engineering techniques were useful to improve the performance of our model. The preprocessing included the following actions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s45iJmtx2dhcrg64Odxtfw.png" /><figcaption><strong>Table 1. Cleaning and Feature Engineering Techniques Used in this Project</strong></figcaption></figure><h4>Exploratory Data Analysis</h4><p>Using basic tools of statistics, we performed an exploratory data analysis (EDA) to inspect the composition of the two original datasets we are using. We examined characteristics such as the length of the messages (records), the quantity of words in general, and the quantity of unique words.</p><p>The EDA shows that the distributions of the Train Aggressiveness dataset and the Facebook Comments dataset are different. For example, the distribution of the length of the comments is different according to the platform in which they were published. Comments on Facebook tend to be larger than tweets and the use of words tend to be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*b3bp6NyxIk6RZxNy" /><figcaption><strong>Figure 6. Distribution of the Train Aggressiveness Dataset</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*K8rChhorJCn59rYP" /><figcaption><strong>Figure 7. Distribution of the Facebook Comments Dataset</strong></figcaption></figure><p>Regarding the type of words, in the Train Aggressiveness dataset, we could notice that the content was similar for both <em>hate speech</em> and <em>no hate speech </em>categories.</p><p>We noticed that these similarities occur because one message can contain single words related to vulgarity or obscenity, but in its complete structure, it is not hate speech given that it does not attack a specific group or individual. On the other hand, there are also messages that contain single words related to vulgarity or obscenity, and it does attack a specific group or individual. These similarities made it challenging for our algorithms to classify.</p><p>The following word clouds show how similar are the most frequent words of the Train Aggressiveness dataset in both <em>hate speech</em> and <em>no hate speech </em>categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SW7P2fjndvqUkOZtxTVPjg.png" /><figcaption><strong>Figure 8. Word Clouds Showing the Most Frequent Words of the Train Aggressiveness Dataset</strong></figcaption></figure><p>In the Facebook Comments dataset, the content has more variations for both <em>hate speech</em> and <em>no hate speech </em>categories. In the first one, among the most frequent words appear terms with negative connotations such as “feminazi” and “pinche”. Whereas in the second one, among the most frequent words appear terms related to gender equality discussions such as “igualdad” and “derecho”.</p><p>The following word clouds show the most frequent words of the Facebook Comments dataset in both <em>hate speech</em> and <em>no hate speech </em>categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4R7xjyfEFQcOjzeULJoDZg.png" /><figcaption><strong>Figure 9. Word Clouds Showing the Most Frequent Words of the Facebook Comments Dataset</strong></figcaption></figure><h4>Experiments</h4><p>In order to develop an effective method to automatically detect online gender-based hate speech in Mexican Spanish, we executed the following experiments:</p><ul><li>Creation of base models to see which presented the best performance and improve it. We used Logistic Regression, Naive Bayes, and Random Forest as base models. The following table shows the score results we got with this experiment:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qTPXeTkO7GZCx8Vl" /><figcaption><strong>Table 2. Results Experimenting with Different Algorithms</strong></figcaption></figure><ul><li>Model training using Random Forest with n-grams ranging from 1 to 3. The following table shows the score results we got with this experiment:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UfNhdemg8VkvmA0c" /><figcaption><strong>Table 3. Results Experimenting with N-Grams</strong></figcaption></figure><ul><li>Model training using Random Forest with additional features: Length_Text, Number_Words_Text, and Number_Unique_Words. The following table shows the score results we got with this experiment:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c8lPu9oVqpk_ESSW" /><figcaption><strong>Table 4. Results Experimenting with Additional Features</strong></figcaption></figure><ul><li>Use of the RandomizedSearchCV technique to find the best parameters in Random Forest, using n-grams and the additional features. The following table shows the score results we got with this experiment:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWWn8QzVTyrpnAdWswduuQ.png" /><figcaption><strong>Table 5. Results Experimenting with Additional Features and Best Parameters</strong></figcaption></figure><h4>Results</h4><p>With all the experiments, the best result we got was 0.83 of F1 Score, Precision, and Recall. The model with the best score has the following characteristics:</p><ul><li><strong>Algorithm:</strong> Random Forest</li><li><strong>Preprocessing technique: </strong>Bag of words</li><li><strong>New features: </strong>Length_Text, Number_Words_Text, and Number_Unique_Words</li><li><strong>Parameters tuning:</strong> According to the best parameters that RandomizedSearchCV found</li></ul><h4>Prototype of a Web Application</h4><p>Besides, we developed a prototype of a web application with the model that showed the best results. We used the Streamlit framework to develop the web application and GitHub Actions to deploy it (with continuous integration) on Heroku.</p><p>In this app, any user can enter a piece of text, then the algorithm analyzes if the text contains general hate speech and hate speech against women, and it provides an output to the user with the following categories:</p><ul><li>2 = Contains hate speech against women</li><li>1 = Contains general hate speech</li><li>0 = Does not contain any type of hate speech</li></ul><p>The following image shows a screenshot of the application prototype:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/0*u1CvACE9NopkOYD4" /><figcaption><strong>Figure 10. Web Application Prototype of the Violentómetro Online</strong></figcaption></figure><p><strong>NOTE: </strong>To see the web application prototype, visit <a href="https://violentometro-online.herokuapp.com/">https://violentometro-online.herokuapp.com/</a>.</p><h3>Conclusion and Discussion</h3><p>Our main goal was to develop an effective method to automatically detect online gender-based hate speech in Mexican Spanish. With this project, we were able to develop a method of detection by using Natural Language Processing techniques and by experimenting with Machine Learning models for classification. Besides, we were able to deploy our best model in a web application. However, we still need to validate the effectiveness of both, the model and the web application.</p><p>At this point, we only used open-source tools to develop our solution. We have some extra experiments pending, these require more computing capacity but might improve the performance of our model.</p><p>Also, there are open possibilities to test this solution with other Spanish variations different from Mexican.</p><p>For future work, it is possible to escalate our solution and to add more features to it, given the code quality and its organization. We have set as future steps to move from bag-of-words to more advanced techniques such as Deep Learning.</p><p>In addition, the model can be hosted independently to take advantage of the storage capacity. With extra storage, we would like to gather feedback from the users to improve our model and application.</p><p>Finally, we decided to approach the topic of gender-based violence with Natural Language Processing because we believe that the discipline of Data Science has the capacity to be a detonator of great solutions for social problems. We are convinced that detection is the first step to prevent any type of violence.</p><p>To see the code, experiments, and results of this project, visit this GitHub repository: <a href="https://github.com/violentometro-online-team/violentometro-online">violentometro-online</a>.</p><h3>Don’t forget to give us your 👏 !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*2lvCls4yjxVMfZSR" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F8f5f8b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F8f5f8b&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/c43026df6fee7cdb1aab8aaf916125ea/href">https://medium.com/media/c43026df6fee7cdb1aab8aaf916125ea/href</a></iframe><figure><a href="https://becominghuman.ai/artificial-intelligence-communities-c305f28e674c"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*2f7OqE2AJK1KSrhkmD9ZMw.png" /></a></figure><figure><a href="https://upscri.be/8f5f8b"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*v-PpfkSWHbvlWWamSVHHWg.png" /></a></figure><figure><a href="https://becominghuman.ai/write-for-us-48270209de63"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*Wt2auqISiEAOZxJ-I7brDQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdbba6ec2f8b" width="1" height="1" alt=""><hr><p><a href="https://becominghuman.ai/detecting-gender-based-hate-speech-in-spanish-with-natural-language-processing-cdbba6ec2f8b">Detecting gender-based hate speech in Spanish with Natural Language Processing</a> was originally published in <a href="https://becominghuman.ai/">Becoming Human: Artificial Intelligence Magazine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Decoupled Architecture to Optimize our Mobile Apps]]></title>
            <link>https://medium.com/walmartglobaltech/building-a-decoupled-architecture-to-optimize-our-mobile-apps-7bc4a0d6da37?source=rss-3bd33dc6411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bc4a0d6da37</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Alejandra Pedroza Marchena]]></dc:creator>
            <pubDate>Sat, 29 Aug 2020 03:36:32 GMT</pubDate>
            <atom:updated>2020-08-29T03:36:32.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*Nl5mXezrlXhTMZL4K8CpDQ.jpeg" /><figcaption><strong>Figure 1. High-Level Diagram of the Decoupled Architecture</strong></figcaption></figure><p>How did we optimize the mobile apps for the <strong>Walmart Mexico</strong> market?</p><p>In this article, we explain the engineering we applied to standardize and decouple the architecture of these four Walmart Mexico apps:</p><ul><li><strong>Walmart Groceries</strong></li><li><strong>Walmart Plus</strong></li><li><strong>Superama</strong></li><li><strong>Bodega Aurrera</strong></li></ul><p>To execute this <strong>re-architecture project</strong>, the Walmart Mexico E-commerce department put together the multidisciplinary Core Mobile team, responsible for designing and testing the new implementations. Then, the rest of the mobile teams were able to replicate the solutions.</p><p>In the beginning, the main goal was the re-architecture, but it evolved to cover other <strong>transformations such as CI/CD, test automation, repository strategy</strong>, among others.</p><h3><strong>What Was the Cost of Having a Legacy Architecture?</strong></h3><p>Given that the different mobile apps share similar user flows, features, and use cases, the project aimed to b<strong>uild a common base for the architecture</strong>, the code pieces, and the pipeline of all the apps. This was to avoid different teams redoing the same work as with the legacy architecture.</p><p>Before, the developers were <strong>redoing 95%-similar pieces </strong>of the frontend for the iOS and Android apps. It was practically eight teams working on eight different apps but solving the same problem.</p><p>Some <strong>pain points </strong>we experienced with the legacy architecture are:</p><ul><li>Hardness to reuse code</li><li>Difficulties in scaling apps</li><li>Complex control of code dependencies</li><li>Low quality and inconsistency of the codebase</li><li>Incomprehension of the codebase</li><li>Static teams</li></ul><h3><strong>How Did the Legacy Architecture Work?</strong></h3><p>The <strong>legacy architecture </strong>supported many different versions for iOS and Android mobile apps. For iOS, for example, we had three architectures supporting the four apps. Whereas for Android, we had one architecture.</p><p>One of the legacy architecture’s pain points was that some of its<strong> layers were built together</strong>, which made it hard to reuse the pieces of code as stand-alone modules across the apps.</p><p>The following diagram is an example of one of the architecture versions we had. It shows how the layers interacted in the Walmart Plus app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*zK5spveVKwbu5NX3XZBdlQ.png" /><figcaption><strong>Figure 2. Diagram of the Legacy Architecture</strong></figcaption></figure><p>The previous diagram shows how the four layers existed together and were <strong>dependent on each other</strong>. The rest of the versions of the legacy architecture had similar implementations and shared the same difficulties.</p><h3><strong>How Did We Build the New Decoupled Architecture?</strong></h3><p>The Core Mobile team had the main goal of re-architecting the four mobile apps launched by Walmart Mexico. The mission was to <strong>develop a common architecture</strong> for all the iOS apps, as well as a common architecture for all the Android apps.</p><p>Under this new model, the apps share the same iOS or Android architecture. However, they are still different from each other because <strong>they have their own implementation</strong> of the components within the layers. This is possible given that the new architecture is <strong>decoupled and divided into modules</strong>. For this reason, the same components and layers present a different implementation, according to the module they belong to.</p><p>In this project, we call the modules <strong>Contexts</strong>. They set the limit of a <strong>specific part of Walmart’s business</strong> and, at the same time, they contain all the architectural components necessary to execute one functionality of the apps.</p><p>The functionality relates to the part of the business that the Context delimits itself. <strong>Checkout</strong> and <strong>Sign In</strong> are examples of Contexts within the mobile apps. In these cases, the Use Case layer, which is common across the apps, might present a different implementation if the Context is <strong>Checkout</strong> or <strong>Sign In</strong>.</p><p>The following diagram illustrates how the modules, layers, and components interact in the decoupled architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*Qsh1NaQdNqWXR72mkhafww.jpeg" /><figcaption><strong>Figure 3. Diagram of the Decoupled Architecture</strong></figcaption></figure><p>From the previous diagram, you can see that Contexts contain Subcontexts, each belonging to a specific app. The Subcontext contains the different layers of Presentation, Business Logic, and APIs that interact to make up the functionality of the Context they belong to.</p><p>There might be cases where the Subcontext is optional because the business logic and the API gateway are the same across all the apps. In these cases, the entire module can be reused.</p><h3><strong>How Did We Leverage DDD, Clean Code, and MVVM?</strong></h3><p>To achieve a standardized and decoupled architecture, we followed these guidelines of software development:</p><ul><li><a href="https://dddcommunity.org/learning-ddd/what_is_ddd/"><strong>Domain-Driven Design (DDD)</strong></a><strong>:</strong> Proposes that the core of the architecture must be the Domain Layer, including all the business logic. In the Walmart apps, Contexts are the core of the modularization, which relate to Walmart’s business activities.</li><li><a href="https://www.tutorialspoint.com/mvvm/mvvm_introduction.htm"><strong>Model, View, ViewModel (MVVM):</strong></a> Proposes that the user interface (UI) must be separated from the business logic.</li><li><a href="https://confluence.walmart.com/display/MXGECMEX/Concepts+Guide+%7C+MX+Mobile+Apps#ConceptsGuide%7CMXMobileApps-clean"><strong>Clean Architecture Model</strong></a>: Proposes that the software must be separated in layers, following the rule of dependencies pointing inwards.</li></ul><p>The following illustration shows the Dependency Rule in the Clean Architecture Model. To see this image from its original source, visit <a href="https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html">The Clean Code Blog</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*78XfUDVUF6A477LH" /><figcaption><strong>Figure 4. Illustration of the Clean Architecture Model. Source: The </strong><a href="https://blog.cleancoder.com/"><strong>Clean Code Blog</strong></a></figcaption></figure><h3><strong>What Is the Impact of the New Architecture?</strong></h3><p>After implementing the new decoupled architecture, we have identified not only technical benefits in the apps but also cultural benefits in the teams.</p><p>Some of the <strong>technical benefits</strong> of implementing the decoupled architecture are:</p><ul><li>Developing faster and more reliable code.</li><li>Reusing code through modules (when applicable).</li><li>Scaling apps easily.</li><li>Controlling dependencies at a fine-grained level.</li><li>Improving the ownership and the quality of the codebase.</li></ul><p>Whereas some of the <strong>cultural benefits</strong> of implementing the decoupled architecture are:</p><ul><li>Working interchangeably across teams.</li><li>Reducing time and resources by avoiding replicated work.</li><li>Empowering better-focused teams.</li></ul><h3>What Challenges Have We Faced?</h3><p>In the path of implementing all the changes that come along with the new architecture, we have faced some challenges such as:</p><ul><li><strong>Lack of full-time developers</strong>: As we work on the re-architecture, we are also attending the business and working on the requirements from the mobile apps that are already in the market.</li><li><strong>Learning Curve: </strong>Implementing the new architecture, the new software development models, and the rest of transformations have required an extra effort from the developers to acquire the knowledge.</li><li><strong>Adding Sam’s on-board:</strong> The Sam’s mobile app is still working with the legacy code. We will include it in the new architecture in future phases.</li></ul><h3><strong>What Other Transformations Did We Have?</strong></h3><p>The impact of the new architecture also reflects in other transformations that the Walmart Mexico mobile team was able to execute, for example:</p><ul><li><strong>Implementation of Walmart One: </strong>We developed a single frontend for both Walmart Groceries and Walmart Plus backends.</li><li><strong>Implementation of CI/CD: </strong>We set-up the CI/CD pipeline for the apps leveraging Looper, the server developed on top of Jenkins by the Walmart Labs team.</li><li><strong>Implementation of QA Automation: </strong>We put together a team to transform our Quality Assurance (QA) effort by building an automated testing strategy.</li><li><strong>Implementation of monorepo: </strong>We changed our repository strategy from multirepo to monorepo, in order to get an easier workflow for all teams.</li><li><strong>Implementation of trunk-based development: </strong>We transformed our version-control branching model to improve collaboration, versioning, and delivery.</li><li><strong>Implementation of full-documentation: </strong>We started the practice of documenting each transformation, which made it easier to replicate.</li></ul><p><em>This text was written by Alejandra Pedroza on behalf of Migcenel González, Miguel Pahua, Alan Cruz, Abdiel Soto, Daniel Reyes, Juan Pablo Villa, and the Core Mobile Team.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bc4a0d6da37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/walmartglobaltech/building-a-decoupled-architecture-to-optimize-our-mobile-apps-7bc4a0d6da37">Building a Decoupled Architecture to Optimize our Mobile Apps</a> was originally published in <a href="https://medium.com/walmartglobaltech">Walmart Global Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning y Zonas Seguras para Ciclistas (Parte 2)]]></title>
            <link>https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-2-c79a2801a92f?source=rss-3bd33dc6411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c79a2801a92f</guid>
            <category><![CDATA[ciencia-de-dados]]></category>
            <category><![CDATA[inteligencia-artificial]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Alejandra Pedroza Marchena]]></dc:creator>
            <pubDate>Sat, 11 Jul 2020 04:28:14 GMT</pubDate>
            <atom:updated>2020-07-11T13:25:16.099Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XnFmbolkmShOBM_d" /><figcaption>Foto: Facebook de MiBici</figcaption></figure><p><em>Para ver la primera parte de este artículo, en la que explicamos nuestro problema y cómo estimamos el impacto de la delincuencia en el uso del sistema MiBici, da clic </em><a href="https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-1-5b5737402bb9"><em>aquí</em></a><em>.</em></p><h3>Introducción</h3><p>¿Se puede pronosticar si los usuarios del sistema de bicicletas públicas MiBici pudieran ser víctimas de algún delito?</p><p>Esta pregunta nos motivó a continuar con la segunda parte de nuestro proyecto <em>Crime Analysis for Bikers</em> dentro del programa <a href="https://www.saturdays.ai/"><strong>Saturdays.IA</strong></a> Guadalajara, el cual se propone hacer que la <strong>Inteligencia Artificial</strong> sea de fácil acceso.</p><p>Previamente, en la primera parte de nuestro proyecto nos dimos a la tarea de ver el impacto que tiene la incidencia delictiva en el uso del sistema MiBici, según las zonas donde ocurren los delitos y, al mismo tiempo, se localizan las estaciones de bicicletas públicas dentro del Área Metropolitana de Guadalajara, en México.</p><p>Todo el proyecto y el contenido de los dos artículos ha sido posible gracias a la colaboración de nuestro equipo multidisciplinario conformado por:</p><ul><li><a href="https://medium.com/@erflogo"><strong>Eric Flores</strong></a>, Data Scientist</li><li><a href="https://medium.com/@alejandra.pedroza"><strong>Alejandra Pedroza</strong></a>, Periodista</li><li><a href="https://medium.com/@ivanovishado"><strong>Iván Galaviz</strong></a>, Software Engineer</li><li><a href="https://medium.com/@rogelioservin"><strong>Rogelio Servín</strong></a>, Fullstack Engineer</li><li><a href="https://medium.com/@hhugoac"><strong>Hugo Alonzo</strong></a>, Android Developer</li><li><a href="https://medium.com/@mdmorales"><strong>Mentor: Dr. Manuel David Morales</strong></a>, Astrofísico</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nDjX5UeLp9jUxbPo" /></figure><h3><strong>Modelado con Machine Learning</strong></h3><h4><strong>¿Qué buscamos?</strong></h4><p>Con modelado a través de técnicas de Machine Learning, nuestro propósito fue pronosticar si un usuario de MiBici puede estar expuesto a un delito en específico dependiendo de la estación en la que se encuentre.</p><h4><strong>¿Cómo lo hicimos?</strong></h4><p>Inicialmente, para nuestro pronóstico tomamos en cuenta la frecuencia y localización de los siguientes delitos, los cuales se seleccionaron por considerarse como posibles delitos que pudieran afectar a usuarios de MiBici:</p><ul><li>Lesiones dolosas</li><li>Robo en motocicleta</li><li>Robo a cuentahabientes</li><li>Homicidio doloso</li><li>Robo a negocio</li><li>Feminicidio</li></ul><p>Tanto el tipo de delito, como su ocurrencia y localización, son variables que forman parte del dataset de Incidencia Delictiva. Recordar que este dataset previamente lo utilizamos para estimar el impacto de la delincuencia en el uso de MiBici. En esta segunda parte utilizamos para entrenar y probar nuestro modelo predictivo.</p><p>De este modo, el tamaño de nuestro dataset fue de 16 mil 825 registros, como se desglosa, por tipo de delito, en la Figura 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/0*o-3rJOidTI28BO__" /><figcaption>Figura 1. Tamaño del dataset de entrenamiento.</figcaption></figure><p>Posteriormente, escogimos como modelo de clasificación multiclase un algoritmo de <a href="https://towardsdatascience.com/decision-trees-in-machine-learning-641b9c4e8052">Decision Trees</a> (Árboles de Decisión). Para el algoritmo, los datos de entrada fueron:</p><ul><li>Año de ocurrencia de cada delito</li><li>Mes de ocurrencia de cada delito</li><li>Latitud donde ocurrió cada delito</li><li>Longitud donde ocurrió cada delito</li></ul><p>Ver Figura 2 para mayores detalles respecto de las variables de entrada del modelo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*uHQcZNGIddfVkA3G" /><figcaption>Figura 2. Datos de entrada para la clasificación multiclase con el algoritmo de Decision Trees.</figcaption></figure><p>A esos datos se les aplicó un escalamiento <a href="https://towardsdatascience.com/everything-you-need-to-know-about-min-max-normalization-in-python-b79592732b79">Max-Min Scaler</a> dado que había mucha diferencia entre los valores de las variables.</p><p>La salida de nuestro modelo no es probabilística, sino estrictamente binaria. Por lo tanto, como datos de salida definimos, por cada delito, el resultado de 1, si puede ocurrir dicho delito; y el resultado de 0, si pueden ocurrir otro tipo de delitos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/0*X2UedOrQsFQ98u-q" /><figcaption>Figura 3. Variables de salida para la clasificación multiclase con el algoritmo de Decision Trees.</figcaption></figure><h4><strong>¿Qué obtuvimos?</strong></h4><p>El primer experimento se trató de entrenar al modelo incluyendo registros de todos los delitos, considerando el total de 16 mil 825 registros.</p><p>La manera en que validamos el modelo fue utilizando la técnica de <a href="https://towardsdatascience.com/why-and-how-to-cross-validate-a-model-d6424b45261f"><em>cross-validation</em></a> con cinco <em>folds</em>. Debido a que en este primer experimento la cantidad de ejemplos por cada clase no estaban balanceadas, usamos las siguientes <a href="https://towardsdatascience.com/metrics-to-evaluate-your-machine-learning-algorithm-f10ba6e38234">métricas de evaluación:</a></p><ul><li>Precisión</li><li>R<em>ecall</em></li><li>Puntaje F1</li></ul><p>Los tamaños del dataset de entrenamiento utilizado en las pruebas (con respecto al número total de ejemplos) fueron de 75%, 80% y 90%.</p><p>En este primer experimento, los resultados no fueron lo que esperábamos dado que los valores promedios más áltos que obtuvimos en las métricas de evaluación fueron:</p><ul><li>Precisión: 0.35</li><li>Recall: 0.24</li><li>Puntaje F1: 0.29</li></ul><p>Estos resultados tan bajos, cómo se muestran algunos más en la Figura 4, se deben a que hay un gran desbalance entre el número de datos de entrada, por cada clase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/0*7rdmmSgqzdta9sJX" /><figcaption>Figura 4. Métricas de rendimiento para el modelo entrenado con seis clases de salida. Solo para efectos ilustrativos, se muestran dos clases</figcaption></figure><p>Para mejorar las métricas, el enfoque que tomamos en este proyecto fue disminuir el número de clases (es decir, los tipos de delitos) para el entrenamiento del modelo.</p><p>Intentamos con cinco, cuatro, tres y dos delitos. Siempre tratábamos de utilizar los delitos con número de registros razonablemente semejante. Encontramos los mejores resultados con registros de dos delitos: Homicidio Doloso y Robo a Cuentahabientes.</p><p>Con estos datos, obtuvimos un valor máximo de precisión de 0.69. Los valores promedio máximos fueron:</p><ul><li>Precisión: 0.66</li><li>Recall: 0.63</li><li>Puntaje F1: 0.64</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*1CCe6yp9Hkke1aCP" /><figcaption>Figura 5. Métricas de rendimiento para el modelo entrenado con dos clases de salida. Aquí se muestra la clase “y_homicidioDoloso”.</figcaption></figure><h3><strong>Visualización</strong></h3><h4><strong>¿Qué buscamos?</strong></h4><p>Para la visualización de los resultados de nuestro modelo decidimos construir un sitio habilitado para consultas interactivas. De esta manera, las autoridades a quienes va dirigido nuestro proyecto podrán consultar:</p><ul><li>Un mapa con la localización de las estaciones de MiBici y su afluencia.</li><li>Un mapa con el pronóstico de que ocurra un delito en específico, de acuerdo a la zona donde se localizan las estaciones de MiBici.</li></ul><h4><strong>¿Cómo lo hicimos?</strong></h4><p>Para la construcción de nuestro sitio, utilizamos <a href="https://www.streamlit.io/">Streamlit</a><strong> </strong>y <a href="https://pydeck.gl/">pydeck</a>, principalmente. Streamlit es una librería que facilita la construcción de páginas web por medio de Python, dado que la librería se encarga totalmente de la interfaz de usuario y permite que los programadores se enfoquen en el procesamiento de la información que quieren mostrar.</p><p>Por otro lado, pydeck se encarga de entregarnos mapas altamente personalizables con tan solo especificar las coordenadas y el volumen de nuestros datos.</p><p>El objetivo del sitio es mostrar dos visualizaciones:</p><ul><li>La primera consistente en un mapa en el que cada estación, localizada de acuerdo a su longitud y latitud, muestre su actividad para un cierto año y mes seleccionados por el usuario de antemano. Aquí requerimos, de cada ejemplo, únicamente los atributos de entrada del modelo predictivo: longitud de la estación, latitud de la estación, mes y año.</li><li>La segunda consistente en el mismo mapa anterior, pero que ahora se indique los pronósticos del modelo. En concreto, mostrar aquellas estaciones en donde puede ocurrir un determinado delito dado el año y mes ingresado previamente por el usuario. Aquí requerimos, para cada ejemplo, tanto los atributos de entrada como su respectiva variable categórica objetivo.</li></ul><h4><strong>¿Qué obtuvimos?</strong></h4><p>El resultado de este esfuerzo es un sitio interactivo en el que el usuario puede consultar dos visualizaciones distintas.</p><p>En la primera sección del sitio, el usuario puede seleccionar el año (2018 y 2019) y el mes de su preferencia para consultar la actividad de las estaciones de MiBici. Ver Figura 6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r96ebvnfrnG_L-7x" /><figcaption>Figura 6. Sección de consultas del sitio Crime Analysis for Bikers.</figcaption></figure><p>Es importante aclarar que, de los viajes que tenemos registro, cada vez que el usuario modifica el año o mes, se toma una muestra de ocho millones al azar para hacer las visualizaciones. Esto porque, al día de hoy, Streamlit tiene limitaciones para procesar cantidades muy grandes de datos.</p><p>En la siguiente sección del sitio, se visualiza un mapa con la actividad de las estaciones de MiBici de acuerdo al mes y al año seleccionados en la primera sección. Cada estación se localiza de acuerdo a su latitud y longitud. Y la altura y el color de las barras representan el número de viajes que se realizó en cada estación.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cqKkg3DgHIn14chI" /><figcaption>Figura 7. Visualización de actividad de MiBici en el sitio Crime Analysis for Bikers.</figcaption></figure><p>En la tercera sección del sitio, el usuario puede seleccionar un tipo de crimen (robo a cuentahabientes u homicidio doloso) para visualizar un mapa con el pronóstico de las estaciones de MiBici donde pueden ocurrir estos delitos. Ver Figura 8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GzX5sBR53SkHA6gv" /><figcaption>Figura 8. Visualización de pronóstico de delitos en las estaciones de MiBici, en el sitio Crime Analysis for Bikers.</figcaption></figure><p>Actualmente, se está trabajando en diversas optimizaciones para la aplicación, con la intención de poder montarla en la nube. Entre ellas, tratamos de reducir la memoria utilizada y el manejo de la cantidad de clases predecidas. Este último parámetro es sumamente sencillo de adaptar a más clases que el modelo pudiera generar, pero en última instancia se desearía que se pudiera inferir a partir de las columnas que se encuentran en el dataset, para evitar cambios en el código.</p><p>En <a href="https://github.com/saturdaysai-gdl2-plata/datasets/tree/master/app">nuestro repositorio</a> es posible encontrar el código fuente de la aplicación, junto con los datasets mencionados e instrucciones para ejecutarla de forma local.</p><h3><strong>Aprendizajes</strong></h3><p>De esta experiencia en Saturdays.AI, los aprendizajes más significativos para nosotros fueron:</p><ul><li>El trabajo iterativo es útil para regresar a fases anteriores cada que se necesite.</li><li>La obtención, limpieza y preprocesamiento de datos implica mucho esfuerzo y es la base para la calidad de nuestro análisis y modelo.</li><li>Un equipo multidisciplinario se enriquece de las distintas perspectivas que los compañeros tienen para abordar el mismo problema.</li><li>Para trabajos futuros, se puede explorar un análisis que considere tanto las variables de tiempo como las variables de espacio en conjunto.</li><li>Se puede incluir fecha, hora en el set de delitos para mejora del modelo.</li></ul><p><em>Para ver la primera parte de este artículo, en la que explicamos nuestro problema y cómo estimamos el impacto de la delincuencia en el uso del sistema MiBici, da clic </em><a href="https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-1-5b5737402bb9"><em>aquí</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c79a2801a92f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-2-c79a2801a92f">Machine Learning y Zonas Seguras para Ciclistas (Parte 2)</a> was originally published in <a href="https://medium.com/saturdays-ai">Saturdays.AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning y Zonas Seguras para Ciclistas (Parte 1)]]></title>
            <link>https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-1-5b5737402bb9?source=rss-3bd33dc6411e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b5737402bb9</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[guadalajara]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Alejandra Pedroza Marchena]]></dc:creator>
            <pubDate>Thu, 02 Jul 2020 01:50:18 GMT</pubDate>
            <atom:updated>2020-07-13T17:45:01.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aDev-VXZnB2qwugl" /></figure><h3>Introducción</h3><p>¿Cómo se pueden aprovechar los datos públicos para la seguridad de ciclistas?</p><p>En este artículo describimos el proyecto de ciencia de datos que hicimos para estimar el impacto de la incidencia delictiva en los usuarios del sistema <strong>MiBici </strong>en la <strong>Zona Metropolitana de Guadalajara</strong> (ZMG), México, así como para pronosticar zonas seguras para los ciudadanos que utilizan este medio de transporte público.</p><p>Este proyecto lo hicimos como parte del programa <a href="https://www.saturdays.ai/"><strong>Saturdays.IA</strong></a>, en la sede de Guadalajara, México. Saturdays.AI es una organización sin fines de lucro enfocada en hacer que la <strong>Inteligencia Artificial</strong> sea de fácil acceso y capacitar a los participantes bajo un esquema colaborativo y basado en proyectos aplicados.</p><p>En nuestro equipo, uno de los aspectos que más nos motivó fue el nivel de cooperación que logramos gracias a la diversidad de perfiles. Al ser un equipo <strong>multidisciplinario</strong>, hemos tenido la oportunidad de apoyarnos mutuamente, complementarnos y cubrir diversas habilidades. El equipo se compone por:</p><ul><li><a href="https://medium.com/@erflogo"><strong>Eric Flores</strong></a>, Data Scientist</li><li><a href="https://medium.com/@alejandra.pedroza"><strong>Alejandra Pedroza</strong></a>, Periodista</li><li><a href="https://medium.com/@ivanovishado"><strong>Iván Galaviz</strong></a>, Software Engineer</li><li><a href="https://medium.com/@rogelioservin"><strong>Rogelio Servín</strong></a>, Fullstack Engineer</li><li><a href="https://medium.com/@hhugoac"><strong>Hugo Alonzo</strong></a>, Android Developer</li><li><a href="https://medium.com/@mdmorales"><strong>Mentor: Dr. Manuel David Morales</strong></a>, Astrofísico</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ODpoA4x5y4eHNOon" /></figure><p>Agradecemos la oportunidad para desarrollar este proyecto que aborda una problemática muy relevante para la ciudad Guadalajara en estos días. Por lo demás, consideramos que las técnicas de <strong>Machine Learning</strong> tienen que mucho que aportar en la toma de decisiones gubernamentales en torno a cuestiones tan delicadas como lo es la seguridad ciudadana.</p><h3>Contexto</h3><h4><strong>Uso de bicicletas en la ZMG</strong></h4><p>La bicicleta se ha posicionado como uno de los medios de transporte cuyo uso aumenta cada año en la ZMG. Además, los ciudadanos la prefieren por encima de otros medios de transporte, según la <a href="http://www.jaliscocomovamos.org/encuesta2018">Sexta Encuesta de Percepción Ciudadana sobre Calidad de Vida 2018</a>, realizada por el Observatorio “Jalisco Cómo Vamos”. De acuerdo con este estudio, los habitantes de la ZMG utilizan la bicicleta más que el taxi o Uber y que el Tren Ligero, como lo muestra la Figura 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r_rokRiKc3CJ_H4k" /><figcaption><strong>Figura 1. Medios de transporte utilizados en la ZMG anualmente (en porcentaje). Fuente: Jalisco Cómo Vamos.</strong></figcaption></figure><p>La ZMG cuenta con el sistema de bicicletas públicas <a href="https://www.mibici.net/es/">MiBici</a>, que pone a disposición de las personas bicicletas para rentas anuales y temporales. Los usuarios pueden tomar y dejar bicicletas en las estaciones habilitadas para ello, las cuales se encuentran en los municipios de Guadalajara, Zapopan y Tlaquepaque.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvd4U1k5kY04%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dvd4U1k5kY04&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fvd4U1k5kY04%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4dfc6a54f26a25a4692ff57f01d722b2/href">https://medium.com/media/4dfc6a54f26a25a4692ff57f01d722b2/href</a></iframe><p>El uso del sistema MiBici también muestra una tendencia general a la alza, desde su creación en 2015 (excepto los meses de confinamiento por el COVID-19). En ese año, los viajes diarios fueron poco más de mil en promedio. Mientras que durante 2019, el promedio de <strong>viajes por día</strong> fue de <strong>12 mil 730</strong>, de acuerdo con datos del reporte “<a href="https://iieg.gob.mx/ns/wp-content/uploads/2020/03/MiBici2020_din%C3%A1mico.html">Uso del medio de transporte MiBici enero a diciembre de 2019</a>”, realizado por el Instituto de Información Estadística y Geográfica de Jalisco (IIEG). Ver Figura 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4p4xZZcZ4WRX0HHR" /><figcaption><strong>Figura 2. Uso del Sistema MiBici. El eje horizontal describe el tiempo (en meses y años) y el eje vertical la cantidad de viajes realizados. Fuente: IEEG.</strong></figcaption></figure><h4>Incidencia delictiva en la ZMG</h4><p>Por otro lado, la incidencia delictiva es un fenómeno recurrente que afecta los habitantes de la ZMG. Tan solo en 2019, se registraron <strong>156 mil 653 carpetas de investigación</strong> en el estado de Jalisco. Esto quiere decir que los ciudadanos denunciaron aproximadamente 429 delitos diarios en promedio, de acuerdo al reporte de <a href="https://iieg.gob.mx/ns/wp-content/uploads/2020/02/Reporte-Anual-UGSyJ-2019_Definitivo.pdf">Reporte Anual Información de Seguridad 2019</a>, publicado por el IIEG. Del total de delitos, el 10% de las denuncias corresponde a robo a persona, y la tasa delictiva alcanza los 183.63 robos por cada 100 mil habitantes. Respecto a la localización geográfica de los delitos, <strong>en la ZMG se concentró el 78.6%</strong> de las carpetas de investigación abiertas en Jalisco durante el 2019.</p><p>Para todo el estado de Jalisco, y tal como se muestra en la Figura 3, el que haya o no violencia en un robo depende del subtipo de este último. Aun así, es importante advertir que aquellos robos que pudieran afectar a usuarios de MiBici, como lo son <strong>el robo a persona y a negocio</strong>, se realizan mayoritariamente con violencia.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lsYzBoGq_G1r863f" /><figcaption><strong>Figura 3. Carpetas por robos en Jalisco, clasificados por subtipo y modalidad. Fuente: IEEG.</strong></figcaption></figure><p><strong>NOTA: </strong>Las cifras antes mencionadas están basadas en carpetas de investigación abiertas por delitos denunciados. Considérese que, hasta el 2018, el promedio de los <a href="https://www.eleconomista.com.mx/politica/Delitos-no-denunciados-siguen-en-93-20190925-0010.html">delitos que no se denunciaron en México alcanzaron el 93% del total cometidos.</a></p><h3>Problema y antecedentes</h3><p>Actualmente, no existe una forma para determinar cuáles zonas de las que cubre el sistema Mibici son más <strong>seguras para los ciudadanos</strong> que utilizan dicho medio de transporte. De acuerdo a la naturaleza y localización de los delitos, los usuarios tendrán necesidad de conocer estaciones de salida y/o llegada alternas para sus trayectos diarios.</p><p>Hasta la fecha se ha publicado, formalmente, solo <a href="https://www.kaliopeo.com/usuarias-mibici">un estudio</a> que relaciona violencia y el sistema MiBici. Este fue realizado por la agencia Kaliopeo en 2019. Recurrió a una metodología en base a encuesta de muestra aleatoria, no estadística, y se redujo solo a usuarias para así detectar violencia de género.</p><p>En este proyecto, nuestro enfoque es más general, dado que aparte de considerar todos los usuarios de MiBici, utilizamos el poder de Machine Learning para pronosticar (y no solo describir), la incidencia delictiva que les afecta. Por lo demás, contribuyendo al movimiento de <a href="https://es.wikipedia.org/wiki/Ciencia_abierta">ciencia abierta</a>, es que no solo nos limitaremos a entregar resultados, sino además liberar el código que implementamos en Python.</p><h3>Objetivos</h3><p>Dado el problema planteado, los objetivos de este proyecto son:</p><ol><li>Estimar la posible relación entre las zonas con incidencia delictiva y las estaciones que frecuentan los usuarios de MiBici.</li><li>Pronosticar si los usuarios de MiBici pueden ser víctimas de algún delito o no, de acuerdo a las estaciones que frecuentan.</li></ol><h3>Herramientas</h3><p>Las herramientas que se utilizaron para la obtención, preprocesamiento, análisis y modelado de los datos son:</p><ul><li><strong>Google Colab: </strong>Para desarrollar código de manera colaborativa desde el navegador.</li><li><strong>Github: </strong>Para controlar el versiones del código desarrollado de manera colaborativa.</li><li><strong>OneDrive: </strong>Para almacenar los datasets.</li><li><strong>Heroku: </strong>Para almacenar el mapa resultante.</li><li><strong>Google Maps:</strong> Consulta de las coordenadas y creación del mapa resultante, mediante API REST.</li><li><strong>Python3</strong>: Para desarrollo del código. Específicamente se utilizaron las siguientes librerías:</li></ul><p>&gt;Pandas</p><p>&gt;Seaborn</p><p>&gt;Gmplot</p><p>&gt;Matplotlib</p><p>&gt;Numpy</p><p>&gt;Scikit-Learn</p><p>&gt;Google Maps</p><h3>Datos</h3><p>Para la realización de este proyecto, se utilizaron los siguientes conjuntos de datos públicos:</p><ul><li><strong>Viajes de MiBici,</strong> dataset del Sistema MiBici.</li><li><strong>Incidencia Delictiva en Jalisco</strong>, dataset del Instituto de Información Estadística Geográfica de Jalisco (IIEG).</li></ul><p>Los datos de MiBici se obtuvieron del <a href="https://www.mibici.net/en/open-data/">sitio web</a> de dicho sistema. Se descargaron 24 conjuntos de datos con registros mensuales de los años 2018 y 2019 (se descartó 2020 al no ser un año completo). Estos conjuntos de datos están disponibles al público en formato csv y están compuestos por ocho columnas (características o atributos) y una primera columna con los índices de la fila, como se muestra en la Figura 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8xPUEDJYhPF-yffs" /><figcaption><strong>Figura 5. Muestra del Dataset de MiBici (los valores en las columnas con sufijo “_Id” representan etiquetas, y no son físicamente interpretables per se). Fuente: mibici.net.</strong></figcaption></figure><p>Con los datasets de 2018 y 2019, en total se obtuvieron <strong>8 millones 56 mil 499 registros de viajes </strong>que están distribuidos en las filas del datasets (antes del proceso de limpieza). Cada fila representa una muestra o ejemplo.</p><p>En el caso de incidencia delictiva, los datos se obtuvieron del sitio web del <a href="https://iieg.gob.mx/ns/?page_id=1958">IIEG</a>. Se descargó un archivo csv que incluía registros desde 2016, el cual se filtró para obtener los datos de los años 2018 y 2019 (se descartó 2020 al no ser un año completo). El dataset original está compuesto por nueve columnas (características o atributos) y una primera columna con los índices de la fila, como lo muestra la Figura 6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AUu0UFemkfbjw3F2" /><figcaption><strong>Figura 6. Muestra del Dataset de Incidencia Delictiva. Fuente: iieg.gob.mx.</strong></figcaption></figure><p>Con los datasets de 2018 y 2019, en total se obtuvieron <strong>98 mil 791 registros de delitos </strong>que están distribuidos en las filas del datasets (antes del proceso de limpieza) que son nuestras muestras.</p><h3>Preprocesamiento</h3><p>Con los datasets ya descargados, se procedió a su preprocesamiento con técnicas tanto de limpieza, como de ingeniería de características. Así entonces, las muestras quedarán listas para su análisis. El preprocesamiento incluyó las siguientes acciones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CLoAaWM-6rZR8Ldb4qI2EQ.png" /></figure><h3>Análisis</h3><p>Para este proyecto, el análisis de los datos se realizó en tres fases:</p><ul><li><strong>Análisis exploratorio: </strong>Con herramientas básicas de estadística, se exploró a grandes rasgos el contenido de los datos, tipos de distribuciones, etc.</li><li><strong>Análisis relacional: </strong>Se buscó estimar el impacto que tiene la ocurrencia de delitos en el uso del sistema MiBici. Es decir, determinar si al aumentar la cantidad de delitos en una zona, disminuye la cantidad de usuarios del sistema MiBici en dicha zona.</li><li><strong>Modelado: </strong>Con herramientas de Machine Learning, se buscó pronosticar la ocurrencia o no ocurrencia de un delito específico de acuerdo a las zonas que frecuentan usuarios de MiBici.</li></ul><p><strong>NOTA:</strong> Todas las gráficas que mostramos a partir de ahora, son de elaboración propia, a menos que se indique explícitamente lo contrario.</p><h3>Análisis exploratorio</h3><p>El análisis exploratorio del dataset de MiBici muestra que la tendencia del uso del servicio mantuvo una tendencia general a la alza de 2018 a 2019, como lo muestra la Figura 8. Existen algunos periodos donde la tendencia <strong>diagonal de incremento</strong> se rompe, los cuales coinciden con periodos vacacionales como semana santa y pascua, fin de año, y verano. Esta tendencia es consistente con el alza señalada en la gráfica de la Figura 2. Las estimaciones provienen de la cantidad de viajes que se iniciaron según el mes y año.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/0*HS9p0r0j5bgJTClE" /><figcaption><strong>Figura 8. Diagrama de dispersión de viajes de MiBici iniciados según mes y año.</strong></figcaption></figure><p>Respecto a las características de los usuarios de MiBici, la Figura 9 muestra que de los 39 mil 41 usuarios, <strong>más de 20 mil son del sexo masculino.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*rwvFkr-xp6Av9jwK" /><figcaption><strong>Figura 9. Cantidad de usuarios de MiBici según su sexo.</strong></figcaption></figure><p>Igualmente, se encontró que la mayoría de la población que utiliza el sistema de MiBici ronda los <strong>30 años</strong>, pues la mayor cantidad de usuarios nació alrededor de 1990, como lo muestra la Figura 10. De hecho, de esta figura se puede ver que la distribución tiene sesgo negativo (hacia la izquierda); lo cual indica que el servicio parece no tener mucha llegada a los sectores más jóvenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/0*AIu7-vffdzNX3owF" /><figcaption><strong>Figura 10. Cantidad de usuarios de MiBici según su año de nacimiento.</strong></figcaption></figure><p>Para el análisis exploratorio del dataset se Incidencia Delictiva, únicamente se conservaron los municipios de <strong>Guadalajara, Zapopan y Tlaquepaque</strong> dado que son las zonas de interés porque ahí están distribuidas las estaciones de MiBici.</p><p>De los tres municipios, Guadalajara es el que tiene la mayor incidencia delictiva registrada en 2018 y 2019 con <strong>más de 25 mil registros</strong> como muestra la Figura 11.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*GDoTgl1TE7htDkTj" /><figcaption><strong>Figura 11. Cantidad de delitos en municipios metropolitanos.</strong></figcaption></figure><p>Respecto a los delitos ocurridos en dichos municipios metropolitanos, los más frecuentes durante 2018 y 2019 fueron<strong> robo a vehículos, robo a negocio y robo a persona</strong>. Estos dos últimos llaman la atención porque son los que, potencialmente, pueden afectar a los usuarios del sistema MiBici. Ver Figura 12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*iIFdmKRs8U2Ln122" /><figcaption><strong>Figura 11. Cantidad de delitos en municipios metropolitanos.</strong></figcaption></figure><p>En la Figura 13 se muestran histogramas para desglosar la <strong>distribución</strong> de los diferentes tipos de delitos cometidos en cada municipio en los años 2018 y 2019.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/0*CCm-14JiKQFTToHY" /><figcaption><strong>Figura 13. Cantidad de delitos por tipo, año y municipio.</strong></figcaption></figure><h3>Análisis relacional</h3><p>El propósito de este análisis fue estimar el impacto que tiene la ocurrencia de delitos en el uso del sistema MiBici. Para ello, <strong>se vincularon los dos datasets</strong>, realizando una estimación aproximada de la <strong>ubicación geográfica</strong> de las estaciones de bicicletas para el dataset de MiBici, y la de los delitos, para el dataset de Incidencia Delictiva.</p><p>Sin embargo, la ubicación geográfica en ambos casos tenía variaciones en su formato. En el caso del dataset de incidencias delictivas, el registro venía por colonia donde han ocurrido delitos. Mientras que en el caso del dataset de MiBici, el registro venía por número de estación. Para poder encontrar una relación en ambos conjuntos de datos, se buscó un formato en común que fueron las<strong> latitudes y longitudes</strong> (para más detalles, ver sección de Preprocesamiento).</p><p>Para sacar la distancia entre una colonia y las estaciones de MiBici, iniciamos el cálculo desde el centro de la colonia y de ahí se exploran las <strong>distancias </strong><a href="https://www.genbeta.com/desarrollo/como-calcular-la-distancia-entre-dos-puntos-geograficos-en-c-formula-de-haversine"><strong>Harversine</strong></a><strong> que sean menores a 0.5 km</strong>.</p><p>La Figura 14 nos permite inferir visualmente, en una primera aproximación, cómo la <strong>incidencia delictiva pudiera impactar el uso de las estaciones</strong> de MiBici. Todos los círculos son coordenadas aproximadas en donde están ubicadas las estaciones de MiBici. Los círculos rojos indican, concretamente, las estaciones donde ha(n) ocurrido delito(s). El tamaño de los círculos varía de acuerdo a la cantidad de viajes que se registraron en dicha estación, es decir, a mayor uso de la estación, más grande se visualiza el círculo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/0*rfi8KzwYBw6NMg8W" /><figcaption><strong>Figura 14. Mapa de Estaciones de MiBici, representadas por círculos. Si en una estación hay incidencia delictiva, su círculo será de color rojo, de lo contrario, será de color azul. El tamaño de cada círculo es proporcional al número de viajes registrados en la estación</strong></figcaption></figure><p><strong>NOTA: </strong>Para ver el mapa completo, visita el <a href="https://mibiciapp.herokuapp.com/">sitio web del mapa</a></p><p>De la Figura 14 podemos ver que, si bien hay círculos rojos de mayor tamaño que varios círculos azules, los círculos rojos definitivamente no alcanzan tamaños tan grandes como sí ocurre con los círculos azules. Y esto último, de hecho, es particularmente notorio en las colonias más céntricas de Guadalajara, en donde la afluencia de personas y, por ende, <strong>la actividad en las estaciones de MiBici, es considerablemente mayor</strong> que en otras zonas.</p><p>Esta simple exploración visual, sin ser matemáticamente concluyente, nos sugiere que <strong>la incidencia delictiva pudiera impactar el uso de ciertas estaciones de MiBici</strong>. Por lo que, en las estaciones más céntricas y con incidencia delictiva (en rojo), sería recomendable que hubiera una mayor atención para efectos de monitoreo por parte de las autoridades de gobierno.</p><h3>Sobre el modelado</h3><p>Al momento que terminamos de escribir este primer artículo, estamos en fase de experimentación, probando distintos <strong>modelos de clasificación, multiclase. </strong>Nuestro objetivo es dilucidar cuál(es) de estos modelos mejor se ajusta(n) a nuestro propósito de <strong>pronosticar los delitos de los que pudieran ser víctimas los usuarios del sistema MiBici.</strong></p><p>Los modelos los estamos entrenando con el dataset de Incidencia Delictiva y probando con el dataset de MiBici, si bien no descartamos mezclarlos. Por lo demás, para el entrenamiento, tomamos en cuenta la frecuencia de ocurrencia y localización de los delitos tales como:</p><ul><li>Lesiones dolosas</li><li>Robo en motocicleta</li><li>Robo a cuentahabientes</li><li>Homicidio doloso</li><li>Robo a negocio</li><li>Feminicidio</li></ul><p>Para ver cómo realizamos esto y cuáles fueron los resultados predictivos, los invitamos a leer la segunda parte de nuestro artículo disponible <a href="https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-2-c79a2801a92f">aquí.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b5737402bb9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/saturdays-ai/machine-learning-y-zonas-seguras-para-ciclistas-parte-1-5b5737402bb9">Machine Learning y Zonas Seguras para Ciclistas (Parte 1)</a> was originally published in <a href="https://medium.com/saturdays-ai">Saturdays.AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>