<?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: daudfernando</title>
    <description>The latest articles on DEV Community by daudfernando (@daudfernando).</description>
    <link>https://dev.to/daudfernando</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%2F857930%2Fd97a60af-76f8-44ee-bf9b-a77041aaa6d3.jpeg</url>
      <title>DEV Community: daudfernando</title>
      <link>https://dev.to/daudfernando</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/daudfernando"/>
    <language>en</language>
    <item>
      <title>I wonder whether you are a proper stakeholder.</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Tue, 28 Jun 2022 23:11:50 +0000</pubDate>
      <link>https://dev.to/daudfernando/i-wonder-whether-you-are-a-proper-stakeholder-2fhj</link>
      <guid>https://dev.to/daudfernando/i-wonder-whether-you-are-a-proper-stakeholder-2fhj</guid>
      <description>&lt;p&gt;Working on a project requires a lot of resources. The difficulty of gathering resources is secondary to developing a product concept. This problem makes the basis that a project requires three or more stakeholders who are relevant to the objectives of a product, but they are ready in terms of resources such as money and infrastructure.&lt;/p&gt;

&lt;p&gt;Quoting to the Project Management Institute, the failure of a project is usually caused by a lack of project sponsors. The project sponsor is the main stakeholder who provides a lot of resources and advocacy from the very beginning of the project until the project is completed. However, in a project, there is not only a project sponsor. But several other stakeholders need to be identified by:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask your project sponsor and business analyst for a preliminary list of stakeholders.&lt;/li&gt;
&lt;li&gt;Interview specific people on your team to gain knowledge about stakeholder groups.&lt;/li&gt;
&lt;li&gt;If you want to engage a larger audience, hold workshops.&lt;/li&gt;
&lt;li&gt;Also, provide a survey for all stakeholder teams working remotely.&lt;/li&gt;
&lt;li&gt;The most important thing, of course, is to review the project documentation. From here, you will know a lot of information, such as the business processes and organizational structure of the project being worked on.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Don't let the list of stakeholder names spread across multiple documents; make it a primary copy. This document is called the Stakeholder Register, in the form of a table like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WkgMRDEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1pe4s0gecmp063fjssn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WkgMRDEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1pe4s0gecmp063fjssn.png" alt="Stakeholder Register" width="880" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The list of stakeholders is then made into a map by considering the strengths and interests in this project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yRTbZdla--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxcv2psn1dhiyd8rtsxr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yRTbZdla--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxcv2psn1dhiyd8rtsxr.png" alt="Matrix" width="381" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After mapping all existing stakeholders, it's time to make an engagement plan between existing stakeholders using the Stakeholder Engagement Assessment Matrix.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DCBABSCK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mp83e0czze21zfoh4uu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DCBABSCK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mp83e0czze21zfoh4uu.png" alt="Assessment Engagement" width="880" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This table will map each stakeholder at which level, complete with the desired level of transformation of these stakeholders. To make changes to a level that is below the Neutral level, you can do it in two ways, namely:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We identify the reason for resistance. It could be a concern about losing control over the process or being fearful about learning new systems.&lt;/li&gt;
&lt;li&gt;Find ways to minimize concerns and maximize opportunities.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Well, that's the way to manage stakeholders in a project. Let me know if you have several questions to be clarified in the comment section below!&lt;/p&gt;

</description>
      <category>productivity</category>
    </item>
    <item>
      <title>Wait, I changed my mind.</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Sat, 25 Jun 2022 02:03:12 +0000</pubDate>
      <link>https://dev.to/daudfernando/wait-i-changed-my-mind-2h0d</link>
      <guid>https://dev.to/daudfernando/wait-i-changed-my-mind-2h0d</guid>
      <description>&lt;p&gt;We don't always have the right decision all the time. Sometimes we change our minds because of a sudden change in conditions. This is undoubtedly an excellent opportunity to make decisions that are genuinely by current needs. This can also be done by database technology and has even been applied several times to real cases worldwide. One example is that we enter information that can only be accessed by the admin. However, it turns out that if we do not have that access, the database will immediately cancel the process. This process can be achieved by using SQL Transaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Transactions
&lt;/h2&gt;

&lt;p&gt;SQL transaction is one of the procedural languages ​​in SQL that can increase computation and reduce the memory usage when executing a query. Not only that, SQL transactions will facilitate us to meet our previous needs. At least two conditions will be achieved when running a SQL transaction. First, when the query is executed because it satisfies the condition. &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%2F2ddzupq5rhgflwy7c25r.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%2F2ddzupq5rhgflwy7c25r.png" alt="Transaction Success"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Second, it will be aborted when the executed query does not meet the requirements.&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%2Fb4sk742h7jywub5hyawp.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%2Fb4sk742h7jywub5hyawp.png" alt="Transaction Failed"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Anatomy of SQL Transaction
&lt;/h2&gt;

&lt;p&gt;Like PL/SQL, SQL Transaction consists of identifiers such as DECLARE, BEGIN, and END. But to note is the unique part:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start Transaction =&amp;gt; to initialize SQL Transaction&lt;/li&gt;
&lt;li&gt;Commit =&amp;gt; Processing the query&lt;/li&gt;
&lt;li&gt;Rollback =&amp;gt; Cancel query&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Case study
&lt;/h2&gt;

&lt;p&gt;To implement it, let's go to the banking sector. Suppose we have a cash withdrawal machine or ATM. This machine has special provisions if a customer wants to withdraw money, including:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The balance must be sufficient&lt;/li&gt;
&lt;li&gt;The minimum total balance in the account is 50,000 IDR&lt;/li&gt;
&lt;li&gt;The nominal taken is in the form of a sheet of 50.000 IDR&lt;/li&gt;
&lt;li&gt;The withdrawal amount is in the range of 50,000 IDR – 1,000,000 IDR
Suppose a user has a balance of 400,000 IDR, and then he plans to withdraw money 4 times with each withdrawal of 100,000 IDR. What happened to the funds in his account?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Analysis is the key!
&lt;/h2&gt;

&lt;p&gt;Disclaimer! We must assume that the database that we create will only be related to ATM machines that can make money withdrawals. To simplify troubleshooting, let's create a table structure for this case.&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%2Fmt9o19jbgppvox7495eo.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%2Fmt9o19jbgppvox7495eo.png" alt="Table Structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we realize what crucial things need to be saved, we ensure one piece of data is in the table with dummy personal data, but the remaining balance is definitely 400,000 IDR. After creating a registered user, it's time to use our knowledge to complete a SQL transaction that satisfies the previous four conditions. Let's discuss each state that our PL/SQL must-have one by one.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The balance must be sufficient, meaning that we create a condition if the user withdraws money with a withdrawal nominal greater than the remaining balance, meaning the transaction will be canceled.&lt;/li&gt;
&lt;li&gt;The remaining balance must be available at least 50,000 IDR, meaning that we create a condition where withdrawals cannot be made if the remaining balance is only 50,000 IDR.&lt;/li&gt;
&lt;li&gt;This ATM is only available in 50,000 IDR currency. Make sure each user can only make withdrawals in multiples of 50,000 IDR.&lt;/li&gt;
&lt;li&gt;Do not allow users to withdraw balances below 50,000 IDR or above 1,000,000 IDR.
After everything is clear, let's do the execution in managing this ATM database.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ATM, here we come!
&lt;/h2&gt;

