<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Retiago Drago</title>
    <description>The latest articles on DEV Community by Retiago Drago (@ranggakd).</description>
    <link>https://dev.to/ranggakd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F375441%2F85be4e5c-f92f-480e-83b6-0595ad496147.png</url>
      <title>DEV Community: Retiago Drago</title>
      <link>https://dev.to/ranggakd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ranggakd"/>
    <language>en</language>
    <item>
      <title>Understanding the Process of Running Metabase on Docker for the First Time 📊🐋</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sat, 18 Nov 2023 03:32:18 +0000</pubDate>
      <link>https://dev.to/ranggakd/understanding-the-process-of-running-metabase-on-docker-for-the-first-time-pm9</link>
      <guid>https://dev.to/ranggakd/understanding-the-process-of-running-metabase-on-docker-for-the-first-time-pm9</guid>
      <description>&lt;h2&gt;
  
  
  
  Outlines
  &lt;ul&gt;
&lt;li&gt;Open Source Quick Start 🌟&lt;/li&gt;
&lt;li&gt;
Setting Up Metabase 🛠️

&lt;ul&gt;
&lt;li&gt;Setting Up An Admin Account 🛠️&lt;/li&gt;
&lt;li&gt;Gathering Database Info 🛠️&lt;/li&gt;
&lt;li&gt;Connect to Database 🛠️&lt;/li&gt;
&lt;li&gt;Usage Data Preferences 🛠️&lt;/li&gt;
&lt;li&gt;Staying in Touch 🛠️&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Metabase Home Page 💻&lt;/li&gt;
&lt;li&gt;Asking Metabase Question 🙋‍♂️&lt;/li&gt;
&lt;li&gt;Filtering Data 🔍&lt;/li&gt;
&lt;li&gt;Previewing Results 👓&lt;/li&gt;
&lt;li&gt;Summarizing Data 📊&lt;/li&gt;
&lt;li&gt;Grouping Results 🤝&lt;/li&gt;
&lt;li&gt;Changing the Visualization 🌆&lt;/li&gt;
&lt;li&gt;References 📚&lt;/li&gt;
&lt;li&gt;
Connect with Me 👨‍💻
&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Open Source Quick Start 🌟
&lt;/h2&gt;

&lt;/h2&gt;
&lt;p&gt;Welcome to your first-time setup guide for running the Open Source version of Metabase using Docker. This guide will help you get Metabase up and running locally on your system.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Assuming you have Docker installed and running. Please click on any image to zoom in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here, I'm using &lt;a href="https://docs.docker.com/desktop/wsl/" rel="noopener noreferrer"&gt;Docker Desktop WSL 2 backend on Windows with distro integration&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Get the latest Docker image:&lt;br&gt;
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yxkt8auhxgjthpajysac.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyxkt8auhxgjthpajysac.png" alt="docker pull"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull metabase/metabase:latest
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  🔎 command explanation
  &lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker pull&lt;/code&gt;: This is the command used to download ("pull") a Docker image from a registry.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;metabase/metabase&lt;/code&gt;: This specifies the name of the Docker image. The part before the slash (&lt;code&gt;metabase&lt;/code&gt;) typically denotes the Docker Hub username or organization, while the part after the slash (&lt;code&gt;metabase&lt;/code&gt;) is the repository name of the image.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:latest&lt;/code&gt;: This is a tag that specifies which version of the image you want to pull. The &lt;code&gt;latest&lt;/code&gt; tag is often used to denote the most recent stable version of an image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, in short, this command pulls the most recent stable version of the Metabase image from the official Metabase repository on Docker Hub.&lt;br&gt;
&lt;/p&gt;

&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the Metabase container anywhere and go to &lt;code&gt;http://localhost:3000&lt;/code&gt;:&lt;br&gt;
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2otyulysnl2idrdcqs4.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2otyulysnl2idrdcqs4.png" alt="docker run"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:3000 &lt;span class="nt"&gt;--name&lt;/span&gt; metabase metabase/metabase
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  🔎 command explanation
  &lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker run&lt;/code&gt;: This is the command to create and start a new container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-d&lt;/code&gt;: Run the container in detached mode, meaning it runs in the background and doesn't block the current shell.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-p 3000:3000&lt;/code&gt;: Map port 3000 of the host to port 3000 in the container. This allows you to access the application running in the container via &lt;code&gt;localhost:3000&lt;/code&gt; on your host machine.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--name metabase&lt;/code&gt;: Assign the name &lt;code&gt;metabase&lt;/code&gt; to the container. This name can be used to reference the container in subsequent commands, instead of using the container's ID.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;metabase/metabase&lt;/code&gt;: The image to use to create the container. This specifies that Docker should use the &lt;code&gt;metabase/metabase&lt;/code&gt; image from Docker Hub, and if it isn't available locally, Docker will pull it from the registry first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, the command starts a new container from the &lt;code&gt;metabase/metabase&lt;/code&gt; image, named &lt;code&gt;metabase&lt;/code&gt;, running in the background, with the container's port 3000 accessible via port 3000 on the host machine.&lt;br&gt;
&lt;/p&gt;

&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Stop and remove the Metabase container. If you need to use the Metabase container again later just run the &lt;code&gt;docker stop metabase&lt;/code&gt; command only:&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker stop metabase &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; docker &lt;span class="nb"&gt;rm &lt;/span&gt;metabase
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  🔎 command explanation
  &lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker stop metabase&lt;/code&gt;: This command stops the running container named &lt;code&gt;metabase&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;: This is a shell operator that allows you to execute a second command only if the first command (&lt;code&gt;docker stop metabase&lt;/code&gt;) succeeds.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker rm metabase&lt;/code&gt;: This command removes the container named &lt;code&gt;metabase&lt;/code&gt; freeing up resources and allowing you to start a fresh container with the same name without conflict. Containers need to be stopped before they can be removed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running this command will turn off the Metabase service running in the Docker container and then remove the container.&lt;br&gt;
&lt;/p&gt;

&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To start the Metabase again without removing them beforehand:&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker start metabase
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
  🔎 command explanation
  &lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker start metabase&lt;/code&gt;: This command will start the existing container named &lt;code&gt;metabase&lt;/code&gt;. This is useful when you have a container that you've stopped and want to run again without setting it up from scratch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using &lt;code&gt;docker start&lt;/code&gt;, you preserve the container's state and any data that might be stored within it between stop and start operations. This is often preferred for applications that store configuration or data that you want to retain across sessions.&lt;br&gt;
&lt;/p&gt;

&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting Up Metabase 🛠️
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2otyulysnl2idrdcqs4.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2otyulysnl2idrdcqs4.png" alt="setup metabase"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up An Admin Account 🛠️
&lt;/h3&gt;

&lt;p&gt;The initial step involves setting up an admin account. Conveniently, the account you establish when you first install Metabase automatically has admin privileges. Since we are presumably deploying for development and not production, it's acceptable if you don't remember the password for this account right away. However, if this were a production server, extreme caution would be necessary to remember this password as it grants access to add other users, connect to databases, set up email, and more. Additional admin accounts can also be created at a later stage.&lt;/p&gt;

&lt;p&gt;For the time being, we'll create an account for personal use to navigate through Metabase. Enter your details, and when you're prepared to proceed, click the 'Next' button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n63c5ul2t8q2crrnp4hq.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn63c5ul2t8q2crrnp4hq.gif" alt="admin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Gathering Database Info 🛠️
&lt;/h3&gt;

&lt;p&gt;At this stage, you'll need to compile some details about the database you plan to integrate with Metabase. Without this information, we won't be able to establish a connection to your database. However, if you prefer to postpone this step, that's perfectly fine. For now, I'm choosing the option &lt;strong&gt;"I'll add my data later"&lt;/strong&gt;. Metabase provides a &lt;a href="https://www.metabase.com/glossary/sample_database" rel="noopener noreferrer"&gt;Sample Database&lt;/a&gt; that allows you to familiarize yourself with its functionalities.&lt;/p&gt;

&lt;p&gt;When you're prepared to establish a connection, you'll require the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;hostname&lt;/strong&gt; of the server hosting your database&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;port&lt;/strong&gt; used by the database server&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;database&lt;/strong&gt; name&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;username&lt;/strong&gt; associated with the database&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;password&lt;/strong&gt; for the database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don't have these details readily available, the individual responsible for managing the database should be able to provide them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycwferm0c1e516pvgj9l.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycwferm0c1e516pvgj9l.gif" alt="db info"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect to Database 🛠️
&lt;/h3&gt;

&lt;p&gt;For those who choose the option &lt;strong&gt;"I'll add my data later"&lt;/strong&gt;, skip this part. For those who have their database information ready, you're just a step away from accessing your valuable data. Simply enter your details into the provided form and hit 'Next'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msir35p6a5zpf0gkj46a.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmsir35p6a5zpf0gkj46a.png" alt="connect db"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll be connected to your database in no time. For additional guidance on database connections, refer to the &lt;a href="https://www.metabase.com/docs/latest/databases/connecting" rel="noopener noreferrer"&gt;Adding and managing databases&lt;/a&gt; section.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage Data Preferences 🛠️
&lt;/h3&gt;

&lt;p&gt;Before we proceed, there's a small matter to address regarding your preferences for usage data. Your decision will aid them in enhancing the Metabase experience. As stated in the box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metabase is committed to respecting your privacy and does not collect any information about your data or the results of your queries.&lt;/li&gt;
&lt;li&gt;The data they collect is entirely anonymous.&lt;/li&gt;
&lt;li&gt;You have full control over this feature and can disable data collection at any time via your admin settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z20yclyj2wsqn410rjjp.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz20yclyj2wsqn410rjjp.gif" alt="preferences"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Staying in Touch 🛠️
&lt;/h3&gt;

&lt;p&gt;Congratulations! You're now fully equipped and ready to explore Metabase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1nn1v60vj9iin6ikxxu.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj1nn1v60vj9iin6ikxxu.gif" alt="staying in touch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Metabase Home Page 💻
&lt;/h2&gt;

&lt;p&gt;Here are the few first things you see on the Metabase home page&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Home Page Content&lt;/strong&gt;: The central part of the image shows sample insights with buttons like "Some insights about Orders," "A summary of People," "A glance at Products," and "A look at Accounts." These are likely the &lt;a href="https://www.metabase.com/docs/latest/users-guide/14-x-rays" rel="noopener noreferrer"&gt;automatic explorations&lt;/a&gt; that we can save as &lt;a href="https://www.metabase.com/glossary/dashboard" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/897jgfaxxgpa1612bix7.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F897jgfaxxgpa1612bix7.png" alt="home page"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Navigation Sidebar&lt;/strong&gt;: On the left side, there is a sidebar that seems to list various sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Metabase Logo&lt;/strong&gt;: Clicking on the Metabase logo will open and close the navigation sidebar. This logo is placed in the upper left corner of the screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Home Button&lt;/strong&gt;: The icon at the very top of the sidebar, would usually take you back to the home page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collections&lt;/strong&gt;: Below the Home icon, there is a section for 'Collections' where questions, dashboards, and models are stored. There is a "Your personal collection" section likely for personal drafts and experiments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bookmark Section&lt;/strong&gt;: Bookmarked items will appear toward the top of the navigation sidebar when there are bookmarked items.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Section&lt;/strong&gt;: Further down the sidebar, we'd expect to find the Data section, which would list the data sources the application is connected to. In this image, we see "Browse data" which could be part of this section.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add Your Own Data&lt;/strong&gt;: Feature to import or connect to new data sources.
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojkh2zbo8ysrus0ymlgc.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojkh2zbo8ysrus0ymlgc.png" alt="sidebar"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Settings&lt;/strong&gt;: At the upper right, there is a gear icon for settings shows a drop-down menu with five options referring to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Account settings&lt;/strong&gt;: This page allows individual users to manage their personal account details on Metabase. Users can update their first name, last name, email, and language preference. There are also tabs for changing the password, reviewing login history, and setting notification preferences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Admin settings&lt;/strong&gt;: This is the administrative panel for Metabase where system-wide settings are configured. Options include setup, general settings, updates, email configuration, Slack integration, authentication methods, map settings, localization, file uploads, public sharing options, embedding configurations, license information, and caching settings. This page also offers guidance for new admins to help them get started with setup tasks like adding a database, setting up email, inviting team members, and tips for production readiness.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.metabase.com/help/" rel="noopener noreferrer"&gt;&lt;strong&gt;Help&lt;/strong&gt;&lt;/a&gt;: The help section provides support resources for Metabase users. It includes troubleshooting guides, a documentation library for in-depth articles on setup and day-to-day usage, a discussion forum to ask questions and learn from other Metabase users, and learning resources such as tutorials, guides, and articles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;About Metabase&lt;/strong&gt;: This option confirms the version of Metabase that is being used, in this case, v0.47.6, along with the build date. It also serves as an acknowledgement of the Metabase trademark and the team behind the product.
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s538rzwc3cs21awciolp.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs538rzwc3cs21awciolp.png" alt="about metabase"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sign out&lt;/strong&gt;: This is the option to log out of the current user session in Metabase, ensuring that no unauthorized person can access the data or settings if the user leaves the computer.
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/onpqu6s4p4ggme0tglh3.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonpqu6s4p4ggme0tglh3.png" alt="settings"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Search Bar&lt;/strong&gt;: This search bar is a tool within Metabase that allows users to quickly find dashboards, questions (which are specific queries or reports), collections, and possibly other entities within their Metabase instance.&lt;br&gt;
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd1vb4zjgp8bx2h8cf4y.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd1vb4zjgp8bx2h8cf4y.png" alt="search bar"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;New Button&lt;/strong&gt;: This button is used to create new content within Metabase. Here's what each option generally stands for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.metabase.com/glossary/question" rel="noopener noreferrer"&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/a&gt;: This allows you to create a new question, which in Metabase terminology is a query or report. You can use their graphical query builder or write SQL queries to explore your data and get answers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.metabase.com/glossary/sql" rel="noopener noreferrer"&gt;&lt;strong&gt;SQL Query&lt;/strong&gt;&lt;/a&gt;: Specifically for creating a new question using raw SQL. This is for users who prefer to write their SQL queries manually or who need to perform more complex queries that the graphical interface may not support.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.metabase.com/glossary/dashboard" rel="noopener noreferrer"&gt;&lt;strong&gt;Dashboard&lt;/strong&gt;&lt;/a&gt;: This option is used to create a new dashboard. Dashboards are collections of questions that can be viewed together on a single page, allowing for easy visualization of related data and metrics.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.metabase.com/glossary/collection" rel="noopener noreferrer"&gt;&lt;strong&gt;Collection&lt;/strong&gt;&lt;/a&gt;: Collections in Metabase are like folders, which help organize questions, dashboards, and models. This option lets you create a new collection to organize your Metabase content.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.metabase.com/glossary/model" rel="noopener noreferrer"&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/a&gt;: A model is a curated view of a table that simplifies querying for other users. It allows you to define a set of fields from a table, rename them, add descriptions, and set up default aggregations.
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7o9pysl9iazitbo50kn.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7o9pysl9iazitbo50kn.png" alt="new button"&gt;&lt;/a&gt;
Here's the simple illustration I made that helps me understand the terms for the first time.
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rqysb42s0zpmtj69bos6.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frqysb42s0zpmtj69bos6.png" alt="illustration of terms"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customize Button&lt;/strong&gt;: This allows users to set a specific dashboard as the Metabase homepage for all users.&lt;br&gt;
&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/guftvi95tadvs2ng62c7.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fguftvi95tadvs2ng62c7.png" alt="customize modal"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Asking Metabase Question 🙋‍♂️
&lt;/h2&gt;

&lt;p&gt;In Metabase, a &lt;a href="https://www.metabase.com/glossary/question" rel="noopener noreferrer"&gt;question&lt;/a&gt; constitutes a query, its outcomes, and the presentation of these outcomes, even if it's simply in the form of a &lt;a href="https://www.metabase.com/learn/visualization/table" rel="noopener noreferrer"&gt;table&lt;/a&gt;. Each question is identified by a title, ID, and a shareable unique URL.&lt;/p&gt;

