<?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 Ryvn on Medium]]></title>
        <description><![CDATA[Stories by Ryvn on Medium]]></description>
        <link>https://medium.com/@ryvnollie?source=rss-439a7ec01e36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ZYL06cwjaOtnjJKW.</url>
            <title>Stories by Ryvn on Medium</title>
            <link>https://medium.com/@ryvnollie?source=rss-439a7ec01e36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 04:12:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryvnollie/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Brief History of Large Language Models]]></title>
            <link>https://medium.com/@ryvnollie/a-brief-history-of-large-language-models-91572d9fac91?source=rss-439a7ec01e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/91572d9fac91</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[history]]></category>
            <dc:creator><![CDATA[Ryvn]]></dc:creator>
            <pubDate>Sat, 30 Dec 2023 18:46:06 GMT</pubDate>
            <atom:updated>2023-12-30T18:46:06.039Z</atom:updated>
            <content:encoded><![CDATA[<h4>What Are the Milestones of Language Modeling?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkfuYLc7qxuLw5gBEeYnGA.jpeg" /><figcaption><a href="https://unsplash.com/@didiofederico_photographer">Federico Di Dio photography</a></figcaption></figure><p>In the ever-evolving narrative of artificial intelligence, language modeling (LM) has emerged as a pivotal chapter. It’s a quest not merely of technological advancement but of understanding and replicating the quintessentially human trait of language. LM aims to unravel the complex tapestry of human communication by modeling the probability of word sequences, a task as intricate as it is ambitious. This involves predicting the next words in a conversation or filling gaps in a text, akin to teaching machines the art of human intuition in language. The journey of LM is marked by four distinct developmental stages, each representing a leap in our quest to blend the computational precision of machines with the nuanced fluidity of human language. These stages are not just milestones in AI; they are reflections of our deeper understanding of language, cognition, and, ultimately, ourselves.</p><h3>Stage I: Statistical Language Models (1990s)</h3><p>In the 1990s, a new chapter in the story of artificial intelligence began with the advent of Statistical Language Models (SLMs). These models were like the early navigators of the sea, charting unknown territories with basic tools. The principle behind SLMs was straightforward: predict the next word by looking at the most recent ones, much like guessing the next note in a melody based on the previous notes. This approach, grounded in the Markov assumption, led to the creation of n-gram models, where ’n’ stands for the number of words considered in making the prediction.</p><p>These early SLMs, including bigram and trigram models, started to find their way into information retrieval and natural language processing, like fledgling birds attempting their first flight. However, their flight was not without turbulence. The models struggled with what is known as the ‘curse of dimensionality.’ In simpler terms, as they tried to learn from more complex sentences, the amount of information they needed to understand grew exponentially, overwhelming them. To help these early models cope, researchers developed techniques like back-off and Good–Turing estimation, akin to giving them a compass in the vast ocean of words.</p><p>This stage in the history of language models was more about setting sail than reaching new horizons. The models were limited, often struggling to grasp the full complexity of human language. Yet, it was a crucial first step, a testament to the human aspiration to create machines that could one day understand and communicate like us.</p><h3>Stage II: Neural Language Models (2000s)</h3><p>As we turn the page from Statistical Language Models, the early 2000s ushered in an era of Neural Language Models (NLMs), a leap as significant as the transition from sail to steam. These models didn’t just count words and their appearances; they began to understand language by using neural networks, the digital equivalent of human neural pathways.</p><p>NLMs - structures inspired by the human brain – use layers of neural networks (such as multi-layer perceptron and recurrent neural networks) to grasp the probability of word sequences. A groundbreaking moment came with the introduction of the concept of distributed representation of words. Imagine each word not just as a standalone entity but as a point in a vast space, connected to others by meaning and usage. This was a shift from simply predicting the next word to understanding the tapestry of language as a whole.</p><p>One of the milestones in this era was word2vec, a tool that simplified the complex neural networks into something more manageable yet incredibly effective. It was allowing machines to learn the nuances of words based on their context. This wasn’t just about predicting text; it was about teaching machines the essence of words and their relationships.</p><p>The arrival of NLMs marked a turning point. Language models were no longer just about sequencing words; they began to learn and represent the rich tapestry of human language. This was more than a technical advancement; it was a paradigm shift in our journey to create machines that could understand not just the letters and sounds of our language, but its soul.</p><h3>Stage III: Pre-trained Language Models (2010s)</h3><p>In the evolving saga of language models, the emergence of Pre-trained Language Models (PLMs) marked a new era, akin to the industrial revolution in its transformative impact. These models introduced a radical idea: rather than starting from scratch for each new task, why not teach a model the breadth of language first, and then specialize it? This was a shift from a world where machines learned language in a vacuum to one where they first absorbed the vast expanse of human communication.</p><p>The first steps in this direction were taken by ELMo, a model that used a bidirectional LSTM network. Think of it as teaching a machine to understand context in both directions — what comes before and what comes after a word, much like understanding a conversation in a bustling café, catching snippets from all sides. Instead of fixed word meanings, ELMo adapted to the context, making language understanding more fluid and natural.</p><p>Then came a leap in this journey — BERT, built on the Transformer architecture, a breakthrough as significant as the invention of the printing press for human literacy. BERT used self-attention mechanisms, allowing it to weigh the importance of different words in a sentence. It was pre-trained on a vast corpus of unlabeled data, akin to reading an entire library, before being fine-tuned for specific tasks. This approach dramatically improved the machine’s understanding of language nuances, setting new standards in performance.</p><p>Following BERT, a wave of innovation swept through the field. New architectures like GPT-2 and BART emerged, each bringing their own strengths to the table. The “pre-training and fine-tuning” paradigm became the new norm, a strategy where models first learn a general understanding of language and are then customized for specific tasks.</p><p>This stage in the evolution of language models was not just about technological advancement; it was about redefining the relationship between machines and the vast, complex world of human language. PLMs were not just tools; they were like digital scholars, first learning broadly about language and then applying that knowledge to specific challenges.</p><h3>Stage IV: Large Language Models (2020s)</h3><p>As we reach the current frontier of language model evolution, we encounter the giants of this realm: Large Language Models (LLMs). These models are the digital equivalent of the Library of Alexandria, vast in their knowledge and understanding of language. Scaling up these models — increasing their (brain) size and the amount of data they learn from — has led to remarkable advancements, akin to the difference between a village library and a vast national archive.</p><p>Imagine a model like GPT-3, with its 175 billion parameters, or PaLM with an even more staggering 540 billion parameters. These aren’t just bigger versions of their predecessors; they are in a league of their own, displaying abilities that smaller models couldn’t dream of. It’s like comparing a skilled storyteller to an entire civilization’s collective wisdom. For instance, GPT-3 can tackle tasks with minimal guidance, learning from just a few examples, a feat beyond the reach of earlier models like GPT-2.</p><p>This surge in size and capability led to the coining of the term ‘Large Language Models’ or LLMs, reflecting their distinctiveness from smaller models. A notable application of LLMs is ChatGPT, which harnesses the power of GPT models for conversations, displaying an almost human-like ability to chat and respond. The release of ChatGPT sparked a surge in research, as seen in the exponential increase in related academic papers.</p><p>However, it’s crucial to understand that LLMs are not just about size. They represent a philosophical shift in the field of AI. Early language models were content with generating text, but LLMs like GPT-4 are now solving complex tasks. This transition from mere text generation to task solving is a leap in scientific thinking, a leap towards models that don’t just mimic language but use it to think, reason, and solve.</p><p>As we chart this journey, we see a clear evolution in capabilities. Statistical language models started as assistants for specific tasks, like finding information or aiding in speech recognition. Neural language models then shifted focus to learning versatile features, reducing the need for human input in teaching machines. Pre-trained models brought context-awareness, fine-tuning themselves to specific tasks. And now, LLMs stand as general-purpose problem solvers, their vast knowledge allowing them to tackle a wide range of tasks with unprecedented effectiveness.</p><p>In this grand narrative of language models, we’ve witnessed an expansion not just in what these models can do, but in what they aim to achieve. From basic text generation to complex problem-solving, the story of language models is a reflection of our journey in understanding intelligence, both human and artificial.</p><p>In this odyssey through the evolution of language models, we’ve not only witnessed technological marvels but also glimpsed into the depths of human intellect and communication. If this journey has kindled a spark of curiosity or insight in you, a clap of appreciation would be warmly welcomed 👏. For those who wish to fuel this voyage further, a gesture as simple as <a href="https://www.buymeacoffee.com/ryvn">buying me a coffee</a> can propel our collective quest into the realms of language and intelligence. Every bit of support is a step towards unraveling more mysteries together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91572d9fac91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rocking JavaScript with Four New Non-Destructive Array Methods]]></title>
            <link>https://medium.com/@ryvnollie/rocking-javascript-with-four-new-non-destructive-array-methods-c2117fbfa3fd?source=rss-439a7ec01e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2117fbfa3fd</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ryvn]]></dc:creator>
            <pubDate>Fri, 02 Jun 2023 03:59:26 GMT</pubDate>
            <atom:updated>2023-12-30T06:59:52.876Z</atom:updated>
            <content:encoded><![CDATA[<h4>ECMAScript 2023 is kicking the mutating-array headache to the curb</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VqPd7jeUNibiysvnd7MwGA.jpeg" /><figcaption><a href="https://unsplash.com/@brave4_heart">Jigar Panchal</a></figcaption></figure><p>After playing the waiting game for ages, we’ve got something to cheer about. ECMAScript 2023 is finally here, rolling out the red carpet for some cool, new array methods that are set to shake up our JavaScript coding world. You know the drill with methods like sort() and reverse() - they loved messing around with our arrays and changing them. A real pain in the neck when you&#39;re trying to write squeaky-clean React code, functional programming, or just keeping things pure. Those days are in the rearview mirror now. ECMAScript 2023 is here to the rescue with immutable versions of these array methods. So, let&#39;s get the party started and explore what these new game-changing methods are all about!</p><h3>Array Manipulation in JavaScript: Destructive and Non-destructive</h3><p>As many JavaScript developers are aware, array manipulation is a common task in everyday coding. However, there has always been a dichotomy in the array manipulation methods; some are non-destructive, meaning they do not alter the original array when called, while others are destructive and change the original array.</p><p>Non-destructive methods such as filter() return a new array based on the operation and leave the original array untouched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZDLLnuYOmIrinWlA1FywA.png" /></figure><p>On the other hand, some methods like sort() are destructive, altering the original array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5q8bXZxIA2ZLUD505U5Yg.png" /></figure><p>It’s the same case for other destructive methods like reverse() and splice(). To prevent the mutation of the original array, developers have been using various techniques to first make a copy of the array and then perform operations on the copied array. This can be quite cumbersome and clutter the code.</p><h3>ECMAScript 2023’s Solution: Four New Non-Destructive Array Methods</h3><p>ECMAScript 2023 has introduced the non-destructive versions of the reverse(), sort(), and splice() methods, which means we no longer have to manually create a copy of an array to protect the original.</p><h4>toReversed()</h4><p>The toReversed() method is the non-destructive counterpart of reverse().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0H2dEmRw5qHahHKsc2R_CQ.png" /></figure><h4>toSorted()</h4><p>Similarly, toSorted() is the non-destructive equivalent of sort().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVLwEzCauWKA4nm1nwpLog.png" /></figure><h4>toSpliced()</h4><p>The toSpliced() method mirrors the behavior of splice(), but in a non-destructive manner. This means the original array remains unchanged and it returns an updated array instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cldzqNv5sSPbNa9uzyqRvQ.png" /></figure><h4>with()</h4><p>The with() method is a special introduction in ECMAScript 2023. It acts like arr[index] = value but is non-destructive. This means it allows you to replace an element at a given index without mutating the original array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wyGTwn_kprYvbwffWRiMPg.png" /></figure><h3>Importance in Functional Programming</h3><p>In the context of functional programming, these non-destructive methods are a significant stride forward. They align well with the principle of immutability which dictates that data should not be changed after it’s created. In a purely functional program, functions do not have side effects like mutating their input. Non-destructive methods follow this principle, thus preventing any unintended side effects. This approach enhances readability, reduces complexity, and makes the code more predictable and easier to reason about. By providing out-of-the-box non-destructive array manipulation methods, ECMAScript 2023 is making functional programming with JavaScript more accessible and efficient.</p><h3>Conclusion</h3><p>In conclusion, ECMAScript 2023 bolsters our coding toolbox with these four novel, non-destructive array methods. They promise cleaner code and fewer bugs due to unintentional array mutation. Let’s step forward into this new era, utilizing these methods for more effective and sustainable code.</p><p>If you’ve made it this far, I appreciate your time and I hope you’ve found this article helpful. If so, don’t forget to give it a clap 👏 ! Your applause not only motivates me to share more insights like these but also helps other developers to find this resource. Thanks for reading and happy coding!</p><figure><a href="https://www.buymeacoffee.com/ryvn"><img alt="" src="https://cdn-images-1.medium.com/proxy/1*lviQAsrtgJB0dMiercB9ig.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2117fbfa3fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blender x ChatGPT: A Guide to the AI-Powered Blender Add-on]]></title>
            <link>https://medium.com/@ryvnollie/blender-x-chatgpt-a-guide-to-the-ai-powered-blender-add-on-cf5766084f8f?source=rss-439a7ec01e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf5766084f8f</guid>
            <category><![CDATA[blender]]></category>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Ryvn]]></dc:creator>
            <pubDate>Tue, 30 May 2023 08:04:42 GMT</pubDate>
            <atom:updated>2024-03-31T20:32:59.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2OUJ37LMcESHrV10b1oFQ.png" /></figure><p>Whether you’re a professional 3D artist, an enthusiastic hobbyist, or an adventurous beginner, our newly developed Blender Add-on is a game changer that you’re going to love. Imagine letting an AI transform your simple prompts into intricate 3D models and animations. Sounds like a dream, right? But with our innovative add-on that harnesses the potential of OpenAI’s latest GPT-4 (and GPT-3.5) models, this dream is now a reality.</p><p>The best part? You no longer have to grapple with the daunting task of manually modelling complex 3D elements. With this AI-powered tool at your fingertips, you’re all set to revolutionize the way you design in 3D. More importantly, it’s totally free!</p><p>With an array of key features designed to enhance your 3D designing experience, we’re confident that our Add-on will address past frustrations in similar products and provide you with an upgraded, user-friendly, and creative tool.</p><h3>Key Features</h3><p>The Blender Add-on isn’t just about the cool factor. It’s a sophisticated, well-developed tool that packs a range of versatile features to elevate your 3D designing experience. Here’s what you get:</p><p><strong>Multi-Lingual Support:</strong> Now, our user-friendly interface supports more languages! Along with English, we’ve added Español, 繁體中文 (Traditional Chinese), 简体中文 (Simplified Chinese), and Français. <em>(v0.0.2 update)</em></p><p><strong>Choose Your Model:</strong> You’re in charge here! Choose between Chat GPT-3.5 and Chat GPT-4 models based on your preference or task complexity. (If you want to use GPT-4, make sure you have access to it!)</p><p><strong>Adjustable Creativity:</strong> You get to call the shots on how much creativity you want from the AI. Our add-on offers adjustable “creativity” settings. Whether you want deterministic results or prefer the unexpected, you can have it all.</p><p><strong>User-friendly Interface:</strong> With chat history maintenance, viewing produced codes, and much more, experience the simplicity and convenience of OpenAI chat GPT within your Blender workspace.</p><p><strong>Speed and Robustness:</strong> The Blender Add-on is all about efficiency and reliability. Faster inference times compared to similar products and more robust results mean your creativity is never hindered. <em>(v0.0.2 update)</em></p><blockquote>In v0.0.2 update, we’ve fine-tuned performance, streamlined the user interface for multi-language support, and ensured compatibility with OpenAI’s latest API.</blockquote><h3>Getting Started with Blender GPT Add-on</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9wd8pu5aLFE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9wd8pu5aLFE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9wd8pu5aLFE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/23538f2c91b867fef8b1cc688cb0c223/href">https://medium.com/media/23538f2c91b867fef8b1cc688cb0c223/href</a></iframe><h4>Before You Begin</h4><p>Let’s get the prerequisites sorted. You’ll need:</p><p>1. Blender 3.5 or later installed on your system.<br>2. An OpenAI API key. You can get one from the OpenAI website. <a href="https://platform.openai.com/account/api-keys">Click Here</a> to get yours.</p><h4>Installation Steps</h4><p>Here’s how to install the Blender GPT:</p><p>1. Download the Add-on from the GitHub <strong>Release</strong> page.<br>2. Install the Add-on in Blender.<br>3. Enable the Add-on.<br>4. Enter your OpenAI API Key and choose your preferred language.</p><p>And voila! You’re all set to explore the limitless realm of AI-powered 3D modeling.</p><h4>Using the Blender GPT Add-on</h4><p>Navigating the Blender GPT is straightforward.</p><p>1. Open the Sidebar in 3D View.<br>2. Pick the Chat-GPT Model.<br>3. Decide the level of AI Creativity.<br>4. Enter your prompt in the input field.<br>5. Submit the prompt.<br>6. Review the generated codes.<br>7. Delete dialogues, if needed.</p><p>And there you have it! Your journey to the fascinating world of AI and 3D modeling has officially begun.</p><p>Remember, the Blender GPT does require an active internet connection to function properly as it relies on OpenAI’s cloud services. And occasional errors may occur due to the inherent nature of AI. If you notice a mistake, simply revise your command or modify the generated Blender Python code directly. So, gear up and get ready to explore a new dimension in 3D designing with the Blender GPT Add-on. We’re excited to see what you create!</p><h3>Join the AI-Powered 3D Modeling Revolution</h3><p>Get the Blender GPT Add-on installed today and step into the future of 3D modeling. <a href="https://github.com/ryvn-dev/blender-gpt/releases/tag/lastest">Download it here</a> and let the creative journey commence!</p><p>If you found this guide useful, and the add-on exciting, don’t forget to give a round of applause 👏. Your support and feedback help us continue developing more innovative tools to elevate your 3D design experience. Happy designing with Blender GPT!</p><figure><a href="https://www.buymeacoffee.com/ryvn"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lviQAsrtgJB0dMiercB9ig.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf5766084f8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Construct Your Dog Breed Classifier]]></title>
            <link>https://medium.com/@ryvnollie/how-to-construct-your-dog-breed-classifier-46688b3e123c?source=rss-439a7ec01e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/46688b3e123c</guid>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[convolutional-network]]></category>
            <dc:creator><![CDATA[Ryvn]]></dc:creator>
            <pubDate>Wed, 01 Sep 2021 02:30:21 GMT</pubDate>
            <atom:updated>2021-09-02T02:39:31.321Z</atom:updated>
            <content:encoded><![CDATA[<h4>A step-by-step approach using the convolutional neural network</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9gmHPtfoMEl5M-2eSDhjTA.jpeg" /><figcaption>A lovely Shiba showers in falling maples; Credit to Jaycee Xie</figcaption></figure><h3>Project Definition</h3><h4>Motivation</h4><blockquote>If you tame me, then we shall need each other. To me, you will be unique in all the world. To you, I shall be unique in all the world. — Antoine de Saint-Exupéry</blockquote><p>Over thousands of years, humans have inadvertently tamed wild and ferocious wolves into over 300 kinds of loyal and faithful companions through artificial selection. Nevertheless, except for cynology experts, even the cleverest dog lovers would devote many endeavors to discern, for example, Brittany from Welsh Springer Spaniel, both of which are one of the most popular and well-known breeds. Thankfully, nowadays we could easily recognize what breed a canine is without taking lots of time to learn every nuance between dog breeds. This is all because the advancement of deep learning offers us wonderful and powerful techniques to tackle such classification tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*UyOQoK6_D2aAkCWV9ue2cA.png" /><figcaption>Brittany and Welsh Springer Spaniel; Credit to Udacity</figcaption></figure><h4>Project Overview</h4><p>In the current project, we aim at constructing a dog breed classifier by deep learning techniques and developing a prototype of a dog identification app using the built classifier. This app is capable of reading any user-provided picture as app input. If the app detects a dog in the image, it will output its classification result, an estimation of the dog’s breed. If the app detects a human in the image, it will indicate this human resembles what kind of dog. If the app detects neither a dog nor a human in the image, it will post a message that something else was detected.</p><p>The data set of this project is provided by Udacity, comprising a <em>dog dataset</em> and a <em>human dataset</em>. In the following sections, we will see the details of these datasets and understand how this dataset could be applied to solve our main concern and be implemented in a dog breed identification app.</p><h4>Problem Statement</h4><p>The main problem/goal of this project, as mentioned, is building a dog breed classifier of dog images, which can tell, given an image, what dog breed is out of 133 dog breeds. Obviously, it is a classic image recognition multi-class classification problem. The main strategy for solving this problem is using convolutional neural networks (CNNs) techniques derived from deep learning/neural networks.</p><p>Specifically, we will develop two approaches: One approach is training a self-defined CNN from scratch to build a from-scratch dog breed classifier; the other approach is adopting transfer learning that utilizes pre-trained models to build a transfer-learning dog breed classifier. Since the latter could have high-level accuracy, one can expect the transfer-learning dog breed classifier would be a better choice for tackling the problem. The details of these approaches, implementations and related experiments will be elaborated on in later sections.</p><h4>Metrics</h4><p>How to assess our models/classifiers’ performance? In the current project, we will adopt 0/1 accuracy as our metrics. The higher accuracy is, the better a model performs. Such accuracy is calculated as the ratio that the number of correctly classified data to the total number of data. Here, we didn’t take recall, precision, or F-score into consideration since our dataset is not significantly imbalanced (see next section) and we care more about the total accuracy that our model can perform rather than the performance on respective classes.</p><h3>Data Exploration &amp; Visualization</h3><p>In this section, we will dive into our two main datasets, namely the dog dataset and the human face dataset. First of all, in the section “the details of datasets”, a thorough description of the input space or input data has been made. Second, via implementing two methods, namely the face detector and the dog detector, not only can we create these methods for our end app, but further visualize and check our data <em>not</em> by merely presenting them (because our data are images).</p><h4>The Details of Datasets</h4><p><strong>The Dog Dataset.</strong> Like all machine learning tasks, we need data to accomplish our task. For the current project, regarding the dog classification task, the dog dataset (the below figure is a random subset of the dog dataset) is constructed and retrieved from Udacity. The dog dataset is comprising of 8351 dog images and their corresponding breed labels as a total of 133 dog breed names. The sample size of this dataset is quite decent for training a neural network. As an orthodox supervised learning classification task, the division of <em>training set</em>, <em>validation set</em>, and <em>testing set</em> is required, the sample size of three of which are 6680, 835, and 836.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*7ukQNL86y8L0R23BSmPGCQ.png" /><figcaption>A random subset of the dog dataset</figcaption></figure><p>Let’s take a closer look at the dog dataset. First of all, we can check how many pictures of each class/breed are. Taking the dog dataset as a whole, we depict a barplot of counts of 133 classes (see below figure). The breed, Alaskan Malamute, has the most images (= 96) in our dataset, while the breed, Norwegian Buhund, has the least images (= 33) in our dataset. From the distribution of the counts of each breed, we can find the mean (sd) counts equals 62.78 (14.85) images and the range equals 63 images. According to <a href="https://machinelearningmastery.com/what-is-imbalanced-classification/">Brownlee’s (2019) review</a> of imbalanced data, the proportion of the least counts to the most counts is about 33%, which is not so low that our dataset is imbalanced. Also, inspecting from the barplot, we can find there exist no big discrepancy among the counts of each breed. It is worth noting that for the training set, validating set, and testing set, the distribution of counts of dog breed classes are similar (which is quite important and conducive to inferencing).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fPivMNXFUQ0U2w6SORmzFQ.png" /><figcaption>The counts of each breed in our dog dataset</figcaption></figure><p>Second of all, we want to understand if there are any unusual properties or characteristics related to the dog dataset. Here we will implement <a href="https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/">blur and out-of-focus detection</a>, which is indicated as <em>focus measure</em> derived from the variance of the Laplacian kernel of images. The high the focus measure is, the less the blurriness is. The descriptive statistics of the focus measure are mean =1614.65, std = 2506.61, min = 5.26, max = 47768.70. As <a href="https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/">Rosebrock (2015)</a> put it, since blurriness is a relative concept, defining the threshold of blurriness is discretionary and contingent on the dataset. Therefore, let’s check the images having the bottom two focus measure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*NnFVHnTi_2oDZ_7GwBIaUQ.png" /><figcaption>The blurriest images in our dataset</figcaption></figure><p>We would say that these images are not quite blurry, and thus the images in the dog dataset are all quite clear. After checking the images whose focus measure is under 100, the reason why these pictures are regarded as relative blurry images might be these dogs has nebulous hair in nature or their background is out-of-focus. All in all, we can say that there are no obviously blurry images in our dataset.</p><p><strong>The Human Face Dataset. </strong>As mentioned, our dog identification app involves human face recognition; hence, we require, albeit not for training, a human face dataset that is also from Udacity. The human face dataset includes 13233 human face images (the below figure is a random subset of the dog dataset).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*fpwjNrAZ4AAvJ4AKDOHlBA.png" /><figcaption>A random subset of the human face dataset</figcaption></figure><h4>Detect Human Faces</h4><p>For human face detection, we can use the common computer vision python package OpenCV. Its Haar feature-based cascade classifiers are quite adequate for objection recognition. Hence, we adopt a pre-trained Haar feature-based cascade classifier to detect whether there are faces in a given image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c14d535c1d6372a90a59d2e3f4e7775/href">https://medium.com/media/3c14d535c1d6372a90a59d2e3f4e7775/href</a></iframe><p>As we can see in the above codes, before finding faces in the image, we should convert the BGR image to grayscale. Once detection completes, the cascade classifier would mark the faces with rectangular boxes (see the figure below). Moreover, the <strong>face_detector</strong> method will return true if it finds one or more faces in the image. This method would be used in our end app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*-DGDxuzQ4f8EHonMAPMfnQ.png" /><figcaption>Human face detector example outcome</figcaption></figure><p><strong>Assess the Human Face Detector’s Performance.</strong> Does this classifier perform well? To assess its performance, the classifier is employed on 100 dog images and 100 human images. The results show that 100.0% of human images are detected as human faces; and, 12.0% of dog images are detected as human faces. Although such outcomes might disgruntle those canonize accuracy, I believe it performs quite well since the classifier would not bungle pictures with human faces. Still, this classifier seems reliable and valid enough to give it a go in our project.</p><h4>Explore Datasets by Human Face Detector</h4><p>From the above assessment, for the human face dataset, it seems non of them are wrongly classified. Each human picture can be detected as a face.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*iV0XVEuw5Iq9sWybs3c5lA.png" /><figcaption>Examples of face detector on human dataset</figcaption></figure><p>For the dog dataset, using the human face detector to detect whether it is a dog is not appropriate since some dogs would be classified as human by indicating the dogs have human faces. In other words, these wrongly classified dog pictures may have some abnormality or peculiarity so that we need a more precise classifier to check whether an image contains a dog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*GRwVOe9TwKoU_4scXAxbIw.png" /><figcaption>Examples of face detector on dog dataset (wrong cases)</figcaption></figure><h4>Detect Dogs</h4><p>Akin to the human face detector, we are going to build a “dog detector”. Unlike the approach we adopted in the previous section, we employ another approach, using a deep-learning pre-trained image classification model. This classification model has been trained on the immense database, ImageNet.</p><p>Specifically, we will use Keras (a high-level API of TensorFlow) to load the pre-trained ResNet-50 convolutional neural network and let images be this model’s inputs. Given a specific image, the model will predict probabilities for 1000 categories. If the maximum probability is assigned to one of the 118 dog-related categories, we will say there are dogs in the given image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a26dc104858e0e4b25e3f6ec2ddce0dc/href">https://medium.com/media/a26dc104858e0e4b25e3f6ec2ddce0dc/href</a></iframe><p>As we can see in the above codes, the <strong>dog_detector</strong> method will return true if it finds one or more dogs in the image. This method would be used in our end app.</p><p><strong>Assess the Dog Detector’s Performance.</strong> Does this classifier perform well? To assess its performance, the classifier is also employed on 100 dog images and 100 human images. The results show that 0.0% of human images are detected as dogs; and, 100.0% of dog images are detected as dogs. It is obvious that it performs quite well on both dog and human images. Because of its high-level accuracy regarding whether it is a dog, we will use this method to check if there is a dog in an image.</p><h3>Methodology &amp; Results</h3><p>As mentioned in the “Problem Statement”, we will adopt two approaches to construct our dog breed classifiers. The <strong>data preprocessing</strong>,<strong> implementation</strong>, <strong>refinement</strong>, <strong>model evaluation and validation</strong>, and <strong>justification</strong> of each approach or experiment are articulated in the following parts.</p><h4>Data Preprocessing</h4><p>In this part, before implementing our classifiers, we should do some common image data preprocessing including resizing and normalization. Regarding <strong>resizing</strong>, since most of the neural network models assume a square shape input image, we need to scale dog images from various shapes to a uniform 244 by 244 pixels. Regarding <strong>normalization</strong>, we normalize pixel values from the range of 0–255 to the range 0–1 preferred for neural network models. This step is crucial to deep-learning-based image tasks since it not only ensures that each input parameter/pixel has a similar data distribution but also makes convergence faster while training the network.</p><h4>CNN From Scratch</h4><p>Now we come to the main task, the classification of dog breeds. We expect that our dog breed classifier can correctly tell us what breed a dog is given an image. In this section, we will build our own Convolutional neural networks (CNNs)-based dog breed classifier from scratch. Why do we adopt CNNs architecture rather than other deep learning structures? CNN is a type of artificial neural network, most commonly used to analyze visual images. To a certain extent, CNNs are inspired by the organization of the animal visual cortex. Technically speaking, CNN is a regularized version of the multilayer perceptron to preclude overfitting issues from the full connectivity of multilayer perceptrons.</p><p>Let’s start building our CNN model. Below model structure is a simple model suggested by Udacity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*ZhrhvpqTEn2b1q3f6v1GLA.png" /><figcaption>A simple CNN model suggested by Udacity</figcaption></figure><p>In detail, we have an input layer in which image data are supplied. Next, the data will sequentially run through three pairs of convolutional and pooling layers and finally go into a fully connected/dense layer that outputs a dog breed result.</p><p>A convolutional layer is comprised of a set of filters with a fixed height and width, resembling human eyes screening every subfield of an image. A pooling layer is responsible for reducing the dimension of the input. The below figure illustrates the visualization of our simple CNN model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/211/1*puoFjEZHpPWMv_eX2ScSFA.png" /><figcaption>Pictorial representation of our simple model</figcaption></figure><p>The source code for creating and training our model with the Keras library looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6e34cacb4e20c5ebbf362b86ba2fada/href">https://medium.com/media/a6e34cacb4e20c5ebbf362b86ba2fada/href</a></iframe><p>As we can see in our source codes, apart from the model structure, other training details are using “rmsprop” as our optimizing algorithm, using 1/0 accuracy as our evaluating metric, training 20 epochs, and setting the batch size to 32.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*B1rTkQ3aa2Eh48AYaZsroQ.png" /><figcaption>Learning curves of our simple CNN model (test here means validating set)</figcaption></figure><p>Observing from the learning curves of this training, we can find both training and validating loss are not converged and the issue of underfitting, which indicates that we can train on more epochs or use more sophisticated CNN models. After all, the result on the testing set shows that the test accuracy equals 4.78%, which is egregious!</p><p>Surely, in the context of using CNN models built from scratch, we can continue to experiment on different CNN structures or different learning algorithms. I deeply believe that it will ultimately get a quite acceptable performance which is much more than 4% test accuracy. However, this approach (i.e., from scratch) seems to be quite complex, tedious, and time-consuming, which requires a lot of patience and a lot of computing power. So, let’s look at a better method in the next step.</p><h4>Refinement: CNN Transfer Learning</h4><blockquote>If I have seen further than others, it is by standing upon the shoulders of giants.</blockquote><p>The underpinning purport behind <em>​​transfer learning</em> is that learning specialized skills is easier especially when one already has basic knowledge. There are myriad CNN models that have been trained on a huge amount of image data, namely pre-trained CNN models. Our current approach is to take advantage of such pre-trained CNNs.</p><p>Specifically, we first load a pre-trained VGG16 model provided by Udacity. Next, we relinquish its last fully connected layer and run our new data (dog breed dataset) on the reduced model. At this moment, we will get <em>bottleneck features.</em> Last, we define and train a new network that takes bottleneck features as inputs and output the dog breed classes. It is worth noting that the “new network” connected to the bottleneck features would be quite simple (in the current section, only one global average pooling layer and a final dense output layer would be constructed) since the pre-trained model has handled a majority part of work.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/970d33b8a63762cb5e0f7867d4073dc7/href">https://medium.com/media/970d33b8a63762cb5e0f7867d4073dc7/href</a></iframe><p>As we can see in our source code, it first loads the bottleneck features. Next, it stipulates the last layers for our task. Finally, it trains these layers with the bottleneck features. All other details of the learning process (i.e., optimizer, epochs, batch size, and other hyperparameters) are the same as the setting of the previous simple CNN model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*2AfhkElxNpzujHJFdAr5dA.png" /><figcaption>Learning curves of transfer learning using pre-trained VGG16 CNN model (test here means validating set)</figcaption></figure><p><strong>Model Evaluation and Validation.</strong> Observing from the learning curves of this training, compared with from scratch simple CNN, we can find both training and validating loss are more converged and the accuracy increases significantly. The result on the testing set shows that the test accuracy equals 37.08%. It shows that using transfer learning can lead to a great leap regarding predictive performance. However, it perhaps could be better, so let’s go to the next section to see what we should do.</p><h4>Refinement Again: More CNN Transfer Learning</h4><p>Similar to the previous section, we regard it as a transfer learning template, choose our own pre-trained model, and define our network connected to bottleneck features. Learning from the experience in step 4, since VGG16’s still has a sort of underfitting issue, we here will adopt a more complex pre-trained model, ResNet-50. ResNet-50 has a more sophisticated structure than VGG16, featuring more layers and, more importantly, the residual mechanism, which prevents the model from losing information due to passing through too many layers.</p><p><strong>Experiments on ResNet-50. </strong>Only changing the pre-trained model cannot satisfy our needs. Therefore, here we take a further step to conduct different experiments on learning algorithm/deep learning hyperparameters. Specifically, we will experiment on a 2-by-2 design regarding optimizer (rmsprop and adam) and batch size (32 and 64). In common sense, adam optimization can be regarded as a combination and momentum; and a larger batch size can lead to a more stable result. Thus, one may expect that the model with adam and 64 batch-size could perform the best among them.</p><p>The findings shown below corroborate our expectations. Overall, taking ResNet-50 as pre-trained advance the test accuracy to 80% and above. Among four experiments conducted in RestNet-50, the combination of adam and 64 batch-size reach even 83.8% test accuracy, which meets our prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*GfEnV7FoEF3Big8SH2TJ1Q.png" /><figcaption>Summary of top1 test accuracies in all experiments</figcaption></figure><p><strong>Model Evaluation and Validation. </strong>Observing from the learning curves of the training with adam and 64 batch-size (see below figure), we can find training loss is converged to nearly zero but validating loss is converged much above zero. This phenomenon may entail overfitting, indicating there is a zoom for us to progress. Despite this, our test accuracy reaches 83.8%, which is quite acceptable in multi-class image classification tasks. It means there are 83.8% of dog images (in the testing set) are correctly recognized as their right breeds. Stated another way, we would say that such a dog breed classifier satisfied our goal of this project: Build a dog breed classifier of dog images, which can tell, given an image, what dog breed is out of 133 dog breeds with acceptable accuracies. In the “Build a Dog Breed Identification App” section, we will see some examples/outcomes of running this classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*blTQXKD_0iTbz7za1EkjJQ.png" /><figcaption>Learning curves of transfer learning using pre-trained ResNet-50 with adam and batch size 64 (test here means validating set)</figcaption></figure><h4>Still, It Could Be Better</h4><p>Although we achieve nearly 83 % accuracy with our test data, we can make our model even better. There are several options that we could take (for the details, please refer to the conclusion section):</p><ul><li>Data augmentation or more training data</li><li>Fine-tuning more hyperparameters</li><li>Altering and trying different CNN structures</li></ul><p>For now, we are satisfied with the results. Hence, we will use them in our dog identification app in the following steps.</p><h3>Build a Dog Breed Identification App</h3><h4>Write your Algorithm</h4><p>In this step, we collect our achievements from the previous steps. Based on these achievements, we compose an app that takes an image and outputs whether it is a dog, a guy, or other things. If it detects a dog, it will indicate its breed. If it detects a guy, it will indicate this guy resembles what kind of dog.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c18afb16289f0b5675f5f95653ef3925/href">https://medium.com/media/c18afb16289f0b5675f5f95653ef3925/href</a></iframe><h4>Test Your Algorithm</h4><p>Let’s see some example outputs of our app!</p><p><strong>Human Case: Joe Keery.</strong> Perhaps it is Kerry’s Brown long hair that makes him resemble English Springer Spaniel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*uuyrLd9Oc61ApfUWqJL0rQ.png" /></figure><p><strong>Dog Case: Canaan Dog.</strong> It predicts breed perfectly about this cherubic Cannan Dog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*wcCwk03BBDgjf2jz9WesoQ.png" /></figure><p><strong>Other Case: Bottle Picture.</strong> The app correctly recognizes it is something beyond dogs and humans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*GWPzOCbi1gaLC8O7SFt2iQ.png" /></figure><h3>Conclusion</h3><h4>In a Nutshell, and Improvement</h4><p>In this project, we utilized several methods for developing a dog breed identification app. Employing CNN transfer learning, we obtained an accuracy of 83% in our testing set. Nevertheless, there is some advice for further improving our algorithm in the future:</p><ul><li>Try and train on different model structures. A tip to adjust model structure is to use XAI to check where the model attends to. If the model always attends to the wrong place, we can further prune the corresponding deleterious network.</li><li>Adopt data augmentation (such as mirror flip, rotation, color adjustment, resizing, or other common computer graphics skills) to enhance the generalization power of the model, which can prevent overfitting.</li><li>Although I have tried on different optimization algorithms and batch sizes, perhaps other choices of optimization algorithms, learning rate (including learning rate scheduling), or regularization could help.</li></ul><p>All in all, high accuracy levels suggest that we already have a serious model that could work within a real app.</p><h4>Reflection</h4><p>Actually, recently I am very interested in computer vision tasks involving deep learning, although I have been working in the NLP field for a long time. Besides, I’m a total dog lover. Because of this, when I found this project on the Udacity capstone list, you cannot imagine how excited I was. It motivates me and dives me not only to do this project but to share the content with everyone.</p><p>In the technical respect, actually, I have done numberless experiments regarding many combinations of hyperparameters. Despite the fact that the majority of them are disappointing, this is how machine learning charms: Only having suffered from the tedious and most in vain works, the final fruit would be the most precious.</p><p>You can find the source code for this project in the corresponding <a href="https://github.com/hc-psy/ds-hub">GitHub repository</a>. Some of the source code has been provided by Udacity in this <a href="https://github.com/udacity/dog-project">repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46688b3e123c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uncovering the Secrets behind Covid-19 Precautions: A Rehash or Truly a Matter?]]></title>
            <link>https://medium.com/@ryvnollie/uncovering-the-secrets-behind-covid-19-precautions-a-rehash-or-truly-a-matter-d215c51c6771?source=rss-439a7ec01e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/d215c51c6771</guid>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ryvn]]></dc:creator>
            <pubDate>Fri, 16 Jul 2021 16:52:20 GMT</pubDate>
            <atom:updated>2021-07-16T16:52:20.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>Uncovering the Secrets Behind Covid-19 Precautions: A Rehash or Truly a Matter?</h3><h4>Let data speak for themselves through data science ways</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKxVMliZtbyknziowqMujQ.jpeg" /><figcaption>An empty street due to the Covid-19 outbreak.</figcaption></figure><h3><strong>Introduction</strong></h3><p>The Covid-19 outbreak has drawn increased international attention as the virus quickly spreads across the world. Taiwan, which had gained fame for “successfully” preventing the virus, experienced a real pandemic until recently. Therefore, Taiwan authorities have devoted their endeavors to ask people to wear masks, keep social distance, and do not panic as precautions against virus. However, are these means equivalently crucial? Under pandemic, what action should people take firstly? To elaborate, I here propose three inquires:</p><ul><li>Overall, what are patterns of people’s precautions against Covid-19?</li><li>Does region, culture, or social norms related to such patterns?</li><li>What precaution is the most efficacious way?</li></ul><h4><strong>About the Data</strong></h4><p>Since Taiwan is suffering coronavirus, few Taiwan data is well-collected, well-documented, or open-sourced. Here, inspired by American experience, I will use a survey data from <a href="https://www.kaggle.com/c/ml2021spring-hw1/data">Kaggle</a>, a reduced form of <a href="https://cmu-delphi.github.io/delphi-epidata/symptom-survey/">Delphi Epidata</a> @ CMU. This dataset is a multi-wave survey composed of states (40 states), Covid-like illness (coronavirus-like illness, influenza-like illness, etc.), behavior indicators (wearing mask, not travel outside, etc.), mental health indicators (anxious, depressed, etc.), and Covid-19 test positive.</p><h3>Patterns of Precautions During the Pandemic</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*UgDifIGLKf9QnDKwyQ2yOw.png" /><figcaption>Figure 1: Boxplot of Covid-related Features</figcaption></figure><h4>What happened during the pandemic?</h4><p>Based on the distribution of each feature shown in above box-plots, here you can see during pandemic, to prevent getting virus, people started to take precautions, <strong><em>largely wearing masks</em></strong> but <strong><em>less not using public transit</em></strong>. Regarding mental states during pandemic, it makes sense that people mostly tended to <strong><em>worry about being infected</em></strong> relative to other kinds of mental health indicators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*-vrjEmr-QFBz-f1DQHNnkQ.png" /><figcaption>Figure 2: Correlations of Covid-related Features</figcaption></figure><h4>What precaution patterns people showed?</h4><p>Based on the correlation of each paired-feature shown in above correlation matrix, during pandemic, those tended to take behavioral precautions were less feeling ill nor feeling worried, indicating that <strong><em>wearing a mask or keeping social distance might refrain you from getting sick or being anxious</em></strong>. Moreover, having a check at last row of the matrix, you can see behavioral precautions are negatively correlated to being confirmed as a Covid-19 case, indicating that <strong><em>behavioral precautions might play a pivotal role in preventing infection</em></strong>.</p><h3>Region, Culture, or Social Norms Matters</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1WXWu8iRGSWW9sqNb6Amg.png" /><figcaption>Figure 3: Indicator Pattern of Each State</figcaption></figure><p>Above graph is the average values of Covid-like illness, behavior indicators, mental health indicators, and Covid-19 test positive in each American state. Here you can see overall, states with high behavioral indicators/precautions tend to have low test positive/Covid-like illness/mental state and vice versa, which reconfirms my previous findings. More importantly, each American state has its idiosyncratic pattern different from one another, revealing that the social norm or the culture of a region may be important in Covid-19 prevention.</p><h3>Important Precautions to Covid-19</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUlve7Wy-7wPTlSCkqgVsg.png" /><figcaption>Figure 4: Importance of Covid-related Features in Predicting Test Positive</figcaption></figure><p>To understand what important precautions are, I built a predictive model (xgboost) to predict getting Covid-19. With test performance 96%, the model revealed behavioral precautions, among others, are crucial in prediction. The model suggested <strong><em>avoiding using public transit</em></strong> and <strong><em>staying at home</em></strong> may be the primary considerations.</p><h3>Take Home Messages</h3><p>In this post, we dived into the problems germane to Covid-19 precautions according to Delphi Epidata. Let’s recap what we have observed:</p><ul><li><em>Overall, what are patterns of people’s precautions against Covid-19?</em></li></ul><blockquote><em>During pandemic, people </em><strong><em>worried being infected</em></strong><em> and started to take </em><strong><em>behavioral precautions</em></strong><em>, such as wearing masks or keeping social distance. Those took behavioral precautions </em><strong><em>inclined to be not worried and not get infected</em></strong><em>.</em></blockquote><ul><li><em>Does region, culture, or social norms related to such patterns?</em></li></ul><blockquote><strong><em>Social norm</em></strong><em> or the </em><strong><em>culture</em></strong><em> of a region matters in Covid-19 prevention. Hence, beyond seen as a personal affair, putting an end to the pandemic needs everyone’s effort.</em></blockquote><ul><li><em>What precaution is the most efficacious way?</em></li></ul><blockquote><em>Behavioral precaution plays an efficient role in refraining you from catching Covid-19. Specifically, </em><strong><em>avoiding using public transit</em></strong><em> and </em><strong><em>staying at home</em></strong><em> are the best two.</em></blockquote><h3>Limitations</h3><p>The findings in this post are preliminary and observational, not the result of a formal study. More rigorous and refined analyses and technical reports are advised. For example, meaningful comparisons (statistical testing) can be made to explore the difference between Covid-19 patterns across American states. Moreover, due to inherent time-related characteristics, we can adopt not merely explanatory approach to apply mixed-effects model to estimate the effects but also predictive approach to apply sequence machine learning model.</p><p>To see more about this analysis, see the link to my Github available <a href="https://github.com/hc-psy/ds-hub">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d215c51c6771" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>