&lt;p&gt;Start by disabling auto-commit, which by default is enabled by the database we use.&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%2Fz473e669tga2imfqhh97.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%2Fz473e669tga2imfqhh97.png" alt="Commit set"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, we need to create a database and tables that fit the structure. We will use MySQL with a database connection to MariaDB.&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%2Fonzqrzbprltzy06a5m4u.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%2Fonzqrzbprltzy06a5m4u.png" alt="Customer Table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then let's register one user into the customer's table.&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%2Fcz9j3puog8xlimlhmenx.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%2Fcz9j3puog8xlimlhmenx.png" alt="Customer value"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The awaited moment has arrived. Let's make a transaction that can facilitate these four conditions. We will divide it into several stages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First of all, let's change the delimiter of each query with a // flag (this is for execution in multiple questions in SQL transactions). Don't forget when it's activated (and the SQL transaction has been created), the delimiter mark must be returned to its original state by changing it to ;&lt;/li&gt;
&lt;/ul&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%2Fgf0w3lmjexp5kcvqnitp.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%2Fgf0w3lmjexp5kcvqnitp.png" alt="Delimiter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, we need to define the procedure's name that will contain our SQL Transaction. Then we also need to initialize any parameters, either input or output, when calling the procedure. Let's call this procedure withdrawal with the parameters account_number, pin, total withdrawal, and a notification containing the transaction's success.&lt;/li&gt;
&lt;/ul&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%2Fjr90rspjf6jqjn36qwsy.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%2Fjr90rspjf6jqjn36qwsy.png" alt="Procedure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After that, let's define when an anomaly occurs we are using so that there is no need for&lt;/li&gt;
&lt;/ul&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%2Fvtyfpb783lwu44rryh4a.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%2Fvtyfpb783lwu44rryh4a.png" alt="Parameter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Troubleshooting when the database is not running correctly through Error Handling. In addition, several local variables are created that can be used as a calculation process in the stored procedure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We first ensure that the customer who will enter the system has been registered and entered the appropriate account or pin. We also define a local variable that can hold the business processes in this ATM by reducing the remaining balance available by withdrawing the balance made.&lt;/li&gt;
&lt;/ul&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%2Fh2kmh9ldsef5mvzh5fwh.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%2Fh2kmh9ldsef5mvzh5fwh.png" alt="Business Process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Condition number four can be done in this way. This ensures that withdrawals are made within the defined range.&lt;/li&gt;
&lt;/ul&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%2Fsvpbpef5f3v44c0zzd81.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%2Fsvpbpef5f3v44c0zzd81.png" alt="First Condition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The nominal multiple of 50,000 IDR can be found by finding the remainder of the quotient by 50,000.&lt;/li&gt;
&lt;/ul&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%2F5ede99a345muwz1e0cah.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%2F5ede99a345muwz1e0cah.png" alt="Second condition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following condition is that there must be at least 50,000 IDR in the balance.&lt;/li&gt;
&lt;/ul&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%2Fva6wusdhyh56netu6il9.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%2Fva6wusdhyh56netu6il9.png" alt="Third Condition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When all conditions are met, the remaining balance value of the user will be deducted and updated automatically.&lt;/li&gt;
&lt;/ul&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%2F9seoh0sxiwg0vgb80fx4.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%2F9seoh0sxiwg0vgb80fx4.png" alt="Business Process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the whole SQL transaction procedure looks like this.&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="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;atm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;PROCEDURE&lt;/span&gt; &lt;span class="n"&gt;withdrawal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;in_account&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;in_pin&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;in_amount&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;OUT&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="n"&gt;exist&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="n"&gt;balance_cust&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="n"&gt;remain_balance&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="n"&gt;EXIT&lt;/span&gt; &lt;span class="k"&gt;HANDLER&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;SQLEXCEPTION&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;BEGIN&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'System Error'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;ROLLBACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;START&lt;/span&gt; &lt;span class="n"&gt;TRANSACTION&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;exist&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in_account&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in_pin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="n"&gt;exist&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Incorrect account number or pin entered'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;ROLLBACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;ELSE&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;remaining_balance&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;balance_cust&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in_account&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in_pin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;remain_balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance_cust&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;in_amount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="n"&gt;in_amount&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="n"&gt;in_amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Withdrawal range is between 50.000 IDR AND 1.000.000 IDR'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;ROLLBACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;ELSE&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="n"&gt;in_amount&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                          &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'The multiple of withdrawal is 50.000 IDR'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                          &lt;span class="k"&gt;ROLLBACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;ELSE&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                          &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="n"&gt;remain_balance&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                                  &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Minimum remaining balance is 50.000 IDR'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                                  &lt;span class="k"&gt;ROLLBACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                          &lt;span class="k"&gt;ELSE&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                                  &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;remaining_balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;remain_balance&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in_account&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;in_pin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                                  &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;notif&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Withdrawal of balance successfull'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                                  &lt;span class="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                          &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;                  &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;          &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's time to validate our query by calling this procedure four times according to the case study. Each withdrawal is 100,000 IDR.&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%2F0r1hbn99ttok1zudyebs.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%2F0r1hbn99ttok1zudyebs.png" alt="Validation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yup, the database for the ATM machine that we made has worked! Thank you for reading!&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>sql</category>
    </item>
    <item>
      <title>Dealing with the date data type.</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Thu, 23 Jun 2022 08:52:57 +0000</pubDate>
      <link>https://dev.to/daudfernando/dealing-with-the-date-data-type-59f8</link>
      <guid>https://dev.to/daudfernando/dealing-with-the-date-data-type-59f8</guid>
      <description>&lt;p&gt;Time is a valuable measure to obtain in an online transaction. With time we can see a trend in each of the available deals. However, it is undeniable that when a database stores the time of a successful transaction, there is segmentation between each time unit.&lt;/p&gt;

&lt;p&gt;For example, in the image above, several units of time and date are separate and have their respective columns. This occasion will depend on the case study to be completed. But in this case, we need a date and time in ISO 8601 format.&lt;/p&gt;

&lt;p&gt;Not only can this be achieved using SQL queries with the built-in CONCAT function, but Tableau can also do this with the built-in functions provided by creating a new column.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the problem?
&lt;/h2&gt;

&lt;p&gt;In this case, we will try to see how big the comparison is between transactions returned by men and women per quarter from 2018 to 2022. Then conclude which gender makes the majority of transaction returns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create transaction return date and time
&lt;/h2&gt;