&lt;p&gt;Questions can be manipulated by applying filters and summaries, and these modifications can be saved as separate questions. Additionally, questions can be incorporated into &lt;a href="https://www.metabase.com/learn/dashboards" rel="noopener noreferrer"&gt;dashboards&lt;/a&gt;. However, let's not get too far ahead— for the forthcoming illustrations, we'll utilize the &lt;a href="https://www.metabase.com/glossary/sample_database" rel="noopener noreferrer"&gt;Sample Database&lt;/a&gt; included with Metabase.&lt;/p&gt;

&lt;p&gt;To begin, click on &lt;code&gt;+ New&lt;/code&gt; in the main navigation bar and select &lt;code&gt;Question&lt;/code&gt;. You have the option to begin crafting a new question using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A model&lt;/li&gt;
&lt;li&gt;An unprocessed table&lt;/li&gt;
&lt;li&gt;A previously saved question&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this instance, select &lt;code&gt;Raw data &amp;gt; Sample database &amp;gt; People&lt;/code&gt; to commence, and Metabase will launch the query builder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lihjepp1gdyo1l5x654d.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flihjepp1gdyo1l5x654d.gif" alt="new question"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Filtering Data 🔍
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;People&lt;/code&gt; table is populated with fictitious information. Suppose we are curious about the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is the count of individuals originating from the states of Washington, Wisconsin, West Virginia, or Wyoming?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To be more specific, we are asking: "&lt;em&gt;How many entries (or rows) exist within the &lt;code&gt;People&lt;/code&gt; table where the &lt;code&gt;State&lt;/code&gt; column contains &lt;code&gt;WA&lt;/code&gt;, &lt;code&gt;WI&lt;/code&gt;, &lt;code&gt;WV&lt;/code&gt;, or &lt;code&gt;WY&lt;/code&gt;?&lt;/em&gt;"&lt;/p&gt;

&lt;p&gt;To determine this, we'll apply a &lt;a href="https://www.metabase.com/glossary/filter" rel="noopener noreferrer"&gt;filter&lt;/a&gt; to the dataset focusing on the &lt;a href="https://www.metabase.com/glossary/field" rel="noopener noreferrer"&gt;field&lt;/a&gt; of interest, which is &lt;code&gt;State&lt;/code&gt; in this scenario. Our goal is to tally up the number of rows that meet our criteria.&lt;/p&gt;

&lt;p&gt;During the &lt;code&gt;Filter&lt;/code&gt; phase, we'll press the purple &lt;code&gt;Add filters to narrow your answer&lt;/code&gt; button and choose &lt;code&gt;State&lt;/code&gt; as the &lt;a href="https://www.metabase.com/glossary/column" rel="noopener noreferrer"&gt;column&lt;/a&gt; to filter by. In the ensuing dropdown, tick the options for &lt;code&gt;WA&lt;/code&gt;, &lt;code&gt;WI&lt;/code&gt;, &lt;code&gt;WV&lt;/code&gt;, and &lt;code&gt;WY&lt;/code&gt;, and then finalize by clicking &lt;code&gt;Add filter&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thx6ngqi0vmzgxvip633.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthx6ngqi0vmzgxvip633.gif" alt="filter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Previewing Results 👓
&lt;/h2&gt;

&lt;p&gt;At any stage, you can use the triangle icon on the right to take a sneak peek at the current results. The gif presented below demonstrates that, following the application of our filter, the individuals hailing from Washington, Wisconsin, West Virginia, or Wyoming are indeed displayed. To exit the preview mode, simply click the &lt;code&gt;X&lt;/code&gt; located at the top right corner of the preview pane.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/noh9u2pb3t45wwlcdmtd.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnoh9u2pb3t45wwlcdmtd.gif" alt="preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summarizing Data 📊
&lt;/h2&gt;

&lt;p&gt;Whenever we use terms like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"How many,"&lt;/li&gt;
&lt;li&gt;"What's the total," or&lt;/li&gt;
&lt;li&gt;"What's the average"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're referring to the process of aggregating our data, essentially speaking of &lt;a href="https://www.metabase.com/glossary/metric" rel="noopener noreferrer"&gt;metrics&lt;/a&gt;. In this scenario, the metric is the total number (or count) of individuals after filtering by the states of Washington, Wisconsin, West Virginia, or Wyoming. In the &lt;code&gt;Summarize&lt;/code&gt; step, we'll select the &lt;code&gt;Pick the metric you want to see&lt;/code&gt; option and choose &lt;code&gt;Count of rows&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Upon selecting &lt;code&gt;Visualize&lt;/code&gt;, Metabase reveals that there are 186 individuals from the specified states. In other words, 186 entries from the &lt;code&gt;People&lt;/code&gt; table passed through our filter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vhrzjsn6r7g8yk6lb3w9.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhrzjsn6r7g8yk6lb3w9.gif" alt="summary"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Grouping Results 🤝
&lt;/h2&gt;

&lt;p&gt;The total count is insightful, yet it becomes more informative if we discern the timeline of our customers' registrations, especially the monthly registration figures within those states.&lt;/p&gt;

&lt;p&gt;To revisit the editor, we can utilize the back button, or select the &lt;code&gt;Editor&lt;/code&gt; icon situated in the top right (symbolized by a bulleted list). We can also stay on the current page and modify our query by clicking the &lt;code&gt;Filter&lt;/code&gt; and &lt;code&gt;Summarize&lt;/code&gt; options.&lt;/p&gt;

&lt;p&gt;To categorize our data by month, we'll choose &lt;code&gt;Summarize&lt;/code&gt;. In the &lt;code&gt;Summarize sidebar&lt;/code&gt; that appears below our metric selection, there's an assortment of columns available for grouping our data. We'll opt for &lt;code&gt;Created At&lt;/code&gt; to sort by the registration date, which will segment our counts of individuals in the specified states by each month, aligned with the registration date (&lt;code&gt;Created_at&lt;/code&gt;). Selecting &lt;code&gt;Created At&lt;/code&gt; prompts Metabase to display a line chart depicting the registration timeline. The &lt;code&gt;Created_At&lt;/code&gt; column defaults to a monthly grouping, but we can alter this by clicking on &lt;code&gt;by month&lt;/code&gt; near &lt;code&gt;Created At&lt;/code&gt; and choosing another timeframe from the dropdown menu.&lt;/p&gt;

&lt;p&gt;Further refinements to our query can be made via the sidebar, or we can return to the full editor view by clicking on the &lt;code&gt;Editor&lt;/code&gt; button. Below is the enhanced query with our new summarization step:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uj8q5njis4amka9d6oe.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uj8q5njis4amka9d6oe.gif" alt="grouping"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Changing the Visualization 🌆
&lt;/h2&gt;

&lt;p&gt;Metabase offers multiple ways to display the solutions to queries. To switch the display style, simply choose from the alternatives within the &lt;code&gt;Visualization sidebar&lt;/code&gt; that appears after you click the &lt;code&gt;Visualization&lt;/code&gt; button located at the page's lower left corner.&lt;/p&gt;

&lt;p&gt;Should you prefer to see the data in a tabular format, you have the option to use the &lt;code&gt;small toggle&lt;/code&gt; situated at the bottom centre of the page. This lets you alternate between the chart view and a data table.&lt;/p&gt;

&lt;p&gt;For additional display types, activate the blue &lt;code&gt;Visualization&lt;/code&gt; button in the lower left corner. For instance, we could represent our query with an &lt;code&gt;area chart&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Certain types of visualizations may not suitably convey the answers to some queries, which is why Metabase may exclude such options in the &lt;code&gt;Other Charts&lt;/code&gt; section. For instance, depicting the aggregate number of individuals from specific states using a &lt;code&gt;Gauge&lt;/code&gt; or &lt;code&gt;Progress&lt;/code&gt; bar would not be appropriate.&lt;/p&gt;

&lt;p&gt;If you wish to experiment with your query, such as altering the states to other values, simply click on the filter tag located beneath the page title.&lt;/p&gt;

&lt;p&gt;To delve deeper into chart options, visit &lt;a href="https://www.metabase.com/learn/visualization" rel="noopener noreferrer"&gt;Visualizing data&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pkrjgmmj58t2e23ifrij.gif" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkrjgmmj58t2e23ifrij.gif" alt="visual"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References 📚
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.metabase.com/docs/latest/installation-and-operation/running-metabase-on-docker#open-source-quick-start" rel="noopener noreferrer"&gt;Running Metabase on Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/desktop/wsl/" rel="noopener noreferrer"&gt;Docker Desktop WSL 2 backend on Windows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.metabase.com/docs/latest/configuring-metabase/setting-up-metabase" rel="noopener noreferrer"&gt;Setting up Metabase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.metabase.com/learn/getting-started/getting-started#the-metabase-home-page" rel="noopener noreferrer"&gt;Getting started with Metabase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.metabase.com/glossary/" rel="noopener noreferrer"&gt;Metabase Data and Business Intelligence Glossary Terms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://chat.openai.com/g/g-IbnI1P0BO-docker-4-0" rel="noopener noreferrer"&gt;Docker 4.0: Author's ChatGPT Builder&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Connect with Me 👨‍💻
&lt;/h2&gt;

&lt;p&gt;If you've enjoyed this Metabase tutorial and wish to stay updated with more insights, tips, or have any queries, feel free to connect with me. Just click the button below to visit my beacons profile and get in touch. I'm always open to discussions and collaborations!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://beacons.ai/ranggakd" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Visit My 👀 Beacons Profile&lt;/a&gt;
&lt;/p&gt;

</description>
      <category>metabase</category>
      <category>datascience</category>
      <category>opensource</category>
      <category>docker</category>
    </item>
    <item>
      <title>Letting Go of One Project to Pursue a Better One</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sat, 04 Nov 2023 14:37:19 +0000</pubDate>
      <link>https://dev.to/ranggakd/letting-go-of-one-project-to-pursue-a-better-one-3401</link>
      <guid>https://dev.to/ranggakd/letting-go-of-one-project-to-pursue-a-better-one-3401</guid>
      <description>&lt;p&gt;Hi, M!&lt;/p&gt;

&lt;h2&gt;
  
  
  Hello Again, Cold World!
&lt;/h2&gt;

&lt;p&gt;Back at it with "&lt;strong&gt;Hello Cold World!&lt;/strong&gt;" as I'm here typing in my room, AC on (no pun intended). For those of you new here, these posts are where I get real with myself, both technically and mentally. The series name? It's a nod to that Paramore song.&lt;/p&gt;

&lt;h2&gt;
  
  
  Letting Go of One Project
&lt;/h2&gt;

&lt;p&gt;So, I stumbled upon this project in the Data Science Community on LinkedIn named &lt;a href="https://runmercury.com/"&gt;Mercury&lt;/a&gt;. It's this slick tool that transforms notebooks into web apps instantly. At first, it seemed promising, but it fell short as a portfolio platform, which was my main goal. It ran smoothly locally, but deploying to their cloud was a different story—debugging became a Herculean task. I even tried shifting it to Azure as a container web app, wrestling with Docker on my laptop, but no dice. After a day spent in debugging purgatory, I waved the white flag on Mercury. It's cool, just not what I need right now. My focus is locking down a data analyst role, and building an app solo just isn't in the cards—I need to invest time elsewhere. For now, I'm diving into their docs, contributing what I can to grasp it better and understand the open-source scene.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pursue a Better One
&lt;/h2&gt;

&lt;p&gt;I'm redirecting my efforts toward mastering Metabase and Amundsen for my Data Analyst path. Plus, there's a final project for my multi-platform Flutter course looming over me. Penning this post is like patting myself on the back for the coding strides I've made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Message from M
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Hit the pavement for a morning stroll now and then, aim for 10-15 minutes. It's like a shot of espresso for the spirit to kick off the day. - M&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>learning</category>
      <category>writing</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Keep Going and Keep Pushing</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Mon, 30 Oct 2023 10:46:01 +0000</pubDate>
      <link>https://dev.to/ranggakd/keep-going-and-keep-pushing-55eg</link>
      <guid>https://dev.to/ranggakd/keep-going-and-keep-pushing-55eg</guid>
      <description>&lt;p&gt;Hi, M!&lt;/p&gt;

&lt;h2&gt;
  
  
  Hello Cold World!
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;It's such a cold, cold world (Hello cold world)&lt;br&gt;
And I can't get out&lt;br&gt;
So I'll just make the best of everything I'll never have&lt;br&gt;
Such a cold, cold world (Hello cold world)&lt;br&gt;
And it's got me down&lt;br&gt;
But I'll get right back up as long as it spins around&lt;br&gt;
Hello cold world&lt;br&gt;
- &lt;strong&gt;Hello Cold World&lt;/strong&gt; by &lt;strong&gt;Paramore&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"Hello Cold World" is a series where I pour out my ongoing thoughts, unfiltered. It's my hope to remain honest with myself through this endeavor. Now, why the name &lt;code&gt;Hello Cold World!&lt;/code&gt;? From my vantage point, whenever I delve into code, I often find myself navigating through a backstage filled with negativity and relentless pursuit of perfection. While I may or may not have delved extensively into the gritty realities of coding and programming, my personal experience has nudged me to air this 'dirty laundry' about learning to code—both effectively and aesthetically—especially for those who strive for perfection in their craft. The chorus from the song, bearing the same name as this series, resonates profoundly with my current situation, not to mention the chilly reality of the world we're navigating at present. It's indeed a cold world extending its hello.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/track/1V8qfqICVnpmex8g9yn1Pc" width="100%" height="80px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  I'm Back, I Guess
&lt;/h2&gt;

&lt;p&gt;For now, immersing myself in productive endeavors is the goal. For instance, creating a pull request to improve the docstring of an open-source software, all while job hunting. Yet, my inner perfectionist—let's name it P—chimes in:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why bother with this PR? It's hardly going to earn you noteworthy accolades for your open-source contribution, let alone secure a job.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;P's words echo loudly, prompting me to drown it out with some music. Despite P's nagging, I persevere, learning the ropes of crafting effective, consistent, and insightful docstrings. While it may not significantly bolster my job prospects, the journey is enriching. So, the grind continues, undeterred by the venom P spits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Message from M
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't forget to make your bed wherever you reside. This simple habit could bear fruit in the long-term, transcending generations. - M&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>learning</category>
      <category>watercooler</category>
      <category>writing</category>
    </item>
    <item>
      <title>Cascade Notation and Fluent Interface in Dart</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sun, 17 Sep 2023 03:42:55 +0000</pubDate>
      <link>https://dev.to/ranggakd/cascade-notation-and-fluent-interface-in-dart-3gc7</link>
      <guid>https://dev.to/ranggakd/cascade-notation-and-fluent-interface-in-dart-3gc7</guid>
      <description>&lt;h2&gt;
  
  
  Question 1
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dart.dev/language/operators#cascade-notation"&gt;Dart documentation&lt;/a&gt; says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cascades (.., ?..) allow you to make a sequence of operations on the same object. In addition to accessing instance members, you can also call instance methods on that same object. This often saves you the step of creating a temporary variable and allows you to write more fluid code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;brake&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Car(color: &lt;/span&gt;&lt;span class="si"&gt;$color&lt;/span&gt;&lt;span class="s"&gt;, speed: &lt;/span&gt;&lt;span class="si"&gt;$speed&lt;/span&gt;&lt;span class="s"&gt;)"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'red'&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Car(color: blue, speed: 110)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The constructor, &lt;code&gt;Car()&lt;/code&gt;, returns a &lt;code&gt;Car&lt;/code&gt; object. The code that follows the cascade notation operates on this object, ignoring any values that might be returned. Here, &lt;code&gt;myCar&lt;/code&gt; is created and then immediately modified using several methods and property setters, all thanks to the cascade notation (..). This allows for a more compact and chained setting of properties and calling of methods on the &lt;code&gt;myCar&lt;/code&gt; object.&lt;/p&gt;