&lt;p&gt;Recall that our data set consists of several columns of time units. We must make this state into one column for the date and time. We will use the MAKEDATE function for dates, which will take three value arguments when used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y-tEU33y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tdaqvi792yxxo8nzwof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y-tEU33y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tdaqvi792yxxo8nzwof.png" alt="MAKEDATE Function" width="488" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ensure the order of input arguments is appropriate and must also be type integer yes. So the return date column will be like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7bp6y-lD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6sc5p6ens7zfrri4w5f5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7bp6y-lD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6sc5p6ens7zfrri4w5f5.png" alt="Return date" width="602" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As with time, in Tableau, we will use the MAKETIME function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zor56cIA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fx003408pgwt8psxk18n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zor56cIA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fx003408pgwt8psxk18n.png" alt="MAKETIME Function" width="465" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thus the return time column will be created as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qgIbLoEt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hrph5cedszkra162exx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qgIbLoEt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hrph5cedszkra162exx.png" alt="Return time" width="443" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you've successfully created the date and time columns, it's time to make all of them into a timestamp. This time we will use the MAKEDATETIME function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_37Y8t0m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s5wzm2xg8ood8g4hczy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_37Y8t0m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s5wzm2xg8ood8g4hczy.png" alt="MAKEDATETIME Function" width="481" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the column that we create becomes like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3rJ2Fl4x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7ptm94ffl9qt9cfohgl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3rJ2Fl4x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7ptm94ffl9qt9cfohgl.png" alt="Timestamp field" width="534" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Transactions and returns, which is more?
&lt;/h2&gt;

&lt;p&gt;Let's create a line chart representing the changes in these two metrics per successive quarter. So the steps taken are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a row in a new sheet with COUNT DISTINCT of total transactions returned and TOTAL quantity of transactions received.&lt;/li&gt;
&lt;li&gt;Compare the two values ​​based on time with continuous units of quarters.&lt;/li&gt;
&lt;li&gt;Don't forget to change the two measurements in rows to dual axes, so they stand on the same Cartesian chart.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G9dFlwZ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsr0qwapkktyxgfglm0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G9dFlwZ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsr0qwapkktyxgfglm0r.png" alt="Return Ratio" width="880" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Do not be fooled
&lt;/h2&gt;

&lt;p&gt;At first glance, the line chart shows that the returned transaction is greater than the entire transaction. This chart can present a bias for our audience and must be adjusted to show the percentage between the two line charts. The method :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new column named % of return, which results from the division between the total transactions returned and the complete transactions.&lt;/li&gt;
&lt;li&gt;Change the data type format to a percentage with a precision of one digit after a comma.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So that the trend of the returned transactions can be seen on this line chart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mhm6nl8O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlx8e7arcocvtgqhtgve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mhm6nl8O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlx8e7arcocvtgqhtgve.png" alt="Return Ratio" width="880" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So, is it a woman or a man?
&lt;/h2&gt;

&lt;p&gt;The last step that needs to be done is to see the comparison between men and women, who often return their transactions. We can achieve this goal by giving a Marks Card in the color section of a Gender column consisting of Male and Female so that it becomes a line chart between the two sexes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1s2TUBiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adk1fr8yv3528iqkekwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1s2TUBiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adk1fr8yv3528iqkekwk.png" alt="Marks Card gender" width="411" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look, it turns out that the female gender is the majority of customers who make transaction returns. This uniqueness certainly needs further analysis!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o47a_jWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d99rcx2oons40cuuft6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o47a_jWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d99rcx2oons40cuuft6i.png" alt="Gender Return Ratio" width="602" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Analyze the business first</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Wed, 22 Jun 2022 08:04:07 +0000</pubDate>
      <link>https://dev.to/daudfernando/analyze-the-business-first-170f</link>
      <guid>https://dev.to/daudfernando/analyze-the-business-first-170f</guid>
      <description>&lt;p&gt;We all know that business analysis is crucial in evaluating performance to achieve work efficiency. There are two conditions to achieve efficiency. The first reduces the cost (resources) of production, and the second increases income.&lt;/p&gt;

&lt;p&gt;Because the basis (or the goal) is the same, the analysis process must have a mature framework. So that in the process, each analysis carried out can be interpreted quickly and allows for reuse with different case studies, or the term is modularity. I am introducing a framework called business analytics which consists of three main stages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IYQ9H_HJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jil3vzpclp4s7xxr8iwf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IYQ9H_HJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jil3vzpclp4s7xxr8iwf.png" alt="Process" width="880" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Descriptive Analytics
&lt;/h2&gt;

&lt;p&gt;Descriptive analytics is the first stage of an analyst to review his entire data from the top point of view. This point of view will provide an overview of existing data distribution after we know the problem we want to solve.&lt;/p&gt;

&lt;p&gt;This stage requires an analyst to understand the problem comprehensively and create a rough technical framework for solving it. This stage will also produce findings that cannot be obtained directly from the data. This insight will then be the basis for the problem-solving steps that are carried out.&lt;/p&gt;

&lt;p&gt;For example, this stage will present a dashboard that can briefly understand what events have occurred in the distribution of available data. This dashboard allows the emergence of questions that can be answered directly using the dashboard or report available at this stage (of course, after adjusting to the problem to be solved).&lt;/p&gt;

&lt;h2&gt;
  
  
  Predictive Analytics
&lt;/h2&gt;

&lt;p&gt;Prescriptive analytics is the second stage that predicts a data trend. This stage will generally deal with columns of data type timestamps. Data types in date and time can be used as a reference for a KPI at a particular deadline and then compared with other deadlines in a specific line chart.&lt;/p&gt;

&lt;p&gt;For example, a profit is shown in a line chart. Then from the trend formed, the yield will be projected on several future deadlines to create profit forecasting from the unrestricted movement. Ensure the prediction model has a good MAE or MAPE evaluation level so the prediction results are not too far from the original data later. It is also necessary to ensure that there is a repetitive trend and not too varied to create the prediction results optimally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prescriptive Analytics
&lt;/h2&gt;

&lt;p&gt;The final stage is the gold of all. At this stage, all the analysis results are expected to produce a series of strategies for solving problems in a structured manner. Undeniably, the analysis results made by an analyst must be helpful to achieve the two bases of goals that have been defined previously. Therefore, the form of the output product from this stage can be of various kinds and is generally in the form of a model in ​​five data mining roles. The five functions include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Estimation (estimating the value of a data based on the similarity of the previously generated attributes)&lt;/li&gt;
&lt;li&gt;Forecasting (predicting a value based on the trend of previous data on a specific date.&lt;/li&gt;
&lt;li&gt;Classification (grouping a data based on similarities in specific categories)&lt;/li&gt;
&lt;li&gt;Clustering (grouping data based on proximity to a centroid in each cluster)&lt;/li&gt;
&lt;li&gt;Association (shows the relationship between available data)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of the five roles, the developed model will have various functionalities. However, in general, it will produce new data that can reduce production costs &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Is the decision understandable?</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Tue, 21 Jun 2022 14:15:20 +0000</pubDate>
      <link>https://dev.to/daudfernando/is-the-decision-understandable-5f05</link>
      <guid>https://dev.to/daudfernando/is-the-decision-understandable-5f05</guid>
      <description>&lt;p&gt;The decision tree becomes a model that can help classify several repetitive categories. With the similarity of some of the attributes of data observations, a set of sequential rules can be created that indicates which types of data observations exist.&lt;/p&gt;

&lt;p&gt;Let's look at one example using the case of classifying drugs based on transactional data of patients from a pharmacy (note, the data has been preprocessed before and is still using the CRISP-DM method. Click &lt;a href="https://dev.to/daudfernando/your-car-is-costly-3ep7"&gt;here&lt;/a&gt; to read more)&lt;/p&gt;

&lt;h2&gt;
  
  
  Strong tree with a solid foundation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PrAcvu7F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsw3pwzm6nwypkl7cxq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PrAcvu7F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsw3pwzm6nwypkl7cxq8.png" alt="Tree" width="880" height="370"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Like a tree that soars into the sky with various components, this one decision tree towers down and also has several important features to understand first.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Root node, meaning a primary variable that determines a data category.&lt;/li&gt;
&lt;li&gt;Splitting, meaning an advanced process of classifying data into several other determining variables based on a particular threshold value.&lt;/li&gt;
&lt;li&gt;Decision node, when a node that has been split is divided back into several more nodes, it is called a decision node.&lt;/li&gt;
&lt;li&gt;The leaf node is the last node that determines a data observation.&lt;/li&gt;
&lt;li&gt;Branch / Sub Tree, meaning a sub-part of several nodes in one tree.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After knowing the most critical components in the decision tree, the next step is to apply the algorithm to make a suitable model. The algorithm used is the C4.5 algorithm with three main repetitive steps as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Root node creation process&lt;/li&gt;
&lt;li&gt;Leaf node formation process&lt;/li&gt;
&lt;li&gt;Return to step one to max_depth of this algorithm.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Root node, where are you?
&lt;/h2&gt;

&lt;p&gt;The root node is created on which variable ensures a classification is formed. Therefore it will use a metric called entropy with a formula like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cp3jskQf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbozc08gtzkjijwhnrho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cp3jskQf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbozc08gtzkjijwhnrho.png" alt="Entropy" width="305" height="70"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We will search the entropy value of each little weight in each attribute with a nominal categorical data type. One of the nominal values ​​obtained is the entropy as follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MCK0B0DW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhpnej9g1vsx6pa6e51k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MCK0B0DW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhpnej9g1vsx6pa6e51k.png" alt="Sex (M) Entropy" width="761" height="215"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;After all nominal values ​​get their entropy, proceed with searching for the best gain value. The gain value shows how much entropy value is wasted on each attribute. This number can be achieved using the following formula.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A6sXgess--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8yktrekgidmp835jjs3a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A6sXgess--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8yktrekgidmp835jjs3a.png" alt="Gain Formula" width="637" height="83"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of them is the gain value in the Na_to_K_binned attribute. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W_wBAIeD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pp0s37pcuzglu00ll42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W_wBAIeD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pp0s37pcuzglu00ll42.png" alt="Gain Value Na_to_K_binned" width="847" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, let's get how many nodes will be divided or the number of decision nodes. We can achieve this condition with the split info or intrinsic info formula.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ofpFhhie--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4yfjzzlxoe2ci1lal51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ofpFhhie--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4yfjzzlxoe2ci1lal51.png" alt="Split Info Formula" width="588" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One example is the Na_to_K_binned attribute returns to get the split info value. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lhzqx1GO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77cnpxyadb0sysoc7p8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lhzqx1GO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77cnpxyadb0sysoc7p8r.png" alt="Split Info" width="740" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then it is time for the determination stage to find the most significant gene ratio metric among all its features. We can obtain this value by comparing the gain value with the split info value of each attribute. Look at the value on the attribute BP has the largest gain ratio.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K-v0JPvJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j0f6qarg49ohyb1volg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K-v0JPvJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j0f6qarg49ohyb1volg.png" alt="Gain Ratio" width="448" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So that the first decision tree framework will be created as follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oLCbSbe7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z88tpf5ga9yg9daf2jxc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oLCbSbe7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z88tpf5ga9yg9daf2jxc.png" alt="First Decision Tree" width="524" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Foliage, grow!
&lt;/h2&gt;

&lt;p&gt;Do the same thing until an attribute can no longer be divided into several nodes. And in the end, We will create a complete decision tree like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iT8vSP4M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7rvpddequ1zwiwvpzxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iT8vSP4M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7rvpddequ1zwiwvpzxy.png" alt="Decision Tree" width="880" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus, Rapid Miner with all its conveniences.
&lt;/h2&gt;

&lt;p&gt;After a series of processes are carried out, let's use one of the tools that make it easy to create a model, namely Rapid Miner, with the same data set and a working canvas like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GWNP-7Tg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hji0s1415tyexoky97t4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GWNP-7Tg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hji0s1415tyexoky97t4.png" alt="Rapid Miner" width="880" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Produce a model with an accuracy rate of 67.26% in classifying the population data compared to the sample data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k7RlQ0me--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iht7n29c6wptcdh17uno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k7RlQ0me--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iht7n29c6wptcdh17uno.png" alt="Accuracy of Decion Tree" width="880" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>decisiontree</category>
    </item>
    <item>
      <title>SAT in the NYC borough, was the performance good enough?</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Mon, 20 Jun 2022 06:57:18 +0000</pubDate>
      <link>https://dev.to/daudfernando/sat-in-the-nyc-borough-was-the-performance-good-enough-3f8f</link>
      <guid>https://dev.to/daudfernando/sat-in-the-nyc-borough-was-the-performance-good-enough-3f8f</guid>
      <description>&lt;p&gt;The SAT (Scholastic Aptitude Test) exam is essential to get data points for each student who wants to continue their tertiary study. A person's SAT score, literacy, numeracy, and writing competencies can be measured as a consideration of whether they are worthy of being accepted by a university or not. The score range of each part of the exam is 200 - 800.&lt;/p&gt;

&lt;p&gt;Because many universities consider this score necessary, many students take this test to go through the selection process for new student admissions. One of them is in New York state. Does each area have the same SAT score with the division of five boroughs? Let's analyze it using the data available in the database.&lt;/p&gt;

&lt;p&gt;Given that our data is still available in a database let's drag using the SQL language in a notebook.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. We have to connect right
&lt;/h2&gt;

&lt;p&gt;In making a connector in the database, it is necessary to use the function available in mysql.connector, then adjust the available arguments to the database to be inputted. In this case, the database name is a school that uses the root account on the local host.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EzRloBej--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apube18i0xf996c81cn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EzRloBej--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apube18i0xf996c81cn3.png" alt="Connector" width="880" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, make the first query to display the available table characteristics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---6-r7tJu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im608vdxxzqsn9aetowz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---6-r7tJu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im608vdxxzqsn9aetowz.png" alt="Table Describe" width="451" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Viewing the top 10 data
&lt;/h2&gt;

&lt;p&gt;Our school table contains several columns that define the average SAT score for each school in each NYC borough. The top ten data held are as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qEvt0U9s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ouiotszp5uqfqqsj5k9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qEvt0U9s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ouiotszp5uqfqqsj5k9u.png" alt="Top 10 data" width="880" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's also check whether the table we have contains empty values ​​or not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SL08bk0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnm48suy8stitzclzq4q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SL08bk0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnm48suy8stitzclzq4q.png" alt="Check Missing Value" width="689" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fortunately, each column in the table has its value.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Math, which school is the best?
&lt;/h2&gt;

&lt;p&gt;Numerical ability is a crucial thing that can be used as a benchmark for someone to be accepted into a university or not. Let's see which school has students with the highest average math scores compared to other schools based on quartiles using Paging in SQL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uURKH8X_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm6hcy5p9mzefpyeufpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uURKH8X_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm6hcy5p9mzefpyeufpq.png" alt="Best Math score" width="592" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stuyvesant High School is the best, with an average math score of 754, which is quite different from second place with 40 points!&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Don't forget about literacy and writing!
&lt;/h2&gt;

&lt;p&gt;Let's see how low NYC students are in the reading aspect first.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w2DfFIES--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dly2ynwrxgog90qh2mx8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w2DfFIES--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dly2ynwrxgog90qh2mx8.png" alt="Minimum reading score" width="424" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A score of 302 is a reasonably low average for a country like New York. Then, what about the current authorship score?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--36WuiOIO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9flqpk9ri2kx1afrwde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--36WuiOIO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9flqpk9ri2kx1afrwde.png" alt="Best writing score" width="515" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Again the same school! We should examine the overall SAT score average at each NYC school.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Let's give it a ranking!
&lt;/h2&gt;

&lt;p&gt;The available schools also need to be seen whether they have the same average score as Stuyvesant High School.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OKBHnNRv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0qum1lhf33ys44tpsey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OKBHnNRv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0qum1lhf33ys44tpsey.png" alt="Rank school" width="612" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It turns out that there are only four schools that have an overall SAT score average that exceeds 2000. Then we can determine which borough of New York City has the best average SAT score.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Which NYC Borough is the best?
&lt;/h2&gt;

&lt;p&gt;Of the five available boroughs, the distribution of the number of schools and the average inevitably SAT score is uneven. Let's see now!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EN_gUkg7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3zxl0nvuodrmsy49dye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EN_gUkg7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3zxl0nvuodrmsy49dye.png" alt="Borough Ranking" width="813" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that the Staten Island area has a reasonably high average overall SAT score compared to other boroughs. However, there are only ten schools in this area. To close this analysis, we will choose a school in the borough of Brooklyn which has 109 schools but with the best average score in mathematics.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Best school for mathematicians in Brooklyn
&lt;/h2&gt;

&lt;p&gt;You can use this method to see which school will be the best place in the average SAT math score.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yrX7PXZ0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub6yob46zinlxjg6nmzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yrX7PXZ0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub6yob46zinlxjg6nmzg.png" alt="Mathematicians in Brooklyn" width="491" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok, next month, Brooklyn Technical High School will be an excellent place for someone aspiring to be a mathematician.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>python</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Your car is costly!</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Sat, 18 Jun 2022 04:13:56 +0000</pubDate>
      <link>https://dev.to/daudfernando/your-car-is-costly-3ep7</link>
      <guid>https://dev.to/daudfernando/your-car-is-costly-3ep7</guid>
      <description>&lt;p&gt;Today I met Michael, who was confused about the car he had just serviced. The car broke down again and again. I don't know how often he had to service his vehicle because of the various conditions. After being traced, the service fees he has spent are equivalent to five times the purchase price of his car. Wow, fantastic, that car had to be replaced with a new car.&lt;/p&gt;

&lt;p&gt;In addition to telling stories about how bad Michael's car was, he also asked me for advice on estimating how much it would cost for specific car criteria. So he can save diligently and have accurate goals. Without further ado, of course, I'm happy to help an old friend who accidentally met at a vehicle repair shop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maps to Help Michael
&lt;/h2&gt;

&lt;p&gt;In helping Michael, I need a roadmap showing the end-to-end process of working on a data mining role regarding Estimation. Of course, I needed a framework called CRISP-DM, or the Cross-Industry Standard Process for Data Mining abbreviation. This framework seems to make it easier for us to help poor Michael. Here I present a series of processes used throughout the project to assist Michael.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YtbDDAEN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bvvy88er6o9f741bn9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YtbDDAEN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bvvy88er6o9f741bn9u.png" alt="CRISP-DM" width="880" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dataset Initiation
&lt;/h2&gt;

&lt;p&gt;Before I get started, I need a bunch of price lists for cars where they come from. And luckily, I can get it directly at this &lt;a href="https://drive.google.com/file/d/1sawciwpff2k6phNl-sq688FoIXzcpa4L/view?usp=sharing"&gt;link&lt;/a&gt;. In the dataset, I called 6019 types of car variations with 14 columns consisting of the car's characteristics and complete with the price of the vehicle. This dataset is big data and will probably represent the vehicle's overall price and help Michael set his savings goals later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Business Understanding
&lt;/h2&gt;

&lt;p&gt;This stage is the beginning to bring up the root of the problem. Luckily Michael has given an overview of the problem and needs help estimating the price of the car he wants in the future. I need a metric threshold to prove that the estimate is not too far off from the original data. I could use one of the metrics called Root Mean Squared Error (RMSE). At least I should get a relatively small RMSE value from an &lt;a href="http://www.eumetrain.org/data/4/451/english/msg/ver_cont_var/uos3/uos3_ko1.htm#:~:text=Since%20the%20errors%20are%20squared,large%20errors%20are%20particularly%20undesirable.&amp;amp;text=Both%20the%20MAE%20and%20RMSE,scores%3A%20Lower%20values%20are%20better."&gt;infinite RMSE range&lt;/a&gt;. That way, the average nominal variation of the estimated car price is not too far from the original price. OK, now to the Data Understanding stage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Understanding
&lt;/h2&gt;

&lt;p&gt;This stage shows a series of processes for exploring the dataset that we have obtained. Using cloud computing provided by Google (Google Colab), we will use the Python language to analyze the surface of our data.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Import equipment
&lt;/h3&gt;

&lt;p&gt;We need some libraries and packages that are already available.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We need Pandas for Data Frame analysis&lt;/li&gt;
&lt;li&gt;Numpy for array calculations and other operations&lt;/li&gt;
&lt;li&gt;Matplotlib and Seaborn for visualization of our analysis results
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ediCsTAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqzpilqx1ibb95t4e15k.png" alt="Importing Package and Library" width="319" height="104"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Upload dataset
&lt;/h3&gt;

&lt;p&gt;Let's upload our dataset into an object called data and look at some examples of the data available there.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4siYsmbB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zmhsfoxn5de1llm2i65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4siYsmbB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zmhsfoxn5de1llm2i65.png" alt="Data Info" width="880" height="370"&gt;&lt;/a&gt;&lt;br&gt;
We can see that our dataset has 14 columns and 6019 rows of data. We need to look at each column's data distribution now.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Describing the dataset
&lt;/h3&gt;

&lt;p&gt;We can describe the dataset we have by first removing the numeric and categorical type columns. This way, we can see the massive distribution of data.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G_q4KHXW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fxg6cczulosncmm26st.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G_q4KHXW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fxg6cczulosncmm26st.png" alt="Data Describe" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
It seems that some of our numerical data are skewed in the data distribution. In addition, some columns should be numeric but become categorical data types in this case.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Something's amiss
&lt;/h3&gt;

&lt;p&gt;We need to look at the distribution of our data with a histogram chart for numeric data. We have a bar chart for categorical data. It turns out that it varies significantly between the columns that we have!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v39arQYP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9evdxbf8ia6qv0mxzknh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v39arQYP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9evdxbf8ia6qv0mxzknh.png" alt="Histogram" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
The Year column shows a negative trend while the Price column indicates a positive bias. The other two columns have too high a frequency of the same value and the same two values ​​(bimodal). This oddness needs to be cleaned up by us later!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qze11qBt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nv78u5qlcqpfbnynybxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qze11qBt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nv78u5qlcqpfbnynybxd.png" alt="Bar chart" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
And yes, that's right, for categorical data, some of them have units that vary and make them of definite data type rather than numeric. But for some other columns, it's OK so far.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Preparation
&lt;/h2&gt;

&lt;p&gt;Data preprocessing is the adjustment of the available columns to produce the best model. Based on the previous stages, the available dataset will be adjusted through several steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Handling missing values
&lt;/h3&gt;

&lt;p&gt;The data information we get shows an imbalance in the number of rows of data between several columns. This circumstance indicates missing observational data. Let's use &lt;code&gt;data.isna().sum()&lt;/code&gt; to accumulate the amount of missing data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5ECL19Nd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py1mzr4qg7793foei5m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5ECL19Nd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py1mzr4qg7793foei5m1.png" alt="Missing values" width="237" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, it turns out that there are several columns with missing values. As a consideration, let's delete the data row that contains the missing value. We might do this because the lost data is still below 10% of the total existing data. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sGq5zR28--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wvhg8ci2fuaw9ali8jw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sGq5zR28--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wvhg8ci2fuaw9ali8jw.png" alt="Drop missing values" width="432" height="92"&gt;&lt;/a&gt;&lt;br&gt;
However, for columns like Unnamed: 0 and also New_Price, it's best to delete the entire column.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--41aHi6QJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbr0rqaef10m900e3tfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--41aHi6QJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbr0rqaef10m900e3tfs.png" alt="Drop unnecessary columns" width="562" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Remove duplicate values
&lt;/h3&gt;

&lt;p&gt;Duplicate data will undoubtedly bias a model because of its repetitive appearance. We can check whether exact data is available or not in this way.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P9CcGhSP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbqvm7s791qftffjy3ou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P9CcGhSP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbqvm7s791qftffjy3ou.png" alt="Handling duplicate values" width="204" height="77"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Phew, luckily, our data has no duplicate values.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. We must set outliers aside
&lt;/h3&gt;

&lt;p&gt;Do you remember the angular distribution of our numerical data? That data should clean immediately. This time, using the z-score value will be very helpful in taking the distribution of values ​​as much as 95% of the quantity so that the numeric column we have will lose the super extreme weight.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cBLgZbX7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i6qs5qgwdnf53kbhthhc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cBLgZbX7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i6qs5qgwdnf53kbhthhc.png" alt="Handling outlier values" width="878" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankfully we only deleted 348 data. This consideration keeps our data representative of the population.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Heatmap shows your correlation!
&lt;/h3&gt;

&lt;p&gt;Heatmap will be very useful for seeing the Pearson correlation between several columns. The correlation heatmap available in seaborn renders the numeric columns as discrete values ​​and crosses between the columns as the y-axis and the x-axis. This time we have to focus on our target column or the purpose of the estimation model we will make later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vHhw_j_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4nn1m0vrf8kvyg17of2q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vHhw_j_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4nn1m0vrf8kvyg17of2q.png" alt="Heatmap p-correlation" width="599" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this, it can be seen that only the Year column, and even then, the correlation is only 0.23, which correlates with the Price target column. Our data needs further preprocessed by encoding categorical columns into numeric ones.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Regex in action
&lt;/h3&gt;

&lt;p&gt;Regular expressions (regex) are crucial for customizing Mileage, Engine, and Power fields. The three columns are of numeric type, but because of the different units used, these columns are identified as categorical type columns. Let's look again at the three types of definite value types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RtjCzNAw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41ojhzaasngdsofqhnpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RtjCzNAw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41ojhzaasngdsofqhnpr.png" alt="Variation value of categorical field" width="319" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OK, that means we will delete each available unit and assume that one column has the same teams by taking only the cardinal values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rO0z76d3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wdewxipqa74kd3qii1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rO0z76d3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wdewxipqa74kd3qii1a.png" alt="Regex" width="811" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note this: don't forget to change the column's data type to float. Because there are several values ​​in the "null" Power column, it's time to delete the empty values ​​that the previous null value has transformed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BWW9dYbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4rll8try29g0dbr95df6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BWW9dYbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4rll8try29g0dbr95df6.png" alt="Handling missing value in Power fields" width="500" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Encode the rest!
&lt;/h3&gt;

&lt;p&gt;Look again at the available value variations in the Transmission and Fuel_Type columns!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vvix1AqI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ip1k5kt1w1r4gf1dt3i4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vvix1AqI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ip1k5kt1w1r4gf1dt3i4.png" alt="Value variation" width="314" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The variation in the values ​​in the two columns is not too much, and this is the right time to use One Hot Encoding. This technique will create new columns according to the variation of column values ​​to be encoded. So the result is like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7AjV9vBM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ospyz8hjbsr05ljr05ak.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7AjV9vBM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ospyz8hjbsr05ljr05ak.png" alt="Encoding result" width="878" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When all the columns have become one DataFrame, it's time to look at the heatmap correlation between attribute variables and classes from the preprocessed dataset.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FZAOnIV9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkr99j7df7b2yegkc0nz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FZAOnIV9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkr99j7df7b2yegkc0nz.png" alt="Heatmap correlation final" width="727" height="744"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this, it can be concluded that several variables determine the price of a car, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Diesel type fuel (Fuel_Type_Diesel)&lt;/li&gt;
&lt;li&gt;Strength of the engine (Engine)&lt;/li&gt;
&lt;li&gt;Available car power (Power)&lt;/li&gt;
&lt;li&gt;Year of the car (Year)&lt;/li&gt;
&lt;li&gt;Transmission type automatic (Transmission_Automatic)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap it up into the model
&lt;/h2&gt;

&lt;p&gt;It's time to make a suitable estimation model. For modeling, I will choose one machine learning algorithm, Random Forest, available in the SK-learn library. The stages in making the model will be divided into three processes.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Train and test with data
&lt;/h3&gt;

&lt;p&gt;In teaching a data model, it is necessary first to divide it into two parts. So the Data Frame, which consists of six columns, is divided into training and test data. Also, make sure to separate the dependent variable as well as the independent variable, yes! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7loDwwNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzhq76w06n7y0dcvkc6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7loDwwNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzhq76w06n7y0dcvkc6k.png" alt="Splitting data" width="649" height="83"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. This car should be at this price.
&lt;/h3&gt;

&lt;p&gt;Let's teach this model using training data in the following way.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NeFqpMJO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bnhyt5mujyju92tuqrvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NeFqpMJO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bnhyt5mujyju92tuqrvy.png" alt="RF Model" width="400" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the model has learned from the available training data, it is time for it to be tested using data that has never been found before (aka data testing). Compare the overall estimation results with the previously split y_test data. Then the accuracy value of this model will be displayed as follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sm_1Nlyn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zw7m6yd1wf245w09ks26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sm_1Nlyn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zw7m6yd1wf245w09ks26.png" alt="Accuracy" width="259" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, that value is good enough as a benchmark for the estimated price of the new car that Michael will buy.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. We need validation
&lt;/h3&gt;

&lt;p&gt;Not necessarily that the model that has been created is ready to use. We must always validate whether the model has estimated the same value as the original data. We can do this by manually looking at the available test data. Then, we try to use the existing model by entering the value of the argument corresponding to the testing data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sy1fMVOh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4r3oxuww3ijth9qky1t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sy1fMVOh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4r3oxuww3ijth9qky1t.png" alt="Validate the model" width="410" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes! the estimated price for the car is not too far away and is entirely accurate. Let's see whether our initial achievement has been met by evaluating some metrics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finally, Evaluation!
&lt;/h2&gt;

&lt;p&gt;Evaluate, evaluate, evaluate! First, I'll show you what variables are the main determinants of how expensive a car can be.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_RiMyoKQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xq2unl3ff1df1y5g7r3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_RiMyoKQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xq2unl3ff1df1y5g7r3m.png" alt="Feature Importance" width="865" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It turns out that the Power variable is the culprit! I have to tell Michael that the higher the quantity of Power of a car, the higher the price of the vehicle will be. This insight will be a piece of helpful information for him. Of course, after I measured how successful this model was via the Root Mean Squared Error (RMSE) metric. RMSE is a metric that results from the root of the Mean Squared Error (MSE), which will show how much the average error value varies from the estimate given by this model. I will look at it this way.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2Qks3aNA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yim6l82jmttg85vov4rn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2Qks3aNA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yim6l82jmttg85vov4rn.png" alt="Evaluation" width="658" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hooray! The RMSE results obtained by this model are too poor and adequately represent the accuracy value of the training data. It's time for me to meet Michael and talk about the insights I've found about him.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How do I know the distribution of my data?</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Fri, 17 Jun 2022 01:26:38 +0000</pubDate>
      <link>https://dev.to/daudfernando/how-do-i-know-the-distribution-of-my-data-1cb8</link>
      <guid>https://dev.to/daudfernando/how-do-i-know-the-distribution-of-my-data-1cb8</guid>
      <description>&lt;p&gt;G'day, mate! Now I will think of you as a leader of an entertainment services company who wants to know how the distribution of anime films is available on the website. Let me use Tableau software to show the distribution of data anime up to 2018!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Critical thinking is also called structured thinking&lt;br&gt;
 ~ Pearl Zhu.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Therefore, we must make a sequential process exploring the available data. Here are some steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--niHKMzfW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcq7h4303dngdbn82gl7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--niHKMzfW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcq7h4303dngdbn82gl7.png" alt="End-to-End Process" width="880" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's wrong with my data?
&lt;/h2&gt;

&lt;p&gt;Data checking is crucial after knowing what business problems you want to solve. At this stage, we can adjust the data types that Tableau automatically sets, but there are errors. For example, the classification field of observation data is detected as a continuous numeric data type, even though the data is a discrete dimension. But, so far, our data is safe, so let's move on to the next stage.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pewFmWrv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hy6pdsmjmrqmr7cbuvdz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pewFmWrv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hy6pdsmjmrqmr7cbuvdz.png" alt="Data Checking" width="880" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  There must be gold behind the unknown.
&lt;/h2&gt;

&lt;p&gt;Now is a good time to interrogate our data, ask various questions about the data, and let a visualization answer our questions. First, we determine the Key Performance Indicators (KPIs), namely the average value of a movie, the total reviewers (audiences who rate a movie), and the total number of available films.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BL8My7k7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebiyxnyfqmsurlgi4pts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BL8My7k7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebiyxnyfqmsurlgi4pts.png" alt="Top 10 Genre Movie" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's separate each genre and get our Top #N Genre as a Treemap (make sure to use parameters for interactive visualization). The treemap will make it easier for us to see the hierarchy of each available genre based on its quantity. This also makes it easier for stakeholders to rank available film genres automatically.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wuJNx2TS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qj2utpii8isvrvayllf1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wuJNx2TS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qj2utpii8isvrvayllf1.png" alt="Treemap of Genre" width="880" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is the film ratings. In a pie chart, let's see how many films are available in each rating. In addition, let's also see how large the distribution of each type of film is in general in the form of a donut chart. These two graphs consist of not too wide varieties; seeing them as a circle graph would be interesting.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CJ3MVhjC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o81edm9my015whkkzw2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CJ3MVhjC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o81edm9my015whkkzw2m.png" alt="Explore Data" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Analyze and Visualize Data
&lt;/h2&gt;

&lt;p&gt;Univariate charts do give a lot of gold over the unknown. However, there are still diamonds we can mine from this data. Let's see with a bivariate graph how the distribution of the average reviewer data, average favorites, and total episodes is related to the average member seen in discrete-time dimensions per year. Let's visualize it using a bar chart and a line chart to compare these metrics with the average member each year.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NnJJkx3b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9nnhc6ticpliqgddra2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NnJJkx3b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9nnhc6ticpliqgddra2.png" alt="Yearly Member" width="880" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, for the overall data distribution, I think that's enough. We can already answer various questions that arise out of curiosity or even when we see the Exploratory Data Analysis that has been done. It's time to unite it all into one unified dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put them all together
&lt;/h2&gt;

&lt;p&gt;It's time to unite all the data visualizations that have been successfully formed through various graphs. Dashboards are an excellent medium for viewing unique data sets based on specific characteristics. With the dashboard in Tableau, we can make a chart a filter for other charts. Very amazing! The first step you need to do is create a layout with a variety of available objects.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QwZH-aHe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9jygd44glg0h17kr11n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QwZH-aHe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9jygd44glg0h17kr11n.png" alt="Adjust the layout." width="393" height="755"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure you create a dashboard that doesn't contain too much information but doesn't lack information between the charts. The purpose of making a dashboard is to see the connection and comparison between existing data. So, I can make all the graphs we have made previously into one dashboard because it will answer various questions regarding data distribution.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rkThYyjP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhpro6zt6zljb3x0oirb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rkThYyjP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhpro6zt6zljb3x0oirb.png" alt="The Dashboard" width="880" height="723"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adjusting the dashboard to the browser size and various visualizations that the dashboard will display, a dashboard has been successfully created. Yey!! You can access the dashboard at &lt;a href="https://public.tableau.com/app/profile/daud.fernando/viz/progress_recommender_movie/Movie?publish=yes"&gt;this link&lt;/a&gt;. One more thing, make sure you filter all the visualizations and existing parameters to the entire visualization in one dashboard. For parameters, you can do it like this.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VYYStlng--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8mg49ldqn8wz1hfojqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VYYStlng--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8mg49ldqn8wz1hfojqj.png" alt="Parameter" width="828" height="220"&gt;&lt;/a&gt;&lt;br&gt;
And for one data visualization, you can do it in the following way. You need to click on icons like a funnel and &lt;em&gt;fwailaa&lt;/em&gt;; a dashboard has been created.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cr5pIVGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2zat5zbjm6i3y6lsaqrx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cr5pIVGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2zat5zbjm6i3y6lsaqrx.png" alt="Filter" width="859" height="477"&gt;&lt;/a&gt;&lt;br&gt;
Thank you for reading this article! See you, mate!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Which one customer do you mean?</title>
      <dc:creator>daudfernando</dc:creator>
      <pubDate>Wed, 15 Jun 2022 23:47:06 +0000</pubDate>
      <link>https://dev.to/daudfernando/which-one-customer-do-you-mean-5bmo</link>
      <guid>https://dev.to/daudfernando/which-one-customer-do-you-mean-5bmo</guid>
      <description>&lt;p&gt;The company has various type's customers that depend on their behavior. It is tricky tho. I mean, if we have to create one campaign and need to choose the proper customer because of the budget. We must decide the similarity between the customers or a customer segmentation properly. So it can operate well.&lt;/p&gt;

&lt;p&gt;I am interested, too, in how the customers can be segmented. So let's explore it using &lt;a href="https://archive.ics.uci.edu/ml/datasets/online+retail"&gt;this data set&lt;/a&gt;. But first of all, what does customer segmentation mean? Is it like breaking the customer part so we can organize it like a puzzle?&lt;/p&gt;

&lt;p&gt;Well, the part of the puzzle, you're almost right. But we don't mean to break the human body's features into groups :(. We are only grouping customers into several clusters with one or two similarities in their behavior to fit our campaign goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  RFM Analysis to boost the accuracy
&lt;/h2&gt;

&lt;p&gt;Thanks to Jan Roelf Bult and Tom Wansbeek in 1995, they developed Recency, Frequency, and Monetary Value (RFM analysis) so the company will select optimally which one customer base on the campaign characteristic. Here is the definition of each value :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Recency value measures how recently a customer has transacted with the company&lt;/li&gt;
&lt;li&gt;Frequency value quantifies how frequently a customer has engaged with a brand&lt;/li&gt;
&lt;li&gt;Monetary value calculates how much money a customer has spent on a company's products and services.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Theoretically, the customers will have to be segmented like below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Low Value: Customers who are less active than others, not very frequent buyers/visitors, and generate very low - zero - maybe negative revenue. In this case, it is cluster number 1.&lt;/li&gt;
&lt;li&gt;Mid Value: In the middle of everything. Customers often use our platform (but not as much as our High Values) fairly frequently and generate average revenue. In this case are the cluster numbers 2, 3, and 4.&lt;/li&gt;
&lt;li&gt;High Value: The group we don't want to lose. High Revenue, Frequency, and low Inactivity. In this case, it is cluster number 5.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ok, then we are ready to deep dive into the dataset and start segmenting our customers. First of all, we have to quantify our three calculated fields, which are the RFM metrics. We need to consider that all the metrics depend on each user. So the Level Of Detail (LOD) in our calculated field must be set to Fixed so that each customer ID can group metrics without being inserted explicitly into the canvas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating RFM Calculated Field
&lt;/h2&gt;

&lt;p&gt;A company can obtain the Recency value by subtracting the date of the most recent transaction from a customer with the date on the customer's first transaction. So the calculation of the Recency column is as follows.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NXjmZeCH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkicrjbhuwfhtjo2xzug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NXjmZeCH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkicrjbhuwfhtjo2xzug.png" alt="Recency Value" width="880" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then it's time to measure the frequency of each customer at this company by calculating the unique customer id and invoice number of the transactions made so that the column will be created like this.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y7H8v8Ln--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4cck4wr0upqooa69jsb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y7H8v8Ln--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4cck4wr0upqooa69jsb.png" alt="Frequency Value" width="565" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the last is the number of money customers spends on all transactions in this company or the term monetary. This column is formed by multiplying the number of goods purchased by the unit price, in this case, shown in the Revenue column.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KU6-Rkzm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6chlc3j7zideaex5rtp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KU6-Rkzm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6chlc3j7zideaex5rtp.png" alt="Monetary Value" width="504" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Percentile on Duty
&lt;/h2&gt;

&lt;p&gt;Now is the time to call percentiles to segment each RFM value in each customer. Recall that percentiles divide the data you have into hundredths of parts so that the customer can do clustering easily. Make sure to look at the resulting data type in the form of a dimension with the value range of all customers being cluster 1 - cluster 5. The resulting calculations on RFM, primarily Monetary, are as follows.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hUL9EJek--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f9ob2l7seliov2vvsr79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hUL9EJek--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f9ob2l7seliov2vvsr79.png" alt="Clustering Monetary Dimension" width="853" height="249"&gt;&lt;/a&gt; &lt;br&gt;
Do the same for the recency and frequency values. So it's time to visualize.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appealing Visualization
&lt;/h2&gt;

&lt;p&gt;Graphics are all our friends. So let's create a segmentation based on customer behavior with a bar chart and count how many are in each cluster. Remember, before We can form a bar chart, there is a mapping of values between the three measures plus a unique total id between the three clusters. So on one page, the five clusters formed can be seen in the image below. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WuTF9j94--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w08e2ys2scwe42pyn54r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WuTF9j94--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w08e2ys2scwe42pyn54r.png" alt="Clustering Customer" width="880" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Access All in One Dashboard
&lt;/h2&gt;

&lt;p&gt;Clustering will be very useful if we know other characteristics in a cluster. Therefore you can access &lt;a href="https://public.tableau.com/app/profile/daud.fernando/viz/ProgresRFM/RFMAnalysis"&gt;this link&lt;/a&gt; to adjust which set will be selected for a particular campaign. Ciao!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