&lt;p&gt;The previous example is equivalent to this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;brake&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Car(color: &lt;/span&gt;&lt;span class="si"&gt;$color&lt;/span&gt;&lt;span class="s"&gt;, speed: &lt;/span&gt;&lt;span class="si"&gt;$speed&lt;/span&gt;&lt;span class="s"&gt;)"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'red'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: Car(color: blue, speed: 110)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the differences:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-  Car myCar = Car()
-    ..color = 'red'
-    ..speed = 100
-    ..accelerate()
-    ..repaint('blue');
&lt;/span&gt;&lt;span class="gi"&gt;+  Car myCar = Car();
+  myCar.color = 'red';
+  myCar.speed = 100;
+  myCar.accelerate();
+  myCar.repaint('blue');
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This reminds me of &lt;a href="https://github.com/ranggakd/clean-code-php/tree/pr_only#avoid-fluent-interfaces"&gt;Fluent Interface&lt;/a&gt; after fork clean-code-php repo a while ago.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;a href="https://en.wikipedia.org/wiki/Fluent_interface"&gt;Fluent interface&lt;/a&gt; is an object-oriented API that aims to improve the readability of the source code by using &lt;a href="https://en.wikipedia.org/wiki/Method_chaining"&gt;Method chaining&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I asked ChatGPT for direction.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is the concept of fluent interface the same as cascade notation in Dart?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ChatGPT Reply 1
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Both the concept of a fluent interface and Dart's cascade notation (&lt;code&gt;..&lt;/code&gt;) aim to make code more readable and convenient by allowing method calls or operations to be chained together. &lt;strong&gt;However, they are not exactly the same thing.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Fluent Interface
&lt;/h3&gt;

&lt;p&gt;In a fluent interface, each method &lt;strong&gt;returns an instance of the object, allowing you to chain method calls together.&lt;/strong&gt; A fluent API is designed specifically to return &lt;code&gt;this&lt;/code&gt; or a new instance of the same class, making it possible to chain methods.&lt;/p&gt;

&lt;p&gt;Here's an example using a hypothetical &lt;code&gt;Car&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;brake&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;'Car(color: &lt;/span&gt;&lt;span class="si"&gt;$color&lt;/span&gt;&lt;span class="s"&gt;, speed: &lt;/span&gt;&lt;span class="si"&gt;$speed&lt;/span&gt;&lt;span class="s"&gt;)'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;brake&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Output: Car(color: blue, speed: 0)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cascade Notation
&lt;/h3&gt;

&lt;p&gt;Dart's cascade notation allows you to &lt;strong&gt;perform multiple operations on a single object without the need for the methods to return &lt;code&gt;this&lt;/code&gt;.&lt;/strong&gt; When you use the cascade notation, Dart knows to use the same object for each subsequent operation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;brake&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Output: Car(color: blue, speed: 0)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A fluent interface is a design pattern where the methods are designed to be chained together.&lt;/li&gt;
&lt;li&gt;Cascade notation is a language feature in Dart that allows you to chain multiple operations on an object, whether or not the methods are designed to be chained together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both achieve a similar goal but do it in slightly different ways. Fluent interfaces are more common in languages that don't have an equivalent to Dart's cascade notation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intermezzo
&lt;/h2&gt;

&lt;p&gt;That's a good answer actually. So I moved on and read the next line from the &lt;a href="https://dart.dev/language/operators#cascade-notation"&gt;Dart documentation&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If the object that the cascade operates on can be null, then use a &lt;em&gt;null-shorting&lt;/em&gt; cascade (?..) for the first operation. Starting with ?.. guarantees that none of the cascade operations are attempted on that null object.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm using my own code to understand this (probably a poor example but I get what the docs trying to say)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'red'&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: null&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The previous code is equivalent to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'red'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myCar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: null&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the differences:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;  var myCar;
&lt;span class="gd"&gt;-  myCar
-    ?..color = 'red'
-    ..speed = 100
-    ..accelerate()
-    ..repaint('blue');
&lt;/span&gt;&lt;span class="gi"&gt;+  myCar?.color = 'red';
+  myCar?.speed = 100;
+  myCar?.accelerate();
+  myCar?.repaint('blue');
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Question 2
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://dart.dev/language/operators#cascade-notation"&gt;Dart documentation&lt;/a&gt; says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Be careful to construct your cascade on a function that returns an actual object. For example, the following code fails:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StringBuffer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'foo'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'bar'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: method 'write' isn't defined for 'void'.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I don't really get it since my all methods are void indeed. So I asked ChatGPT again.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What do the docs mean by the void? Meanwhile, the previous snippet of code worked just fine with the void function.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  ChatGPT Reply 2
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;The documentation is warning you that you cannot use cascade notation on a function or method that returns &lt;code&gt;void&lt;/code&gt;. This is because the cascade notation works by treating the value returned by each cascaded operation as the object to perform the next operation on. In the case of methods that return &lt;code&gt;void&lt;/code&gt;, there is no value to cascade onto.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, you'll notice that &lt;strong&gt;your Dart example works&lt;/strong&gt; because &lt;strong&gt;you're not actually cascading on the return value of the &lt;code&gt;void&lt;/code&gt; methods (&lt;code&gt;accelerate&lt;/code&gt;, &lt;code&gt;brake&lt;/code&gt;, &lt;code&gt;repaint&lt;/code&gt;)&lt;/strong&gt;. You're cascading on &lt;strong&gt;the original &lt;code&gt;Car&lt;/code&gt; object (&lt;code&gt;myCar&lt;/code&gt;)&lt;/strong&gt; which the &lt;strong&gt;cascade notation keeps "in focus" throughout the chained operations.&lt;/strong&gt; In this context, &lt;code&gt;void&lt;/code&gt; methods are permitted because they're not breaking the cascade; the &lt;strong&gt;cascade remains rooted in &lt;code&gt;myCar&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, this would be problematic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// This is an attempt to cascade on the result of accelerate(),&lt;/span&gt;
  &lt;span class="c1"&gt;// but that's void, so this will result in a syntax error.&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;brake&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Error&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in your working example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="n"&gt;myCar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'red'&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accelerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;repaint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'blue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are setting &lt;strong&gt;the initial object for the cascade to &lt;code&gt;Car()&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;the cascade continues to operate on that object, not on the return values of the &lt;code&gt;void&lt;/code&gt; methods.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, in summary, you can include &lt;code&gt;void&lt;/code&gt; methods within a cascade, as long as you're still rooted in an object that isn't &lt;code&gt;void&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>dart</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>Hoisting: Does the Order Matter for Functions in Dart (and Python)?</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sun, 17 Sep 2023 03:07:49 +0000</pubDate>
      <link>https://dev.to/ranggakd/hoisting-does-the-order-matter-for-functions-in-dart-and-python-35gk</link>
      <guid>https://dev.to/ranggakd/hoisting-does-the-order-matter-for-functions-in-dart-and-python-35gk</guid>
      <description>&lt;h2&gt;
  
  
  Question 1
&lt;/h2&gt;

&lt;p&gt;I wonder if the order matters for the declaration of functions in Dart. So I asked ChatGPT on this one. Let's suppose this code exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Hello!'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If I swap the order, does the Dart program throw an error or work just fine?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ChatGPT Reply 1
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;In Dart, the order in which functions are declared does not matter. Dart supports hoisting, which means you can call a function before its declaration in the code file. The following two versions of the code are equivalent:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Version 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Hello!'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Version 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Hello!'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both versions will produce the same output ("Hello!") when executed. You can define &lt;code&gt;main()&lt;/code&gt; before &lt;code&gt;greet()&lt;/code&gt; or vice versa; the Dart compiler will correctly identify and link the function calls no matter the order.&lt;/p&gt;

&lt;p&gt;However, this principle applies to top-level functions and does not extend to local functions (functions declared within other functions). Local functions must be declared before they are called within their containing function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Question 2
&lt;/h2&gt;

&lt;p&gt;Since I come from Python I try to ask this as well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does Python support hoisting as well?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ChatGPT Reply 2
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;No, Python does not support hoisting in the way that languages like Dart or JavaScript do. In Python, you must define a function before you call it. Consider the following example:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This will raise an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The error will state that &lt;code&gt;say_hello&lt;/code&gt; is not defined because Python will not have seen the definition of &lt;code&gt;say_hello&lt;/code&gt; by the time it tries to call it.&lt;/p&gt;

&lt;p&gt;However, the following will work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;say_hello&lt;/code&gt; is defined before it is called, so the Python interpreter knows what to do when &lt;code&gt;say_hello()&lt;/code&gt; is encountered.&lt;/p&gt;

&lt;p&gt;Classes and functions need to be defined before they are used in the Python code execution flow. If you attempt to use a function or class before declaring it, you will get a &lt;code&gt;NameError&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Question 3
&lt;/h1&gt;

&lt;p&gt;This answer doesn't necessarily address my intention since I can work with unorder methods (not functions even though methods behave like functions in a bit). So I ask the following question.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does hoisting work in method instead of function in Python?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  ChatGPT Reply 3
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;In Python, the concept of hoisting doesn't apply to either functions or methods. All names (variables, functions, methods, classes, etc.) must be defined before they are used, regardless of whether they are part of a class (as methods) or stand-alone functions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are some examples to clarify:&lt;/p&gt;

&lt;h3&gt;
  
  
  Functions
&lt;/h3&gt;

&lt;p&gt;This will &lt;strong&gt;not&lt;/strong&gt; work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;call_function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call_function&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Function called."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call_function&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Function called."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;call_function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Methods
&lt;/h3&gt;

&lt;p&gt;This will &lt;strong&gt;not&lt;/strong&gt; work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method two called."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Create an instance
&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Call method_one (which in turn calls method_two)
&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# This will work because method_two is defined before it is called
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will work, but the order in which the methods are defined within the class doesn't matter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method two called."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Create an instance
&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Call method_one (which in turn calls method_two)
&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# This will work because method_two is defined in the class before it is called
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, in Python, what matters is that the function or method is defined before it is used, not the order in which they are written in the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Question 4
&lt;/h2&gt;

&lt;p&gt;The previous reply did contradict itself. So I complain.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Still don't understand this "This will work, &lt;strong&gt;but the order in which the methods are defined within the class doesn't matter&lt;/strong&gt;:". If the order doesn't matter, the first code of the block of the method should work just fine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ChatGPT Reply 4
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;I apologize for the confusion. My explanation was unclear. You are correct that &lt;strong&gt;the order of method definitions within a class in Python doesn't matter. All methods within a class are available once the class definition is complete, regardless of the order in which they are defined.&lt;/strong&gt; Therefore, you can indeed call any method from any other method in the same class, regardless of their order.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The first block of code with methods should work fine because both &lt;code&gt;method_one&lt;/code&gt; and &lt;code&gt;method_two&lt;/code&gt; are defined in the class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method two called."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Create an instance
&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Call method_one (which in turn calls method_two)
&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# This will work because method_two is defined before it is called
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the order of &lt;code&gt;method_one&lt;/code&gt; and &lt;code&gt;method_two&lt;/code&gt; doesn't matter; both will work as expected regardless of which one is defined first. Thank you for catching that mistake, and I apologize for the oversight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Question 5
&lt;/h2&gt;

&lt;p&gt;I just need to clarify this time.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So hoisting work only for methods within class?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ChatGPT Reply 5
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The concept of "hoisting" doesn't strictly apply to Python methods in the same way it does for variables and functions in languages like JavaScript. In Python, both functions and methods need to be defined before they are called, but within a class definition, methods are all available to each other regardless of their order in the source code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the following example, both &lt;code&gt;method_one&lt;/code&gt; and &lt;code&gt;method_two&lt;/code&gt; are part of the class definition, and they can call each other regardless of the order in which they appear:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_one&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;method_two&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Method two called."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This "availability" of methods within the same class isn't typically described as hoisting in Python. Rather, it's a feature of how Python's object-oriented system works. All methods within a class are available to each other once the class definition is complete, regardless of their order of definition.&lt;/p&gt;

</description>
      <category>dart</category>
      <category>python</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>I hold back on job applications, compensating with tech dev blogging and ongoing side projects – this ain't effective innit?</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Fri, 15 Sep 2023 13:25:32 +0000</pubDate>
      <link>https://dev.to/ranggakd/i-hold-back-on-job-applications-compensating-with-tech-dev-blogging-and-ongoing-side-projects-this-aint-effective-innit-4f1j</link>
      <guid>https://dev.to/ranggakd/i-hold-back-on-job-applications-compensating-with-tech-dev-blogging-and-ongoing-side-projects-this-aint-effective-innit-4f1j</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I am a Python programmer. I consider myself a jack of all trades, but I tend to work on data-related or AI projects over software engineering. The thing is, I feel like I cannot see my own strengths. I don't feel like I meet the job market's skills when I apply for a job. I cope with it by writing a lot of tech dev posts, if they are ever considered as proper portfolios. Before writing, I need to practice the technical aspect of it, which both takes a long time. My main problem now is that I back off from applying to jobs since I still cannot convince myself that I am enough for the job market. I make up for that by writing tech blogs and finishing perpetual side projects as portfolios, which also take a long time. I don't even have the courage to find a client as a freelancer, although I successfully finished one freelance job last month. I know my approach is not effective and is more like escaping at this point. &lt;strong&gt;If you were in my shoes, what would you do to solve this mess?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>discuss</category>
      <category>career</category>
    </item>
    <item>
      <title>Exploring Steganography in the Wild - Part 1</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Tue, 12 Sep 2023 07:36:19 +0000</pubDate>
      <link>https://dev.to/ranggakd/exploring-steganography-in-the-wild-part-1-5hll</link>
      <guid>https://dev.to/ranggakd/exploring-steganography-in-the-wild-part-1-5hll</guid>
      <description>&lt;h2&gt;
  
  
  
  Outlines
  &lt;ul&gt;
&lt;li&gt;
Introduction

&lt;ul&gt;
&lt;li&gt;Steganography&lt;/li&gt;
&lt;li&gt;Digital Images and Pixels&lt;/li&gt;
&lt;li&gt;Color Models&lt;/li&gt;
&lt;li&gt;Binary Code&lt;/li&gt;
&lt;li&gt;What To Expect&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Project Setup&lt;/li&gt;
&lt;li&gt;
Core Concepts

&lt;ul&gt;
&lt;li&gt;Mapping Techniques&lt;/li&gt;
&lt;li&gt;Bit Manipulation for Hiding Images&lt;/li&gt;
&lt;li&gt;Bit Manipulation for Revealing Images&lt;/li&gt;
&lt;li&gt;Bit Manipulation for Reconstructing Images&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Implementation Details

&lt;ul&gt;
&lt;li&gt;Supported Image Formats&lt;/li&gt;
&lt;li&gt;Code Structure&lt;/li&gt;
&lt;li&gt;Explanation of Helper Functions&lt;/li&gt;
&lt;li&gt;Explanation of Steganograph Class&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Results and Visualization

&lt;ul&gt;
&lt;li&gt;Visual Examples of Pre-Encoded Images&lt;/li&gt;
&lt;li&gt;Visual Examples of Encoded Images&lt;/li&gt;
&lt;li&gt;Visual Examples of Decoded Images&lt;/li&gt;
&lt;li&gt;Visual Examples of Reconstructed Images&lt;/li&gt;
&lt;li&gt;Evaluation Metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Limitations and Future Work&lt;/li&gt;
&lt;li&gt;
Conclusion

&lt;ul&gt;
&lt;li&gt;Summing Up the Journey&lt;/li&gt;
&lt;li&gt;Technical Achievements&lt;/li&gt;
&lt;li&gt;Key Takeaways&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Additional Sections
&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;/h2&gt;
&lt;p&gt;Welcome to a fascinating exploration of steganography and its applications. Steganography is a technique often cloaked in mystery, yet it serves practical purposes that extend from cybersecurity to digital watermarking. In this blog post, we'll delve into the nitty-gritty details of how steganography is applied to digital images.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steganography
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Steganography is the practice of representing information within another message or physical object, in such a manner that the presence of the information is not evident to human inspection - &lt;a href="https://en.wikipedia.org/wiki/Steganography" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simpler terms, steganography is akin to embedding a covert message within another overt message—in our case, hiding one image within another. &lt;/p&gt;

&lt;h3&gt;
  
  
  Digital Images and Pixels
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A digital image is an image composed of picture elements, also known as pixels, each with finite, discrete quantities of numeric representation for its intensity or gray level that is an output from its two-dimensional functions fed as input by its spatial coordinates denoted with x, y on the x-axis and y-axis, respectively - &lt;a href="https://en.wikipedia.org/wiki/Digital_image" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine a digital image as an intricate mosaic composed of minuscule tiles, known as pixels. Each pixel contributes to the overall image by adding its own splash of color. The more pixels you have, the more vivid and detailed your image becomes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Color Models
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Color models are tools central to color theory that define the color spectrum based on presence or absence of a few primary colors - &lt;a href="https://onlinelibrary.wiley.com/doi/epdf/10.1002/rth2.12308" rel="noopener noreferrer"&gt;onlinelibrary.wiley.com&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of color models as the recipe books for digital artists. Just like mixing primary colors in art class, color models help us understand how to blend different amounts of red, green, and blue light to produce various hues. In this discussion, we'll focus on the RGB (Red-Green-Blue) color model, which is the cornerstone for reproducing a wide array of colors in digital media.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The name of the model comes from the initials of the three additive primary colors, red, green, and blue. The main purpose of the RGB color model is for the sensing, representation, and display of images in electronic systems, such as televisions and computers - &lt;a href="https://en.wikipedia.org/wiki/RGB_color_model" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Binary Code
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Binary code is a system of representing information using only two symbols, typically 0 and 1 - &lt;a href="https://www.britannica.com/technology/binary-code" rel="noopener noreferrer"&gt;Britannica&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the realm of digital images, each pixel's color information is represented by 8-bit binary digits. This means each pixel can display one of (2^8) or 256 possible colors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq41hsl3rg4dgdfbk98lo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq41hsl3rg4dgdfbk98lo.png" alt="8 bit binary digit"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In computing, the most significant bit (MSb) represents the highest-order place of a binary integer. Similarly, the least significant bit (LSb) is the bit position in a binary integer representing the binary 1s place of the integer - &lt;a href="https://en.wikipedia.org/wiki/Bit_numbering" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The concept of most significant bit (MSb) and least significant bit (LSb) is crucial here. Altering the MSb can have a profound impact on a pixel's color, while changes to the LSb are usually subtle.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;leftmost bit&lt;/strong&gt; is the &lt;strong&gt;most significant bit&lt;/strong&gt;. We change this bit and it will affect tremendously on the value. For example, we flip the leftmost bit of the binary value of 165 from &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; (from 10100101 into 00100101) it will change the decimal value from 165 into 37.&lt;/p&gt;

&lt;p&gt;On the other hand, the &lt;strong&gt;rightmost bit&lt;/strong&gt; is the &lt;strong&gt;least significant bit&lt;/strong&gt;. We change this bit and it won't affect tremendously on the value. For example, we flip the rightmost bit of the binary value of 165 from &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; (from &lt;code&gt;10100101&lt;/code&gt; into &lt;code&gt;10100100&lt;/code&gt;) it will change the decimal value from 165 into 164.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75wnkg7oqf56ltb5zl4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75wnkg7oqf56ltb5zl4u.png" alt="pixels"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, let's tie it all together: each pixel in a digital image comprises three color values (RGB), each represented by an 8-bit binary digit. We'll exploit the "insignificance" of the least significant bits to embed one image into another without causing noticeable changes to the host image. This is the magic key to image-based steganography. We'll change the &lt;strong&gt;less significant bits&lt;/strong&gt; of one image to include the &lt;strong&gt;most significant bits&lt;/strong&gt; of another.&lt;/p&gt;

&lt;h3&gt;
  
  
  What To Expect
&lt;/h3&gt;

&lt;p&gt;In this technical dev blog post, you'll find:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A deep dive into &lt;strong&gt;steganography&lt;/strong&gt;, particularly the art of concealing one image within another.&lt;/li&gt;
&lt;li&gt;A focus on &lt;strong&gt;LSB steganography&lt;/strong&gt;, which involves manipulating the least significant bits of pixels in a cover image to hide another image.&lt;/li&gt;
&lt;li&gt;Practical &lt;strong&gt;code examples&lt;/strong&gt; and vivid &lt;strong&gt;visualizations&lt;/strong&gt; to help you understand the process of hiding and retrieving images.&lt;/li&gt;
&lt;li&gt;A discussion on the &lt;strong&gt;challenges&lt;/strong&gt; and &lt;strong&gt;limitations&lt;/strong&gt; one might encounter, such as the quality of the concealed image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, buckle up for an exciting journey through the world of steganography!&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Setup
&lt;/h2&gt;

&lt;p&gt;Before diving into the technicalities of steganography, it's essential to set up your workspace properly. This ensures that you can effortlessly follow along with the examples and get the most out of this exploration. Whether you're a seasoned coder or just dipping your toes into the Python ecosystem, I've got you covered.&lt;/p&gt;

&lt;p&gt;I've created a Google Colab-compatible Jupyter Notebook to make this process seamless. The notebook is designed with a user-friendly UI/UX and hides the raw code, so you can focus on learning. And the best part? The code is pre-validated to run without hitches on the first try!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://colab.research.google.com/github/ranggakd/steganography/blob/main/Exploring_Steganography_In_The_Wild_Part_1.ipynb" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Open in Colab&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;If you're new to Google Colab or Python in general, don't worry! Here's an introductory &lt;a href="https://www.youtube.com/watch?v=RLYoEyIHL6A" rel="noopener noreferrer"&gt;video on Google Colab for Beginners&lt;/a&gt; to help you get started.&lt;/p&gt;

&lt;p&gt;For those who are more experienced and might prefer to run the project locally, here are the Python package requirements to set up your environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Python 3.7.12
matplotlib==3.2.2
matplotlib-inline==0.1.3
matplotlib-venn==0.11.6
numpy==1.21.5
Pillow==7.1.2
scikit-learn==1.0.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once you have your environment set up, you'll be ready to delve into the world of steganography with me!&lt;/p&gt;
&lt;h2&gt;
  
  
  Core Concepts
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Mapping Techniques
&lt;/h3&gt;

&lt;p&gt;Before diving into the nitty-gritty details, it's crucial to understand the four types of binary value mappings that we'll be using:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Left-Half Bits Mapping (LHB Map)&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8waj507ym60iv90kkmn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8waj507ym60iv90kkmn.png" alt="left half bits"&gt;&lt;/a&gt;&lt;br&gt;
Think of this mapping as a way to extract the &lt;strong&gt;left-half bits&lt;/strong&gt; values from the &lt;strong&gt;cover image&lt;/strong&gt; within the &lt;strong&gt;merged image&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Right-Half Bits Mapping (RHB Map)&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdvnm9ww1skc8m87ddly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdvnm9ww1skc8m87ddly.png" alt="right half bits"&gt;&lt;/a&gt;&lt;br&gt;
This mapping aims to extract the &lt;strong&gt;left-half bits&lt;/strong&gt; values of the &lt;strong&gt;hidden image&lt;/strong&gt; from the &lt;strong&gt;merged image&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Whole Bits Mapping (MB Map)&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folbs0eakha61k7js5mn2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folbs0eakha61k7js5mn2.png" alt="merged bits"&gt;&lt;/a&gt;&lt;br&gt;
This mapping is utilized to construct the &lt;strong&gt;whole bits&lt;/strong&gt; values of the &lt;strong&gt;merged image&lt;/strong&gt;, using the &lt;strong&gt;left-half bits&lt;/strong&gt; values from both the &lt;strong&gt;cover&lt;/strong&gt; and &lt;strong&gt;hidden images&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Possible Right-Half Bits Mapping (RRHB Map)&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6cgi1flq2ia5u17wn8g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6cgi1flq2ia5u17wn8g.png" alt="reconstruction bits"&gt;&lt;/a&gt;&lt;br&gt;
In this case, we'll &lt;strong&gt;randomly&lt;/strong&gt; pick possible &lt;strong&gt;half bits values&lt;/strong&gt; as we don't store the information about the half bits beforehand. The aim here is to construct the &lt;strong&gt;right-half bits&lt;/strong&gt; values of the &lt;strong&gt;unmerged left-half bits&lt;/strong&gt; image for &lt;strong&gt;both the unmerged cover&lt;/strong&gt; and &lt;strong&gt;hidden images&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Bit Manipulation for Hiding Images
&lt;/h3&gt;

&lt;p&gt;Now that we've understood the mapping types, let's look at how these mappings play a crucial role in hiding—or encoding—one image within another.&lt;/p&gt;
&lt;h4&gt;
  
  
  Encoding Process
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm31fxuw51jexpya6d7av.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm31fxuw51jexpya6d7av.png" alt="encode flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a summarized flow of the encoding process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Choose Images&lt;/strong&gt;: Initially, you have to pick two images:

&lt;ul&gt;
&lt;li&gt;A "Cover Image," which will serve as the shell where your secret image will reside.&lt;/li&gt;
&lt;li&gt;A "Hidden Image," which is the secret image you wish to hide within the cover image.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extract and Map LHB (Left-Half Bits)&lt;/strong&gt;: The "Hidden Image" undergoes LHB (Left-Half Bits) Mapping. This extracts the left-half bits from the hidden image and maps them to create a new image called "Left-half bits Hidden Image."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Position the New Image&lt;/strong&gt;: The "Left-half bits Hidden Image" is then positioned within the "Cover Image" according to specified criteria (e.g., upper left corner, lower right corner, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge&lt;/strong&gt;: Finally, the "Cover Image" and the positioned "Left-half bits Hidden Image" are merged together. This forms the "Merged Image," which looks like your original cover image but has the hidden image embedded within it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Bit Manipulation for Revealing Images
&lt;/h3&gt;

&lt;p&gt;Let's shift our focus to how we can extract—or decode—the hidden image from the merged image.&lt;/p&gt;
&lt;h4&gt;
  
  
  Decoding Process
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few4ma9azc97n0a6kqezy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few4ma9azc97n0a6kqezy.png" alt="decode flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a quick rundown of the decoding process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Merged Image&lt;/strong&gt;: The initial step in decoding involves taking the "Merged Image," which contains both the "Cover Image" and the "Hidden Image."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extract Bits&lt;/strong&gt;: The "Merged Image" is then divided into its component "left-half bits" (LHB) and "right-half bits" (RHB). These are different portions of the image's pixel data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve Images&lt;/strong&gt;: The "left-half bits" are used to reconstruct an "Unmerged Left-half bits Cover Image," effectively extracting what used to be the cover image. Note that the right-half bits for this image are still zero. The "right-half bits" are used to reconstruct a "Unmerged Left-half bits Hidden Image," effectively extracting what used to be the hidden image, also with zero right-half bits. The position of this hidden image within the merged image is accounted for during this step.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Bit Manipulation for Reconstructing Images
&lt;/h3&gt;

&lt;p&gt;Finally, let's look at how we can reconstruct the original images from their half-bit versions.&lt;/p&gt;
&lt;h4&gt;
  
  
  Reconstruction Process
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5zdbnnx5ecxm361s44v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5zdbnnx5ecxm361s44v.png" alt="reconstruction flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's how the reconstruction process works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Unmerged Bits&lt;/strong&gt;: Use the unmerged left-half bits of both the cover and hidden images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Map Right-Half Bits&lt;/strong&gt;: Use the "RRHB Mapping" to generate possible right-half bits values randomly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reconstruct Images&lt;/strong&gt;: The result is a reconstructed cover and hidden image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope these explanations provide a clearer understanding of the steganography techniques involved in hiding, revealing, and reconstructing images.&lt;/p&gt;
&lt;h2&gt;
  
  
  Implementation Details
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Supported Image Formats
&lt;/h3&gt;

&lt;p&gt;In this exploration, we'll limit our focus to only two image formats: PNG and JPEG. This limitation helps keep our exploration straightforward.&lt;/p&gt;
&lt;h3&gt;
  
  
  Code Structure
&lt;/h3&gt;

&lt;p&gt;Before diving into the code's functionality, it's essential to get a grasp of its structure. Below is a snippet that outlines the main components of the code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
├── get_bits_dict&lt;span class="o"&gt;(&lt;/span&gt;start: int, end: int, recon: bool &lt;span class="o"&gt;=&lt;/span&gt; False&lt;span class="o"&gt;)&lt;/span&gt; -&amp;gt; Dict[int, int]
├── get_merged_bits_array&lt;span class="o"&gt;()&lt;/span&gt; -&amp;gt; np.ndarray
├── dict_to_nparray&lt;span class="o"&gt;(&lt;/span&gt;d: dict&lt;span class="o"&gt;)&lt;/span&gt; -&amp;gt; np.ndarray
├── dict_to_2darray&lt;span class="o"&gt;(&lt;/span&gt;d: dict&lt;span class="o"&gt;)&lt;/span&gt; -&amp;gt; np.ndarray
└── Steganograph
    ├── Object Attributes
    │     ├── ispng: bool
    │     ├── original_cover_image: numpy array
    │     ├── original_hidden_image: numpy array
    │     ├── left_half_bits_hidden_image: numpy array, default None
    │     ├── merged_image: numpy array, default None
    │     ├── unmerged_left_half_bits_cover_image: numpy array, default None
    │     ├── unmerged_left_half_bits_hidden_image: numpy array, default None
    │     ├── reconstructed_cover_image: numpy array, default None
    │     └── reconstructed_hidden_image: numpy array, default None
    ├──── Methods
    │     ├── encode&lt;span class="o"&gt;(&lt;/span&gt;pos: str &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'upper_left'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    │     ├── decode&lt;span class="o"&gt;(&lt;/span&gt;pos: str &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'upper_left'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    │     ├── encode_decode&lt;span class="o"&gt;(&lt;/span&gt;pos: str &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'upper_left'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    │     ├── reconstruct&lt;span class="o"&gt;()&lt;/span&gt;
    │     ├── encode_decode_recon&lt;span class="o"&gt;(&lt;/span&gt;pos: str &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'upper_left'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    │     ├── is_two_images_identical&lt;span class="o"&gt;(&lt;/span&gt;opt: int &lt;span class="o"&gt;=&lt;/span&gt; 0&lt;span class="o"&gt;)&lt;/span&gt; -&amp;gt; bool
    │     ├── save_image&lt;span class="o"&gt;(&lt;/span&gt;opt: int &lt;span class="o"&gt;=&lt;/span&gt; 0&lt;span class="o"&gt;)&lt;/span&gt;
    │     ├── plot_original&lt;span class="o"&gt;()&lt;/span&gt;
    │     ├── plot_left_half_bits&lt;span class="o"&gt;()&lt;/span&gt;
    │     ├── plot_merged_image&lt;span class="o"&gt;()&lt;/span&gt;
    │     ├── plot_unmerged_left_half_bits&lt;span class="o"&gt;()&lt;/span&gt;
    │     └── plot_recon&lt;span class="o"&gt;()&lt;/span&gt;
    └──── Class Attributes
          ├── __lhb_lookup: lhb &lt;span class="c"&gt;#Left half bits array lookup&lt;/span&gt;
          ├── __rhb_lookup: rhb &lt;span class="c"&gt;#Right half bits array lookup&lt;/span&gt;
          ├── __mb_lookup: mb &lt;span class="c"&gt;#Merged bits 2D array lookup&lt;/span&gt;
          ├── __rrhb_lookup: rrhb &lt;span class="c"&gt;#Reconstruction right half bits dict lookup&lt;/span&gt;
          ├── __format: tuple &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'jpeg'&lt;/span&gt;, &lt;span class="s1"&gt;'png'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
          ├── __rgb: tuple &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'RGB'&lt;/span&gt;, &lt;span class="s1"&gt;'Red'&lt;/span&gt;, &lt;span class="s1"&gt;'Green'&lt;/span&gt;, &lt;span class="s1"&gt;'Blue'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
          └── __pos: tuple &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'upper_left'&lt;/span&gt;, &lt;span class="s1"&gt;'upper_right'&lt;/span&gt;, &lt;span class="s1"&gt;'lower_left'&lt;/span&gt;, &lt;span class="s1"&gt;'lower_right'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Explanation of Helper Functions
&lt;/h3&gt;

&lt;p&gt;The code incorporates several helper functions tailored for the art of steganography. Here's a brief rundown:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;get_bits_dict&lt;/strong&gt;: This function produces a dictionary that maps an integer (ranging from 0 to 255) to another integer. The mapping varies based on whether the process is for reconstruction. In the standard case, it extracts the &lt;strong&gt;left-half bits&lt;/strong&gt;, whereas for reconstruction, it extracts the &lt;strong&gt;right-half bits&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;strong&gt;dict_to_nparray&lt;/strong&gt;: Converting the dictionary from &lt;code&gt;get_bits_dict&lt;/code&gt; into a numpy array facilitates faster lookup operations.&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;strong&gt;get_merged_bits_array&lt;/strong&gt;: This function constructs a 2D array where each cell at index &lt;code&gt;[i][j]&lt;/code&gt; holds the merged &lt;strong&gt;left-half bits (cover image)&lt;/strong&gt; of &lt;code&gt;i&lt;/code&gt; and &lt;strong&gt;the left-half bits (hidden image)&lt;/strong&gt; of &lt;code&gt;j&lt;/code&gt;.&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;strong&gt;dict_to_2darray&lt;/strong&gt;: This works similarly to &lt;code&gt;dict_to_nparray&lt;/code&gt;, but it reshapes the array into a 2D structure, particularly useful for image reconstruction.&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Respective function callings for later&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Generates a numpy array for quick look-up of the left-half bits of a given number.&lt;/li&gt;
&lt;li&gt;Creates a numpy array for speedy retrieval of the right-half bits of a number.&lt;/li&gt;
&lt;li&gt;Constructs a 2D numpy array for efficient look-up of the merged bits of two numbers.&lt;/li&gt;
&lt;li&gt;Builds a 2D numpy array for quick reference of the right-half bits of a number during the reconstruction phase.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  Explanation of Steganograph Class
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Explanation of the &lt;code&gt;__init__&lt;/code&gt; Method:
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;__init__&lt;/code&gt; method initializes an instance of the &lt;code&gt;Steganograph&lt;/code&gt; class.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h5&gt;
  
  
  Parameters:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cover_image_filepath&lt;/code&gt;: File path for the cover image (supports only JPEG or PNG formats).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hidden_image_filepath&lt;/code&gt;: File path for the hidden image (supports only JPEG or PNG formats).&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Steps:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Determine Image Formats&lt;/strong&gt;: The method first determines the format (JPEG or PNG) of both the cover image and the hidden image using the &lt;code&gt;imghdr.what()&lt;/code&gt; function. The formats are stored in &lt;code&gt;format_ci&lt;/code&gt; and &lt;code&gt;format_hi&lt;/code&gt; variables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validation&lt;/strong&gt;: It checks whether both images have valid formats. If the formats don't match any in the class' &lt;code&gt;__format&lt;/code&gt; attribute, it raises a &lt;code&gt;TypeError&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Format Uniformity&lt;/strong&gt;: It checks if both images have the same format. If not, it raises a &lt;code&gt;TypeError&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PNG Format Flag&lt;/strong&gt;: Sets the &lt;code&gt;ispng&lt;/code&gt; flag to True if the format is PNG; otherwise, sets it to False.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Read Images&lt;/strong&gt;: Reads the images into &lt;code&gt;original_cover_image&lt;/code&gt; and &lt;code&gt;original_hidden_image&lt;/code&gt; using the &lt;code&gt;plt.imread()&lt;/code&gt; function from Matplotlib.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Invoke &lt;code&gt;read_and_adjust_images&lt;/code&gt;&lt;/strong&gt;: Calls the method &lt;code&gt;read_and_adjust_images()&lt;/code&gt; to perform additional adjustments on the images.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set Initial States&lt;/strong&gt;: Initializes the other attributes to None, as these would be populated by other methods later.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Explanation of the &lt;code&gt;read_and_adjust_images&lt;/code&gt; Method:
&lt;/h4&gt;

&lt;p&gt;This method adjusts the read images for further processing, especially for PNG images. By the end of these methods, the class instance is well-prepared with loaded and adjusted images, and is ready for encoding and decoding operations.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h5&gt;
  
  
  Steps:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check if PNG&lt;/strong&gt;: If the images are in PNG format (&lt;code&gt;ispng&lt;/code&gt; is True):

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ignore Alpha Channel&lt;/strong&gt;: If the images have an alpha (A) channel, it ignores it for now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normalization&lt;/strong&gt;: PNG images are often read in a normalized format where the pixel values are floats between 0 and 1. This method multiplies them by 255 and rounds off to convert them to integers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type Casting&lt;/strong&gt;: It then casts the numpy arrays to 'uint8' type, ensuring that they are 8-bit unsigned integers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Explanation of the &lt;code&gt;encode&lt;/code&gt; Method:
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;encode&lt;/code&gt; method is responsible for creating a simple steganograph—merging a hidden image into a cover image in a way that it can later be extracted.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h5&gt;
  
  
  Parameters:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pos&lt;/code&gt;: Specifies where the hidden image will be located in relation to the cover image. Default is &lt;code&gt;'upper_left'&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Steps:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Position Validation&lt;/strong&gt;: It validates whether the given position &lt;code&gt;pos&lt;/code&gt; is one of the four pre-defined positions (&lt;code&gt;upper_left&lt;/code&gt;, &lt;code&gt;upper_right&lt;/code&gt;, &lt;code&gt;lower_left&lt;/code&gt;, &lt;code&gt;lower_right&lt;/code&gt;). If not, it raises a &lt;code&gt;ValueError&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Get Left Half Bits&lt;/strong&gt;: It calls &lt;code&gt;get_left_half_bits&lt;/code&gt; to extract the left half-bits of the hidden image and stores them in the &lt;code&gt;left_half_bits_hidden_image&lt;/code&gt; attribute.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Merge Half Bits&lt;/strong&gt;: It then calls &lt;code&gt;merge_two_half_bits&lt;/code&gt; to merge the modified hidden image with the cover image.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Explanation of the &lt;code&gt;get_left_half_bits&lt;/code&gt; Method:
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h6&gt;
  
  
  Parameters:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;img_arr&lt;/code&gt;: The image array that you want to extract the left half-bits from.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Steps:
&lt;/h6&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lookup&lt;/strong&gt;: It looks up the left half-bits of the image array &lt;code&gt;img_arr&lt;/code&gt; using a pre-defined lookup table &lt;code&gt;__lhb_lookup&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Return&lt;/strong&gt;: It returns the left half-bits.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Explanation of the &lt;code&gt;merge_two_half_bits&lt;/code&gt; Method:
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h6&gt;
  
  
  Parameters:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pos&lt;/code&gt;: The position where the hidden image will be located in relation to the cover image.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Steps:
&lt;/h6&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Copy Original Cover Image&lt;/strong&gt;: It first creates a copy of the original cover image and stores it in &lt;code&gt;self.merged_image&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Get Slicing Range&lt;/strong&gt;: It calls the &lt;code&gt;get_slicing&lt;/code&gt; method to determine the slice where the hidden image will be placed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Merge the Half Bits&lt;/strong&gt;: It merges the cover image and the modified hidden image together to create the final merged image (steganograph). It does this by using a pre-defined 2D lookup table &lt;code&gt;__mb_lookup&lt;/code&gt; for each channel (RGB).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Type Casting&lt;/strong&gt;: Finally, it casts the &lt;code&gt;merged_image&lt;/code&gt; into 'uint8' type.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Explanation of the &lt;code&gt;get_slicing&lt;/code&gt; Method:
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h6&gt;
  
  
  Parameters:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;large_shape&lt;/code&gt;: A tuple representing the shape of the larger array, which is the cover image in this case.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;small_shape&lt;/code&gt;: A tuple representing the shape of the smaller array, which is the hidden image.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pos&lt;/code&gt;: The position where the hidden image will be located in relation to the cover image. Valid options are 'upper_left', 'upper_right', 'lower_left', and 'lower_right'.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Steps:
&lt;/h6&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extract Shape Information&lt;/strong&gt;: The method first extracts the shape information of both the larger and smaller arrays. This information includes the number of rows and columns in each array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Calculate Slicing Range&lt;/strong&gt;: Based on the &lt;code&gt;pos&lt;/code&gt; value, the function calculates the range in the larger array where the smaller array will be placed. This is done using numpy slice notation (&lt;code&gt;np.s_&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;: If an invalid &lt;code&gt;pos&lt;/code&gt; value is provided, a &lt;code&gt;ValueError&lt;/code&gt; is raised.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Return&lt;/strong&gt;: The function returns the calculated slicing range, which can be used as a slice object for numpy arrays. This slice object will then be used to place the hidden image in the specified position within the cover image.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By the end of the &lt;code&gt;encode&lt;/code&gt; method, you'll have a steganograph where the hidden image is merged into the cover image at the specified position.&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation of the &lt;code&gt;decode&lt;/code&gt; Method:
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;decode&lt;/code&gt; method aims to break down the steganograph created by the &lt;code&gt;encode&lt;/code&gt; method to recover the original hidden and cover images.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h5&gt;
  
  
  Parameters:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pos&lt;/code&gt;: This parameter specifies where the hidden image was embedded within the cover image. The default is &lt;code&gt;'upper_left'&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Steps:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validation&lt;/strong&gt;: First, the method checks if &lt;code&gt;self.merged_image&lt;/code&gt; is &lt;code&gt;None&lt;/code&gt;. If it is, it raises a &lt;code&gt;TypeError&lt;/code&gt;. It also validates that the position &lt;code&gt;pos&lt;/code&gt; is one of the acceptable positions. If not, a &lt;code&gt;ValueError&lt;/code&gt; is raised.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unmerge&lt;/strong&gt;: It calls the &lt;code&gt;unmerge_two_half_bits&lt;/code&gt; method to separate the cover and hidden images from the merged image.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Explanation of the &lt;code&gt;unmerge_two_half_bits&lt;/code&gt; Method:
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h6&gt;
  
  
  Parameters:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pos&lt;/code&gt;: Specifies the original position where the hidden image was embedded within the cover image.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Steps:
&lt;/h6&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Slice Definition&lt;/strong&gt;: Calls the &lt;code&gt;get_slicing&lt;/code&gt; method to determine the slice range based on the &lt;code&gt;pos&lt;/code&gt; value, i.e., where exactly the hidden image is located in the merged image.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extract Left Half Bits of Cover Image&lt;/strong&gt;: Uses the &lt;code&gt;get_left_half_bits&lt;/code&gt; method to extract the left half bits of the merged image and assigns them to &lt;code&gt;self.unmerged_left_half_bits_cover_image&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extract Right Half Bits of Hidden Image&lt;/strong&gt;: Similarly, it calls the &lt;code&gt;get_right_half_bits&lt;/code&gt; method to extract the right half bits of the merged image. However, it does so only for the area specified by the slicing range returned by &lt;code&gt;get_slicing&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Explanation of the &lt;code&gt;get_right_half_bits&lt;/code&gt; Method:
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h6&gt;
  
  
  Parameters:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;img_arr&lt;/code&gt;: The image array that you want to extract the right half-bits from.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Steps:
&lt;/h6&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lookup&lt;/strong&gt;: It looks up the right half-bits of the image array &lt;code&gt;img_arr&lt;/code&gt; using a pre-defined lookup table &lt;code&gt;__rhb_lookup&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Return&lt;/strong&gt;: It returns the right half-bits.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, the &lt;code&gt;decode&lt;/code&gt; method and its supporting methods work together to reverse the steganographic process, extracting the hidden image and cover image from the merged image.&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation of the &lt;code&gt;reconstruct&lt;/code&gt; Method:
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;reconstruct&lt;/code&gt; method aims to restore the original cover and hidden images from their left-half bits images, which were previously separated during the decoding process.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h5&gt;
  
  
  Steps:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validation&lt;/strong&gt;: The method checks that &lt;code&gt;self.unmerged_left_half_bits_cover_image&lt;/code&gt; and &lt;code&gt;self.unmerged_left_half_bits_hidden_image&lt;/code&gt; are not &lt;code&gt;None&lt;/code&gt;. If either of them is &lt;code&gt;None&lt;/code&gt;, it raises a &lt;code&gt;TypeError&lt;/code&gt;, prompting you to run the &lt;code&gt;decode()&lt;/code&gt; method first.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reconstruct Cover Image&lt;/strong&gt;: The &lt;code&gt;reconstruct_right_half_bits&lt;/code&gt; method is called to reconstruct the right-half bits of the cover image. The reconstructed image is stored in &lt;code&gt;self.reconstructed_cover_image&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reconstruct Hidden Image&lt;/strong&gt;: Similarly, the &lt;code&gt;reconstruct_right_half_bits&lt;/code&gt; method is used to reconstruct the right-half bits of the hidden image. The reconstructed image is stored in &lt;code&gt;self.reconstructed_hidden_image&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Explanation of the &lt;code&gt;reconstruct_right_half_bits&lt;/code&gt; Method:
&lt;/h5&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h6&gt;
  
  
  Parameters:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;im_arr&lt;/code&gt;: The left-half bits of an image as a numpy array.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;seed&lt;/code&gt;: A seed for the random number generator, defaulting to 1999.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Steps:
&lt;/h6&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Random Seed&lt;/strong&gt;: The &lt;code&gt;np.random.seed&lt;/code&gt; function is used to set the random seed to ensure that the random process is reproducible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flattening Image&lt;/strong&gt;: The &lt;code&gt;ravel()&lt;/code&gt; method is used to flatten the &lt;code&gt;im_arr&lt;/code&gt;, essentially turning it into a one-dimensional array (&lt;code&gt;flat_im_arr&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Random Indices&lt;/strong&gt;: A random set of indices (&lt;code&gt;random_indices&lt;/code&gt;) is generated using &lt;code&gt;np.random.randint&lt;/code&gt;, with the size of the array based on the shape of &lt;code&gt;flat_im_arr&lt;/code&gt;. This will simulate the random selection of right-half bits for each corresponding left-half bit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reconstruction&lt;/strong&gt;: The lookup table &lt;code&gt;__rrhb_lookup&lt;/code&gt; is used in conjunction with &lt;code&gt;random_indices&lt;/code&gt; to get a set of right-half bits for each corresponding left-half bit in &lt;code&gt;flat_im_arr&lt;/code&gt;. The result (&lt;code&gt;reconstructed_flat&lt;/code&gt;) is a one-dimensional array containing the reconstructed right-half bits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reshaping&lt;/strong&gt;: The reconstructed one-dimensional array is reshaped back into its original shape (&lt;code&gt;shape&lt;/code&gt;) to form the reconstructed image.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Type Casting&lt;/strong&gt;: Finally, the numpy array is cast to the type &lt;code&gt;'uint8'&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Return&lt;/strong&gt;: The reconstructed image, now having both left and right half-bits, is returned.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, the &lt;code&gt;reconstruct&lt;/code&gt; method and its sub-method &lt;code&gt;reconstruct_right_half_bits&lt;/code&gt; work together to restore the original cover and hidden images from their left-half bits versions. This final step completes the round-trip process of encoding, decoding, and reconstructing the images.&lt;/p&gt;

&lt;p&gt;For the complete code and a more detailed walkthrough, check out the Jupyter Notebook linked below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://colab.research.google.com/github/ranggakd/steganography/blob/main/Exploring_Steganography_In_The_Wild_Part_1.ipynb" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Open in Colab&lt;/a&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Results and Visualization
&lt;/h2&gt;

&lt;p&gt;Having delved into the theory and implementation details, it's time to see our steganography technique in action. We'll examine the visual changes and quality metrics at each stage of the process—encoding, decoding, and reconstruction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Examples of Pre-Encoded Images
&lt;/h3&gt;

&lt;p&gt;First, let's consider our "Cover Image" and "Hidden Image." The image below serves as our cover:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6pthkxaqi3s6lm09c0h.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6pthkxaqi3s6lm09c0h.jpeg" alt="Attack Titan.jpeg as cover image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we have the hidden image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6girqpd6r1kh2uwjqrr.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6girqpd6r1kh2uwjqrr.jpeg" alt="Eren.jpeg as hidden image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a deeper understanding, let's examine the RGB plot of these images. Click on the image below to enlarge it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xuvhejsjvn1rrn4pyel2.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuvhejsjvn1rrn4pyel2.png" alt="RGB plot of cover and hidden images"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Examples of Encoded Images
&lt;/h3&gt;

&lt;p&gt;After encoding, we obtain two new images: the "Left Half Bits Hidden Image" and the "Merged Image."&lt;/p&gt;

&lt;h4&gt;
  
  
  Left Half Bits Hidden Image
&lt;/h4&gt;

&lt;p&gt;The encoded "Left Half Bits Hidden Image" noticeably loses some quality compared to the original hidden image. For instance, the gradients do not blend as smoothly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezx3qelhemiy83ykzp2q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezx3qelhemiy83ykzp2q.jpeg" alt="LHB of hidden image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's the RGB plot for a more in-depth analysis:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7llj143tqsg7cphdrhlq.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7llj143tqsg7cphdrhlq.png" alt="RGB plot of left half bits hidden image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Merged Image
&lt;/h4&gt;

&lt;p&gt;At first glance, the "Merged Image" looks almost identical to the original cover image. However, a keen eye might spot a subtle face formation in the upper-left corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6symdv85lqgs0yeeyei0.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6symdv85lqgs0yeeyei0.jpeg" alt="Merged image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a more analytical view, let's check the RGB plot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejj0u216s9j05kpir4m6.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejj0u216s9j05kpir4m6.png" alt="RGB plot of merged image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Examples of Decoded Images
&lt;/h3&gt;

&lt;p&gt;Next, we decode the merged image to obtain the "Unmerged Left Half Bits Cover Image" and the "Unmerged Left Half Bits Hidden Image." Both of these images show a loss in quality and coherence, similar to what we observed with the left half bits hidden image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fre8cawehxdod4hbhh9nr.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fre8cawehxdod4hbhh9nr.jpeg" alt="Unmerged left half bits cover image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhu47pp54m6ye6d7jdpdh.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhu47pp54m6ye6d7jdpdh.jpeg" alt="Unmerged left half bits hidden image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take a look at the RGB breakdown for further insights:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/axxptrt2csnz4ohlwave.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxxptrt2csnz4ohlwave.png" alt="RGB plot of unmerged images"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Examples of Reconstructed Images
&lt;/h3&gt;

&lt;p&gt;Finally, we move on to the reconstruction stage, where we aim to approximate the original images as closely as possible.&lt;/p&gt;

&lt;h4&gt;
  
  
  Reconstructed Cover Image
&lt;/h4&gt;

&lt;p&gt;When compared to the unmerged version, the reconstructed cover image appears slightly brighter. However, it's essential to note that the image quality is still not on par with the original. Gradients, for example, do not blend as smoothly as they should.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghx71nxua4yozr1evvcc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghx71nxua4yozr1evvcc.jpeg" alt="Reconstructed cover image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Reconstructed Hidden Image
&lt;/h4&gt;

&lt;p&gt;A similar trend is observed in the reconstructed hidden image. Though somewhat brighter than the unmerged version, the quality still falls short of the original.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg3wndidfw1mvuq6lgex1.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg3wndidfw1mvuq6lgex1.jpeg" alt="Reconstructed hidden image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  RGB Breakdown of Reconstructed Images
&lt;/h4&gt;

&lt;p&gt;For a more analytical perspective, let's examine the RGB plots of these reconstructed images:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gokpzyk4gq71zkh6iwvy.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgokpzyk4gq71zkh6iwvy.png" alt="RGB plot of reconstructed images"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Evaluation Metrics
&lt;/h3&gt;

&lt;p&gt;For the evaluation, I utilized the Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) metrics. These metrics help to quantify the differences between the images at different stages of the steganography process. While I can't speak to their application in formal steganalysis, they do offer a way to gauge the effectiveness of the encoding and decoding steps. If you have insights or recommendations on other metrics that might be more suitable, especially from a steganalysis point of view, feel free to share.&lt;/p&gt;

&lt;p&gt;For instance, comparing the "Left Half Bits Hidden Image" with the original hidden image yielded the following results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RMSE    : 8.868079206151936
MAE     : 7.579809053497942
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This indicates that the two images are indeed different. However, when comparing the "Left Half Bits Hidden Image" with the "Unmerged Left Half Bits Hidden Image," the result was:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RMSE    : 0.0
MAE     : 0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This confirms that the encoding and decoding processes were executed correctly, as the two images are logically the same.&lt;/p&gt;

&lt;p&gt;Once again, for the complete code and walkthrough, just run the Jupyter Notebook linked below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://colab.research.google.com/github/ranggakd/steganography/blob/main/Exploring_Steganography_In_The_Wild_Part_1.ipynb" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Open in Colab&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;This concludes the "Results and Visualization" section, where we've explored the visual aspects and quality metrics of images at every stage—encoding, decoding, and reconstruction. These visual examples and metrics serve as a comprehensive evaluation of our steganography technique.&lt;/p&gt;
&lt;h2&gt;
  
  
  Limitations and Future Work
&lt;/h2&gt;

&lt;p&gt;In this section, we delve into the limitations of the current implementation and discuss opportunities for future enhancements.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Image Channel Handling&lt;/strong&gt;: The code is designed to work specifically with RGB color spaces. This makes it less versatile when dealing with other color spaces or grayscale images.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limited File Format Support&lt;/strong&gt;: The code currently supports only PNG and JPEG formats, potentially excluding users with images in other formats.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Complexity&lt;/strong&gt;: The codebase is somewhat intricate, which might make it less accessible for individuals who are not familiar with the project's specifics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;: While some error-handling mechanisms exist, they may not be comprehensive enough to address all potential edge cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hard-Coded Values&lt;/strong&gt;: The presence of hard-coded values in the code reduces its flexibility and adaptability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Google Colab Dependency&lt;/strong&gt;: The code relies on Google Colab-specific libraries, making it less portable for users who may prefer other development environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lack of Modularization&lt;/strong&gt;: The code is not modular, which could complicate future efforts to extend its functionality or maintain it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Summing Up the Journey
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enlightening and Challenging&lt;/strong&gt;: Our exploration into steganography has been a revealing journey, showcasing both the potential and the challenges of this field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Practical Applications&lt;/strong&gt;: We demonstrated how one image could be hidden within another, a technique with various real-world applications such as digital watermarking and secure communications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identified Limitations&lt;/strong&gt;: Like any scientific endeavor, our work has its constraints, from the limitations in color channel handling to dependencies on specific platforms like Google Colab. These offer avenues for future research and refinement.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Technical Achievements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bit Manipulation&lt;/strong&gt;: One of the technical milestones of this project is the successful implementation of bit manipulation techniques to encode and decode images.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Visual Proof&lt;/strong&gt;: We provided visual examples to demonstrate our techniques in action. While the hidden image is not perfectly concealed in our experiments, we believe that in scenarios with more detailed and crowded cover images, the concealment could be more effective.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quantitative Analysis&lt;/strong&gt;: We've used metrics such as RMSE and MAE to measure differences between original and manipulated images. While these metrics offer insights, they may not be specifically tailored for steganalysis. If you have expertise in steganalysis, your feedback in the comments would be highly valuable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Key Takeaways
&lt;/h3&gt;
&lt;h4&gt;
  
  
  The Complexity of Simplicity
&lt;/h4&gt;

&lt;p&gt;What seemed like a straightforward task—hiding one image within another—unfolded into a labyrinth of complexities. The project has underscored the intricacies of image manipulation and bit-level operations.&lt;/p&gt;
&lt;h4&gt;
  
  
  Robustness and Flexibility are Paramount
&lt;/h4&gt;

&lt;p&gt;The limitations we've faced have highlighted the importance of robust and flexible code. As we continue to refine this project, the lessons learned here will be invaluable.&lt;/p&gt;
&lt;h4&gt;
  
  
  Continuous Learning and Improvement
&lt;/h4&gt;

&lt;p&gt;The world of steganography is vast, and there's so much more to explore. Your feedback and contributions are not just welcome but are essential for the continuous improvement of this project.&lt;/p&gt;
&lt;h4&gt;
  
  
  The Future is Open
&lt;/h4&gt;

&lt;p&gt;The avenues for future work are promising. They range from refining the current code to make it more versatile to exploring more advanced steganographic techniques. With ongoing research and collaboration, the sky is the limit for what can be achieved.&lt;/p&gt;
&lt;h2&gt;
  
  
  Additional Sections
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code Repository&lt;/strong&gt;: You can find the complete code and notebooks on &lt;a href="https://github.com/ranggakd/steganography/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/ranggakd" rel="noopener noreferrer"&gt;
        ranggakd
      &lt;/a&gt; / &lt;a href="https://github.com/ranggakd/steganography" rel="noopener noreferrer"&gt;
        steganography
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Exploring Steganography In The Wild
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;steganography&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;Exploring Steganography In The Wild&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Table of Contents&lt;/h2&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/ranggakd/steganography/Exploring_Steganography_In_The_Wild_Part_1.ipynb" rel="noopener noreferrer"&gt;Basic Steganography&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/ranggakd/steganography" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;References&lt;/strong&gt;: &lt;a href="https://towardsdatascience.com/steganography-hiding-an-image-inside-another-77ca66b2acb1" rel="noopener noreferrer"&gt;Steganography: Hiding an image inside another&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>security</category>
      <category>cybersecurity</category>
      <category>steganography</category>
    </item>
    <item>
      <title>Colouring Your Arrow / Link with `linkStyle` in Mermaid Markdown</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sun, 10 Sep 2023 20:19:31 +0000</pubDate>
      <link>https://dev.to/ranggakd/coloring-your-arrow-link-with-linkstyle-in-mermaid-markdown-39kk</link>
      <guid>https://dev.to/ranggakd/coloring-your-arrow-link-with-linkstyle-in-mermaid-markdown-39kk</guid>
      <description>&lt;p&gt;Welcome back to &lt;code&gt;Technically Speaking&lt;/code&gt;, your sanctuary for diving deep into the labyrinthine wonders of technology. Today, we turn the spotlight onto &lt;a href="https://mermaid.js.org/" rel="noopener noreferrer"&gt;Mermaid&lt;/a&gt;, a marvelous tool that's become my go-to for diagramming and documentation. Specifically, we're going to add some splashes of colour to the arrows or links in our Mermaid Markdown flowcharts. Let's get to it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting the Stage
&lt;/h2&gt;

&lt;p&gt;First things first, we need a basic flowchart or graph to work with. Here's a snippet from my upcoming post on steganography, showcasing a flowchart that I built using Mermaid Markdown:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;

graph TB
    Decode([Decode])
    End([End])
    ULhbCover[/"Unmerged Left-half
    bits Cover Image"/]
    CULhbHidden[/"Cover Image-sized Unmerged Left-half
    bits Hidden Image"/]
    ULhbHidden[/"Unmerged Left-half
    bits Hidden Image"/]
    Merged[/Merged Image/]
    Lhb[LHB Mapping]
    Rhb[RHB Mapping]&lt;span class="sb"&gt;

    Decode --&amp;gt; Merged
    Merged --&amp;gt; Lhb &amp;amp; Rhb
    Lhb --&amp;gt; ULhbCover
    Rhb --&amp;gt; CULhbHidden
    CULhbHidden --"pass on hidden image
    position in merged image"--&amp;gt; ULhbHidden
    ULhbCover &amp;amp; ULhbHidden --&amp;gt; End


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  The Art of Styling Links
&lt;/h2&gt;

&lt;p&gt;When I first stumbled upon the &lt;a href="https://mermaid.js.org/syntax/flowchart.html#styling-links" rel="noopener noreferrer"&gt;Mermaid documentation on styling links&lt;/a&gt;, it seemed simple enough. Just use this one-liner:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

linkStyle default stroke:green;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;default&lt;/code&gt; parameter applies the styling to all links or arrows in your chart. However, there was one hiccup: the documentation didn't specify &lt;em&gt;where&lt;/em&gt; to put this mysterious one-liner. Initially, I faced errors that had me scratching my head. Then, eureka! It occurred to me to place the styling directive &lt;em&gt;after&lt;/em&gt; all the link syntax, like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;

graph TB
    Decode([Decode])
    End([End])
    ULhbCover[/"Unmerged Left-half
    bits Cover Image"/]
    CULhbHidden[/"Cover Image-sized Unmerged Left-half
    bits Hidden Image"/]
    ULhbHidden[/"Unmerged Left-half
    bits Hidden Image"/]
    Merged[/Merged Image/]
    Lhb[LHB Mapping]
    Rhb[RHB Mapping]&lt;span class="sb"&gt;

    Decode --&amp;gt; Merged
    Merged --&amp;gt; Lhb &amp;amp; Rhb
    Lhb --&amp;gt; ULhbCover
    Rhb --&amp;gt; CULhbHidden
    CULhbHidden --"pass on hidden image
    position in merged image"--&amp;gt; ULhbHidden
    ULhbCover &amp;amp; ULhbHidden --&amp;gt; End

    linkStyle default stroke:green;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And just like that, it worked! Behold the green strokes in all their glory:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbws8qomajscahact140x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbws8qomajscahact140x.png" alt="Decode mermaid graph"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Uncharted Waters
&lt;/h2&gt;

&lt;p&gt;There are still a couple of nuances that have eluded me. One is colouring the arrowhead itself; I did ask BingChat for a solution, but it involved intricate CSS—a no-go for this Markdown-centric endeavor. Secondly, I'm on a perpetual quest for a contrasting background. Dark mode is my jam, and unfortunately, Mermaid's PNG output doesn't play well with it. I tried to set a solid background colour, but so far, no dice. You could try it live yourself &lt;a href="https://mermaid.live/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So there we have it—your links now boast eye-catching strokes, although the quest for perfect styling remains ever ongoing. If you've got insights on the elusive arrowhead colouring or background contrast, do share! Until then, keep exploring, keep questioning, and most importantly, keep &lt;code&gt;Technically Speaking&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Happy diagramming! 📊✨&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>markdown</category>
      <category>mermaid</category>
    </item>
    <item>
      <title>Collapsible Markdown on GitHub Markdown and Beacons AI</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sat, 09 Sep 2023 05:03:43 +0000</pubDate>
      <link>https://dev.to/ranggakd/collapsible-markdown-on-github-markdown-and-beacons-ai-2h1c</link>
      <guid>https://dev.to/ranggakd/collapsible-markdown-on-github-markdown-and-beacons-ai-2h1c</guid>
      <description>&lt;p&gt;Welcome to &lt;code&gt;Technically Speaking&lt;/code&gt;, a series that will serve as the hub for my latest technical escapades. The focus here is strictly technical—covering everything from code snippets to full-blown projects. Consider this my daily commitment to better coding habits and creative building!&lt;/p&gt;

&lt;p&gt;Today, let's dive into how to create collapsible markdown sections on GitHub and Beacons AI. The notion struck me after stumbling upon a &lt;a href="https://gist.github.com/pierrejoubert73/902cc94d79424356a8d20be2b382e1ab" rel="noopener noreferrer"&gt;gist by pierrejoubert73&lt;/a&gt;. Here's what sparked the idea:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;h2&gt;
  
  
  Beacons AI: The About Me Section
&lt;/h2&gt;

&lt;p&gt;My first playground was my Beacons AI 'About Me' section, where markdown formatting is welcomed. Check out the markdown code I used:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;center&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
👉👈
&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;

&lt;span class="gu"&gt;### Oh, hello there! 👋&lt;/span&gt;

|  | I'm a / an |
| :--- | :---: |
| Programmer | ✔ |
| AI Tech Writer | ✔ |
| Data Practitioner | ✔ |
| Statistics &amp;amp; Math Addict | ✔ |
| Open Source Contributor | ✔ |
| Quantum Computing Enthusiast | ✔ |
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;&lt;span class="sb"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Curious to see it in action? The code renders as shown below. Feel free to explore and experiment on my &lt;a href="https://beacons.ai/ranggakd" rel="noopener noreferrer"&gt;Beacons AI page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcir6y1hl90p6nrsasiad.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcir6y1hl90p6nrsasiad.gif" alt="beacons ai"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A word of caution: this could impact your SEO preview, as evidenced by this Telegram snapshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19j9eib6ozn4bjtiftc0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19j9eib6ozn4bjtiftc0.png" alt="telegram views"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub: README Section
&lt;/h2&gt;

&lt;p&gt;Next, I integrated collapsible markdown into my GitHub README. Here's a snippet:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
With &lt;span class="nt"&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;me&lt;span class="nt"&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;center&amp;gt;&lt;/span&gt;

|  | I'm a / an |
| :--- | :---: |
| Programmer | ✔ |
| AI Tech Writer | ✔ |
| Data Practitioner | ✔ |
| Statistics &amp;amp; Math Addict | ✔ |
| Open Source Contributor | ✔ |
| Quantum Computing Enthusiast | ✔ |
&lt;span class="nt"&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
I &lt;span class="nt"&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;code&lt;span class="nt"&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt; in the dark of my room 👨‍💻
&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

And I predict my data, &lt;span class="gs"&gt;**forecasting**&lt;/span&gt; from afar (oh)  
"&lt;span class="gs"&gt;**Unittest**&lt;/span&gt;," but it's not just a few  
&lt;span class="gs"&gt;**Data analysis**&lt;/span&gt; keeps me on cue
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
And I &lt;span class="nt"&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;study now&lt;span class="nt"&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;, the current state 💻
&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

Of &lt;span class="gs"&gt;**Rust**&lt;/span&gt; and &lt;span class="gs"&gt;**Julia**&lt;/span&gt; to seal my fate (oh)  
And in &lt;span class="gs"&gt;**Python**&lt;/span&gt;, I find my worth  
"&lt;span class="gs"&gt;**SQL**&lt;/span&gt;", ain't that the geekiest you ever heard?  
I write those, grinding like a coder
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;&lt;span class="sb"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It's worth noting that the &lt;code&gt;center&lt;/code&gt; tag doesn't yield the same results on GitHub as it does on Beacons AI. To see how it renders, visit my &lt;a href="https://github.com/ranggakd" rel="noopener noreferrer"&gt;GitHub profile&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr16na2to6upnngfgkn1s.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr16na2to6upnngfgkn1s.gif" alt="github"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that wraps up today's episode of &lt;code&gt;Technically Speaking&lt;/code&gt;. Collapsible markdown is more than just a neat trick; it's a way to make your pages more interactive and engaging. So go ahead, give it a whirl, and let me know how it works for you!&lt;/p&gt;

</description>
      <category>markdown</category>
      <category>github</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why Haven't Legal Amendments Adopted Version Control Systems Like Git?</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Tue, 05 Sep 2023 23:53:41 +0000</pubDate>
      <link>https://dev.to/ranggakd/why-havent-legal-amendments-adopted-version-control-systems-like-git-1h4d</link>
      <guid>https://dev.to/ranggakd/why-havent-legal-amendments-adopted-version-control-systems-like-git-1h4d</guid>
      <description>&lt;p&gt;Why does a legal amendment not yet adopted a version control system like Git for example? Law basically a text with certain layout and amendment is the same as the change.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bing Chat said:
&lt;/h2&gt;

&lt;p&gt;That's an interesting question! While I couldn't find any specific information on why legal amendments have not adopted a version control system like Git, there could be several reasons for this. One reason could be that the legal system and its processes are often steeped in tradition and can be slow to change. Additionally, the legal system is complex and involves many different parties, so implementing a new system like Git could be challenging. Another reason could be that the legal system has its own established methods for tracking changes to laws and amendments, and there may not be a perceived need for a version control system like Git. However, this is just speculation on my part. Is there anything else you would like to know? 😊&lt;/p&gt;

&lt;p&gt;Source: Conversation with Bing, 06/09/2023&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/5760293/alternatives-to-git"&gt;(1) version control - Alternatives to Git? - Stack Overflow.&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.freecodecamp.org/news/git-and-github-overview/"&gt;(2) Git vs GitHub – What is Version Control and How Does it Work?. &lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.automation.com/en-us/articles/july-2022/git-based-version-control-industial-automation"&gt;(3) Understanding Git-Based Version Control for Industrial Automation. &lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Meanwhile ChatGPT said:
&lt;/h2&gt;

&lt;p&gt;The idea of using a version control system like Git for legal amendments is interesting and has been proposed in various contexts, but there are several challenges and considerations that have so far limited its widespread adoption in legal systems. Here are some reasons:&lt;/p&gt;

&lt;h3&gt;
  
  
  Complexity of Legal Language
&lt;/h3&gt;

&lt;p&gt;Legal language is highly specialized and follows strict conventions. The diffing algorithms used in version control systems may not always capture the subtleties of these changes, and so specialized tools would likely be needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Change Approval Process
&lt;/h3&gt;

&lt;p&gt;Legal changes often need to be approved through a specific process involving multiple parties, such as various branches of government in the case of legislation. This is a lot more involved than simply accepting a pull request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility
&lt;/h3&gt;

&lt;p&gt;The law needs to be accessible to everyone, not just those who are familiar with version control systems. This means that even if such a system were used internally, a more accessible interface would need to be provided for the public.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accountability and Security
&lt;/h3&gt;

&lt;p&gt;Legal documents often require a strict chain of custody and evidentiary support to be admissible in court. The systems used for legal documents must meet high standards for security and accountability that go beyond what version control systems typically provide.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tradition and Resistance to Change
&lt;/h3&gt;

&lt;p&gt;The legal field is often slow to adopt new technologies, in part because of the high stakes involved, and in part because of institutional resistance to change.&lt;/p&gt;

&lt;h3&gt;
  
  
  Interpretation over Text
&lt;/h3&gt;

&lt;p&gt;Law is not just about what is explicitly stated in the text but also about interpretation, precedent, and intent, which are not things that can be easily captured in a text-based version control system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Public Records
&lt;/h3&gt;

&lt;p&gt;Laws and legal documents are often considered public records that need to be kept in specific ways to be legally admissible. It's not clear that a Git-like system could meet these requirements without significant modification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Collaboration Vs. Authority
&lt;/h3&gt;

&lt;p&gt;In open-source projects managed with Git, the emphasis is on collaboration and community contributions. Legal systems, on the other hand, are often explicitly hierarchical, with changes needing to be approved by a specific authority.&lt;/p&gt;

&lt;p&gt;Despite these challenges, there are some initiatives that aim to bring version control to legal documents, but these are mostly in the early stages and have not yet seen widespread adoption.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is your opinion on this?
&lt;/h2&gt;

</description>
      <category>discuss</category>
      <category>git</category>
      <category>programming</category>
      <category>github</category>
    </item>
    <item>
      <title>So I Explored Forecasting Metrics... Now I Want Your Two Cents 💭</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sun, 27 Aug 2023 16:50:17 +0000</pubDate>
      <link>https://dev.to/ranggakd/so-i-explored-forecasting-metrics-now-i-want-your-two-cents-30p0</link>
      <guid>https://dev.to/ranggakd/so-i-explored-forecasting-metrics-now-i-want-your-two-cents-30p0</guid>
      <description>&lt;h2&gt;
  
  
  
  Outlines
  &lt;ul&gt;
&lt;li&gt;Introduction 🌟&lt;/li&gt;
&lt;li&gt;The Objective 🎯&lt;/li&gt;
&lt;li&gt;Metrics Investigated 🔍&lt;/li&gt;
&lt;li&gt;
Severity and Directional Emojis 🔥👉

&lt;ul&gt;
&lt;li&gt;Standard Error Metrics (MAE, MSE, RMSE) Categorization 📊&lt;/li&gt;
&lt;li&gt;Percentage Error (MAPE, sMAPE, MBDev) Categorization 📉&lt;/li&gt;
&lt;li&gt;R2 Score Categorization 📈&lt;/li&gt;
&lt;li&gt;MASE Categorization 📋&lt;/li&gt;
&lt;li&gt;Severity Emojis 🚨&lt;/li&gt;
&lt;li&gt;Directional Emojis ➡️&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Methodology 📚&lt;/li&gt;
&lt;li&gt;
Highlights of Findings ✨

&lt;ul&gt;
&lt;li&gt;Key Insights 🔑&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Points for Critique 🤔&lt;/li&gt;
&lt;li&gt;
Conclusion 🤝✅
&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Introduction 🌟
&lt;/h2&gt;

&lt;/h2&gt;
&lt;p&gt;Diving into the world of regression and forecasting metrics can be a real head-scratcher, especially if you're a newcomer. Trust me, I've been there—haphazardly applying every popular metric scholars swear by, only to be left puzzled by the results.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ever wondered why your MAE, MSE, and RMSE values look stellar, but your MAPE is through the roof? &lt;em&gt;Yep, me too.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's why I set out on this journey to create an experimental notebook, aiming to demystify how different metrics actually behave.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Objective 🎯
&lt;/h2&gt;

&lt;p&gt;The goal of this notebook isn't to find the &lt;strong&gt;"one metric to rule them all" for a specific dataset&lt;/strong&gt;. Instead, I want &lt;strong&gt;to understand how various metrics respond to controlled conditions in both dataset and model&lt;/strong&gt;. Think of this as a comparative study, a sort of &lt;strong&gt;"Metrics 101"&lt;/strong&gt; through the lens of someone who's still got that new-car smell in the field. This way, when I'm plunged into real-world scenarios, I'll have a better grip on interpreting my metrics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metrics Investigated 🔍
&lt;/h2&gt;

&lt;p&gt;To get a comprehensive view, I've opted to explore a selection of metrics that are commonly leveraged in regression and forecasting problems. Here's the lineup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mean Absolute Error (MAE)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It measures the average magnitude of the errors between predicted and observed values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;MAE=1n∑i=1n∣yi−y^i∣MAE = \frac{1}{n}\sum_{i=1}^{n} |y_i - \hat{y}_i|
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;M&lt;/span&gt;&lt;span class="mord mathnormal"&gt;A&lt;/span&gt;&lt;span class="mord mathnormal"&gt;E&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop op-symbol large-op"&gt;∑&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;

where 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(yi)(y_i)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the actual value, 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(y^i)(\hat{y}_i)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the predicted value, and 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(n)(n)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the number of observations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mean Squared Error (MSE)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It measures the average of the squares of the errors between predicted and observed values. It gives more weight to large errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;MSE=1n∑i=1n(yi−y^i)2MSE = \frac{1}{n}\sum_{i=1}^{n} (y_i - \hat{y}_i)^2
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;MSE&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop op-symbol large-op"&gt;∑&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Root Mean Squared Error (RMSE)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It represents the sample standard deviation of the differences between predicted and observed values. It's the square root of MSE.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;RMSE=MSERMSE = \sqrt{MSE}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;RMSE&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord sqrt"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span class="svg-align"&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;MSE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="hide-tail"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mean Absolute Percentage Error (MAPE)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It measures the average of the absolute percentage errors between predicted and observed values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;MAPE=100n∑i=1n∣yi−y^iyi∣MAPE = \frac{100}{n}\sum_{i=1}^{n} \left| \frac{y_i - \hat{y}_i}{y_i} \right|
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;M&lt;/span&gt;&lt;span class="mord mathnormal"&gt;A&lt;/span&gt;&lt;span class="mord mathnormal"&gt;PE&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;100&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop op-symbol large-op"&gt;∑&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="minner"&gt;&lt;span class="mopen"&gt;&lt;span class="delimsizing mult"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="delimsizinginner delim-size1"&gt;&lt;span&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="delimsizinginner delim-size1"&gt;&lt;span&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="delimsizing mult"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="delimsizinginner delim-size1"&gt;&lt;span&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="delimsizinginner delim-size1"&gt;&lt;span&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;

Note: MAPE can be problematic if the actual value 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(yi)(y_i)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is zero for some observations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mean Absolute Scaled Error (MASE)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It measures the accuracy of forecasts relative to a naive baseline method. If MASE is lower than 1, the forecast is better than the naive forecast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;MASE=∑i=1n∣yi−y^i∣∑i=2n∣yi−yi−1∣MASE = \frac{\sum_{i=1}^{n} |y_i - \hat{y}i|}{\sum{i=2}^{n} |y_i - y_{i-1}|}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;M&lt;/span&gt;&lt;span class="mord mathnormal"&gt;A&lt;/span&gt;&lt;span class="mord mathnormal"&gt;SE&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mop op-symbol small-op"&gt;∑&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;i&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mbin mtight"&gt;−&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mop"&gt;&lt;span class="mop op-symbol small-op"&gt;∑&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;i&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;R-squared (Coefficient of Determination)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It indicates the proportion of the variance in the dependent variable that is predictable from the independent variable(s).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;R2=1−∑i=1n(yi−y^i)2∑i=1n(yi−yˉ)2R^2 = 1 - \frac{\sum_{i=1}^{n} (y_i - \hat{y}i)^2}{\sum{i=1}^{n} (y_i - \bar{y})^2}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;R&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mop op-symbol small-op"&gt;∑&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;i&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;ˉ&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mop"&gt;&lt;span class="mop op-symbol small-op"&gt;∑&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;i&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;

where 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(yˉ)(\bar{y})&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;ˉ&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the mean of the observed data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Symmetric Mean Absolute Percentage Error (sMAPE)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It's a variation of MAPE that addresses some of its issues, especially when the actual value is zero.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sMAPE=100n∑i=1n∣yi−y^i∣(∣yi∣+∣y^i∣)/2sMAPE = \frac{100}{n} \sum_{i=1}^{n} \frac{|y_i - \hat{y}_i|}{(|y_i| + |\hat{y}_i|)/2}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;s&lt;/span&gt;&lt;span class="mord mathnormal"&gt;M&lt;/span&gt;&lt;span class="mord mathnormal"&gt;A&lt;/span&gt;&lt;span class="mord mathnormal"&gt;PE&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;100&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop op-symbol large-op"&gt;∑&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mord"&gt;/2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;∣&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mean Bias Deviation (MBD)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: It calculates the average percentage bias in the predicted values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula&lt;/strong&gt;:

&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;MBD=100n∑i=1nyi−y^iyiMBD = \frac{100}{n}\sum_{i=1}^{n} \frac{y_i - \hat{y}_i}{y_i}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;MB&lt;/span&gt;&lt;span class="mord mathnormal"&gt;D&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;100&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop op-symbol large-op"&gt;∑&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Severity and Directional Emojis 🔥👉
&lt;/h2&gt;

&lt;p&gt;Let's face it, numbers alone can be dry, and if you're like me, you might crave a more visceral sense of how well your model is doing. Enter severity and directional emojis. These little symbols provide a quick visual cue for interpreting metric results, ranging from &lt;strong&gt;"you're nailing it"&lt;/strong&gt; to &lt;strong&gt;"back to the drawing board."&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; Keep in mind that these categorizations are user-defined and could vary depending on the context in which you're working.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Standard Error Metrics (MAE, MSE, RMSE) Categorization 📊
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;To clarify, the concept of Normalized Error Range stems from dividing the error by the range (max - min) of the training data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Normalized Error Range&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Perfect&lt;/td&gt;
&lt;td&gt;Exactly 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0&amp;lt;x≤0.050 &amp;lt; x \leq 0.05&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.05&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.05&amp;lt;x≤0.10.05 &amp;lt; x \leq 0.1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.05&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.1&amp;lt;x≤0.20.1 &amp;lt; x \leq 0.2&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.1&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.2&amp;lt;x≤0.30.2 &amp;lt; x \leq 0.3&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.2&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.3&amp;lt;x≤10.3 &amp;lt; x \leq 1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.3&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exceedingly High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;x&amp;gt;1x &amp;gt; 1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Percentage Error (MAPE, sMAPE, MBDev) Categorization 📉
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Error Magnitude (%)&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Perfect&lt;/td&gt;
&lt;td&gt;Exactly 0%&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0&amp;lt;x≤50 &amp;lt; x \leq 5&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;Over/Under&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;5&amp;lt;x≤105 &amp;lt; x \leq 10&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;5&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;Over/Under&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;10&amp;lt;x≤2010 &amp;lt; x \leq 20&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;10&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;20&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;Over/Under&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;20&amp;lt;x≤3020 &amp;lt; x \leq 30&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;20&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;30&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;Over/Under&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;30&amp;lt;x≤10030 &amp;lt; x \leq 100&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;30&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;100&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;Over/Under&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exceedingly High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;x&amp;gt;100x &amp;gt; 100&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;100&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;Over/Under&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  R2 Score Categorization 📈
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;R2 Value Range&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Perfect&lt;/td&gt;
&lt;td&gt;Exactly 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.95≤x&amp;lt;10.95 \leq x &amp;lt; 1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.95&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.9≤x&amp;lt;0.950.9 \leq x &amp;lt; 0.95&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.9&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.95&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.8≤x&amp;lt;0.90.8 \leq x &amp;lt; 0.9&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.8&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.7≤x&amp;lt;0.80.7 \leq x &amp;lt; 0.8&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.7&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.5≤x&amp;lt;0.70.5 \leq x &amp;lt; 0.7&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.5&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exceedingly High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0&amp;lt;x&amp;lt;0.50 &amp;lt; x &amp;lt; 0.5&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Doesn't Explain Variability&lt;/td&gt;
&lt;td&gt;Exactly 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worse Than Simple Mean Model&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;x&amp;lt;0x &amp;lt; 0&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  MASE Categorization 📋
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;MASE Value Range&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Perfect&lt;/td&gt;
&lt;td&gt;Exactly 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0&amp;lt;x≤0.10 &amp;lt; x \leq 0.1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptable&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.1&amp;lt;x≤0.50.1 &amp;lt; x \leq 0.5&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.1&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.5&amp;lt;x≤0.90.5 &amp;lt; x \leq 0.9&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.5&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.9&amp;lt;x≤10.9 &amp;lt; x \leq 1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.9&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Equivalent to Naive Model&lt;/td&gt;
&lt;td&gt;Exactly 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worse Than Naive Forecast Model&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;x&amp;gt;1x &amp;gt; 1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Severity Emojis 🚨
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Emoji&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Perfect&lt;/td&gt;
&lt;td&gt;💯&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very Acceptable&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptable&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;❗&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very High&lt;/td&gt;
&lt;td&gt;💀&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exceedingly High&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Doesn't Explain Variability&lt;/td&gt;
&lt;td&gt;🚫&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worse Than Simple Mean Model&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Equivalent to Naive Model&lt;/td&gt;
&lt;td&gt;⚖&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worse Than Naive Forecast Model&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Directional Emojis ➡️
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Emoji&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Overestimation&lt;/td&gt;
&lt;td&gt;📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Underestimation&lt;/td&gt;
&lt;td&gt;📉&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nan / None&lt;/td&gt;
&lt;td&gt;🙅‍♂️&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Methodology 📚
&lt;/h2&gt;

&lt;p&gt;For this experiment, I've synthesized datasets using mathematical functions like sine and cosine, which offer a controlled level of predictability. On the modeling end, I've used &lt;code&gt;statsmodels.tsa.ar_model.AutoReg&lt;/code&gt; and &lt;code&gt;OffsetModel&lt;/code&gt;. I chose &lt;code&gt;AutoReg&lt;/code&gt; for its foundational role in time series forecasting, while &lt;code&gt;OffsetModel&lt;/code&gt; serves to mimic good performance by shifting test data. This entire endeavor is laser-focused on &lt;strong&gt;forecasting problems&lt;/strong&gt;, underscoring the fact that all forecasting issues are essentially regression problems, just not the other way around as far as I understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights of Findings ✨
&lt;/h2&gt;

&lt;p&gt;To navigate the labyrinth of metrics, I've laid out my explorations in a tree graph, which you can check out below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FC4_OtDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/ranggakd/DAIly/main/ideas/regression_forecasting_metrics/assets/metrics_exploration.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FC4_OtDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/ranggakd/DAIly/main/ideas/regression_forecasting_metrics/assets/metrics_exploration.png" alt="metrics exploration" width="800" height="1577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The table here provides just a glimpse into the first phase of my deep dive into metrics. For those hungry for the full rundown, it's available &lt;a href="https://github.com/ranggakd/DAIly/tree/main/ideas/regression_forecasting_metrics"&gt;right here&lt;/a&gt;. &lt;strong&gt;Click 📊 for the plot.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plot&lt;/th&gt;
&lt;th&gt;Based on&lt;/th&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;Dataset&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;R2&lt;/th&gt;
&lt;th&gt;MAE&lt;/th&gt;
&lt;th&gt;MSE&lt;/th&gt;
&lt;th&gt;RMSE&lt;/th&gt;
&lt;th&gt;MASE&lt;/th&gt;
&lt;th&gt;MAPE&lt;/th&gt;
&lt;th&gt;sMAPE&lt;/th&gt;
&lt;th&gt;MBDev&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s1_cos_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Test Size&lt;/td&gt;
&lt;td&gt;Small=1&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;cos⁡(x)\cos(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🙅‍♂️&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s1_cos_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;🙅‍♂️&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s1_sin_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🙅‍♂️&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠📉&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s1_sin_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;🙅‍♂️&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s2_cos_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Small=2&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;cos⁡(x)\cos(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s2_cos_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s2_sin_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠📉&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_s2_sin_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_mid_cos_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Mid&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;cos⁡(x)\cos(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_mid_cos_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_mid_sin_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;💀&lt;/td&gt;
&lt;td&gt;☠📉&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_mid_sin_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;☠📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_l_cos_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Large&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;cos⁡(x)\cos(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;❗&lt;/td&gt;
&lt;td&gt;✔️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;💀📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_l_cos_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;❗&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌📈&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_l_sin_ar.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;AutoReg&lt;/td&gt;
&lt;td&gt;🛑&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❗&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;💀&lt;/td&gt;
&lt;td&gt;☠📉&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ranggakd.github.io/DAIly/ideas/regression_forecasting_metrics/plots/testsize_l_sin_om.html"&gt;📊&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;OffsetModel&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;👌&lt;/td&gt;
&lt;td&gt;🤬&lt;/td&gt;
&lt;td&gt;☠&lt;/td&gt;
&lt;td&gt;❗&lt;/td&gt;
&lt;td&gt;☠📈&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Key Insights 🔑
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inconsistent R2 Scores&lt;/strong&gt;: Almost all of the AutoReg and OffsetModel experiments yielded R2 scores that were either nonexistent (&lt;code&gt;🙅‍♂️&lt;/code&gt;) or poor (&lt;code&gt;🛑&lt;/code&gt;). Only one OffsetModel experiment on a large dataset achieved an "Acceptable" R2 score (&lt;code&gt;👌&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Good Performance on Standard Errors&lt;/strong&gt;: Across various test sizes and datasets, both AutoReg and OffsetModel generally performed "Very Acceptable" (&lt;code&gt;👌&lt;/code&gt;) in terms of MAE, MSE, and RMSE metrics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Problematic MASE Scores&lt;/strong&gt;: Every model configuration led to "Worse Than Naive Forecast Model" (&lt;code&gt;🤬&lt;/code&gt;) MASE scores. This suggests that these models might not be better than a simple naive forecast in certain aspects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Diverse MAPE and sMAPE Responses&lt;/strong&gt;: The models varied significantly in their MAPE and sMAPE scores, ranging from "Very Acceptable" (&lt;code&gt;👌&lt;/code&gt;) to "Exceedingly High" (&lt;code&gt;☠&lt;/code&gt; and &lt;code&gt;💀&lt;/code&gt;), especially on sine (
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) datasets. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bias Direction&lt;/strong&gt;: The Directional Emojis indicate a tendency for the models to either overestimate (&lt;code&gt;📈&lt;/code&gt;) or underestimate (&lt;code&gt;📉&lt;/code&gt;) the values. The direction of bias appears consistent within the same dataset but varies between datasets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complexity vs. Error&lt;/strong&gt;: Larger test sizes didn't necessarily yield better error metrics. In fact, some larger test sizes led to "High" (&lt;code&gt;❌&lt;/code&gt;) and even "Very High" (&lt;code&gt;💀&lt;/code&gt;) errors, as seen in the last row of the table.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dataset Sensitivity&lt;/strong&gt;: The models' performance was noticeably different between the sine (
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) and cosine (
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;cos⁡(x)\cos(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) datasets, showing that dataset characteristics heavily influence metric values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Best Scenario&lt;/strong&gt;: If one had to pick, OffsetModel with a large dataset and the sine function (
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;sin⁡(x)\sin(x)&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) yielded a balanced outcome, achieving "Acceptable" (&lt;code&gt;👌&lt;/code&gt;) ratings in almost all metrics, barring MASE (&lt;code&gt;🤬&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limitations &amp;amp; Risks&lt;/strong&gt;: It's important to remember that these experiments used synthetic data and specific models; thus, the results may not be universally applicable. Caution should be exercised when generalizing these insights.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please note that these insights are derived from synthetic data and controlled experiments. They are intended to offer a glimpse into the behavior of different metrics and should be used with caution in practical applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Points for Critique 🤔
&lt;/h2&gt;

&lt;p&gt;I'm all ears for any constructive feedback on various fronts:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did I get the interpretation of these metrics right?&lt;br&gt;
Are there any hidden biases that I might have missed?&lt;br&gt;
Is there a more suitable metric that should be on my radar?&lt;br&gt;
Did you spot a typo? Yes, those bother me too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Digging into metrics is a lot like treasure hunting; you don't really know what you've got until you put it under the microscope. That's why I'm so eager to get your feedback. I've listed a few questions above, but let's delve a bit deeper.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interpretation of Metrics&lt;/strong&gt;: I've given my best shot at understanding these metrics, but it's entirely possible that I've overlooked some nuances. If you think I've missed the mark or if you have a different angle, I'm keen to hear it. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Potential Biases&lt;/strong&gt;: When you're neck-deep in numbers, it's easy to develop tunnel vision and miss out on the bigger picture. Have I fallen into this trap? Your external perspective could provide invaluable insights.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alternative Metrics&lt;/strong&gt;: While I've focused on some of the most commonly used metrics, the field is vast. If there's a gem I've missed, do let me know. I'm always up for adding another tool to my analytical toolbox.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typos and Errors&lt;/strong&gt;: Mistakes are the bane of any data scientist's existence, and not just in code. If you've spotted a typo, I'd appreciate the heads up. After all, clarity is key when it comes to complex topics like this.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;So, am I on the right track, or is there room for improvement?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your input could be the missing puzzle piece in my metrics exploration journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion 🤝✅
&lt;/h2&gt;

&lt;p&gt;So there it is—my metric safari in a nutshell. It's been an enlightening experience for me, and I hope it shines some light for you too. &lt;strong&gt;I'm still on the learning curve, and I'd love to hear your thoughts.&lt;/strong&gt; Whether it's a critique or a thumbs-up, all feedback is golden.&lt;/p&gt;

&lt;p&gt;If this sparked your curiosity, let's keep the conversation going. Feel free &lt;strong&gt;to drop a comment below, write your own post in response, or reach out to me&lt;/strong&gt; directly at my &lt;a href="https://beacons.ai/ranggakd"&gt;link&lt;/a&gt;. If you'd like to delve deeper, the full summary of my findings is available &lt;a href="https://github.com/ranggakd/DAIly/tree/main/ideas/regression_forecasting_metrics"&gt;here&lt;/a&gt;. Better yet, why not &lt;strong&gt;conduct your own investigations?&lt;/strong&gt; I'd be thrilled to see where you take it. You can follow my progress and check out my portfolio repository here&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/ranggakd"&gt;
        ranggakd
      &lt;/a&gt; / &lt;a href="https://github.com/ranggakd/DAIly"&gt;
        DAIly
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A bunch of Data analysis +AI notebooks I'd worked on almost a daiLY basis
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
DAIly&lt;/h1&gt;
&lt;p&gt;A bunch of &lt;b&gt;D&lt;/b&gt;ata Analysis and &lt;b&gt;A&lt;/b&gt;rtificial &lt;b&gt;I&lt;/b&gt;ntelligence notebooks 🤖 I'd worked on almost a dai&lt;b&gt;LY&lt;/b&gt; basis 👨‍💻&lt;/p&gt;

    
&lt;h2&gt;
Ideas&lt;/h2&gt;
    
This directory might contain notes or outlines of potential data analysis or AI projects that I'm considering working on in the future. These might be in the form of brainstorming notebooks, rough outlines powerpoint of project ideas, or notes on interesting data sources or tools that I want to explore further

&lt;h3&gt;
&lt;a href="https://github.com/ranggakd/DAIlyideas/helpful_rating_system/Goodbye_Average_Rating_System_Hello_Helpful_Rating_System.ipynb"&gt;Goodbye Average Rating System Hello Helpful Rating System&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Redefining the average rating system by factoring in people's feedback&lt;/p&gt;
&lt;h3&gt;
&lt;a href="https://github.com/ranggakd/DAIlyideas/regression_forecasting_metrics/Metrics_Exploration.ipynb"&gt;Regression and Forecasting Metrics Exploration&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Navigating the maze of regression and forecasting metrics to understand their behavior and implications&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/ranggakd/DAIly#daily"&gt;back to ⬆&lt;/a&gt;&lt;/p&gt;

    
&lt;h2&gt;
Tips&lt;/h2&gt;
    
This directory might contain more practical information, such as code snippets or tutorials that I've found helpful in my data analysis and AI work. These could be tips on how to use specific libraries…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/ranggakd/DAIly"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Let's keep exploring and innovating together!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://beacons.ai/ranggakd" class="ltag_cta ltag_cta--branded"&gt;Check out all the links on my beacons.ai page&lt;/a&gt;
&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>discuss</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Recyclable and Low Fat Products | LeetCode | MSSQL</title>
      <dc:creator>Retiago Drago</dc:creator>
      <pubDate>Sun, 23 Jul 2023 12:55:04 +0000</pubDate>
      <link>https://dev.to/ranggakd/recyclable-and-low-fat-products-leetcode-mssql-c2b</link>
      <guid>https://dev.to/ranggakd/recyclable-and-low-fat-products-leetcode-mssql-c2b</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;The given problem involves the 'Products' table, structured as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column Name&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;product_id&lt;/td&gt;
&lt;td&gt;int&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;low_fats&lt;/td&gt;
&lt;td&gt;enum&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;recyclable&lt;/td&gt;
&lt;td&gt;enum&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Here, &lt;code&gt;product_id&lt;/code&gt; is the primary key. &lt;code&gt;low_fats&lt;/code&gt; and &lt;code&gt;recyclable&lt;/code&gt; are ENUM types, both denoting whether the product is low fat ('Y' or 'N') and whether it is recyclable ('Y' or 'N'), respectively. The task is to find the ids of the products that are both low fat and recyclable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;For example, given the 'Products' table:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;product_id&lt;/th&gt;
&lt;th&gt;low_fats&lt;/th&gt;
&lt;th&gt;recyclable&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;td&gt;N&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;N&lt;/td&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;N&lt;/td&gt;
&lt;td&gt;N&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The expected output should be:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;product_id&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The output lists the &lt;code&gt;product_id&lt;/code&gt; values for products that are both low fat (i.e., &lt;code&gt;low_fats = 'Y'&lt;/code&gt;) and recyclable (i.e., &lt;code&gt;recyclable = 'Y'&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;We'll look at two different SQL queries and discuss their approaches, performance, and characteristics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Source Code 1
&lt;/h3&gt;

&lt;p&gt;The first SQL query uses a straightforward &lt;code&gt;WHERE&lt;/code&gt; clause to filter out products that are both low fat and recyclable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;product_id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;low_fats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Y'&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;recyclable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Y'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query directly utilizes the equality operator for filtering the desired records. Its runtime is 929ms, which surpasses 51.43% of the other submissions on LeetCode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ddonEL4I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lnfr2cp0vrqyrk3c2zpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ddonEL4I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lnfr2cp0vrqyrk3c2zpj.png" alt="s1" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Source Code 2
&lt;/h3&gt;

&lt;p&gt;The second SQL query differs in that it uses a &lt;code&gt;CASE&lt;/code&gt; statement in the &lt;code&gt;WHERE&lt;/code&gt; clause:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;product_id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; 
  &lt;span class="k"&gt;CASE&lt;/span&gt; 
    &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;low_fats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Y'&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;recyclable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Y'&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this approach, we're using a &lt;code&gt;CASE&lt;/code&gt; statement to encapsulate the condition within a switch case structure. If the product is both low fat and recyclable, it returns 1; otherwise, 0. The &lt;code&gt;WHERE&lt;/code&gt; clause filters out the records with a return value of 1. Its runtime is 1316ms, beating 13.20% of LeetCode submissions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SXsayrrf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kn0mbigexyzzxa3jalx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SXsayrrf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kn0mbigexyzzxa3jalx.png" alt="s2" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These two solutions offer two distinct approaches to the same problem: the first uses a simple boolean logic in the &lt;code&gt;WHERE&lt;/code&gt; clause, while the second employs a more complex conditional (&lt;code&gt;CASE&lt;/code&gt;) statement within the &lt;code&gt;WHERE&lt;/code&gt; clause. &lt;/p&gt;

&lt;p&gt;While the first approach provides a more readable and faster solution, the second approach might come in handy when dealing with more complex scenarios. However, it is worth noting that the &lt;code&gt;CASE&lt;/code&gt; statement introduces additional computation, which may explain the slower runtime. &lt;/p&gt;

&lt;p&gt;In terms of LeetCode performance, the solutions rank as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Source Code 1&lt;/li&gt;
&lt;li&gt;Source Code 2&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Nonetheless, real-world RDBMS performance may vary based on factors such as indexing, data distribution, and database optimization techniques.&lt;/p&gt;

&lt;p&gt;You can find the original problem at &lt;a href="https://leetcode.com/problems/recyclable-and-low-fat-products/description/"&gt;LeetCode&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more insightful solutions and tech-related content, feel free to connect with me on my &lt;a href="https://beacons.ai/ranggakd"&gt;Beacons page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://beacons.ai/ranggakd" class="ltag_cta ltag_cta--branded"&gt;👉 Check out all the links on my beacons.ai page 👈&lt;/a&gt;
&lt;/p&gt;

</description>
      <category>mssql</category>
      <category>database</category>
      <category>leetcode</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
