<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Travis Cooper on Medium]]></title>
        <description><![CDATA[Stories by Travis Cooper on Medium]]></description>
        <link>https://medium.com/@travis749?source=rss-351f12843f28------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*k7Z4xGbD3eBaz1lo.jpg</url>
            <title>Stories by Travis Cooper on Medium</title>
            <link>https://medium.com/@travis749?source=rss-351f12843f28------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 07:10:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@travis749/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Data Engineer’s Guide to Resumes]]></title>
            <link>https://travis749.medium.com/a-data-engineers-guide-to-resumes-c9e7be0831a8?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9e7be0831a8</guid>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 11:18:45 GMT</pubDate>
            <atom:updated>2022-10-03T11:18:45.722Z</atom:updated>
            <content:encoded><![CDATA[<h4>The resume that landed me my first data engineering role</h4><p>Resumes are an essential part of finding a job in data engineering. Since data engineering isn’t a widely taught speciality in academia, there is often confusion around what a data engineering resume should look like; especially if you are trying to break into the field. In this article, I hope to examine the resume which helped me land my first data engineering job.</p><h4>Resume</h4><p>Without further ado, here is the resume that landed my first data engineering job (anonymized of course).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*7yuI4IFJgu4bc2POZlr4-w.png" /></figure><p>Prior to finding a passion for data engineering, I worked as a process control engineer at a steel manufacturing plant for two years after graduating from university. My academic training was in chemical engineering so process control was already a context switch. However, after finding my passion for data and data engineering, I, again, decided to <a href="https://towardsdatascience.com/my-journey-from-chemical-engineer-to-data-engineer-908cca5c1989">switch career paths</a> and apply to data engineering positions.</p><h4>Resume Structure</h4><p>Overall, I like the structure of my first resume. It is limited to one page, fills the margins, and it has bullet points to highlight the main ideas. However, the current iteration of my resume does not have the boxes around the section headers. The boxes took up a lot of space and it was extremely hard to change the formatting. Therefore, I simply bolded the section headers rather than adding the boxes.</p><h4>Content</h4><p>As you can see, I had five sections in my resume. Let’s examine each one.</p><ol><li><em>Summary Section</em></li></ol><p>In the summary section, I briefly explained my intent behind applying for the job. I tried to use keywords here to indicate my interest in data, such as “data analysis”, “data acquisition”, and “informed business decisions.” The goal of this section was to give a one sentence explanation as to why I am interested in the role and why I think I would be a good fit for the position.</p><p>In my current resume, I have the same section, but I leverage my existing experience and skills rather than the generic wording presented in my first resume. It is much easier to demonstrate my value by saying</p><blockquote>Software engineer with N+ years of experience in building highly robust, scalable data solutions in a variety of tools and technologies, including but not limited to: python, Scala, AWS, and Airflow</blockquote><p>However, at the time, my experience was limited so my value was generic. For more experienced data engineers, this is a great section to summarize your experience in a few sentences. For new data engineers, focus on the aspects of your job that are data-focused. It is okay to be generic, but the more specific you can be, the better.</p><p><em>2. Technical Skills Section</em></p><p>In this section, I wanted to highlight the tools and technologies that I used in my non-data engineering role. I had the benefit of working as an engineer so I had a lot of applicable skills to add (e.g. SQL, Python, Tableau, etc.). However, notice that not all of the skills are directly related to data engineering. I tried to list skills that are tangentially related, but I also wanted to show that I was a well-rounded engineer and that I was capable of learning new technologies on the job.</p><p>In the current iteration of my resume, I removed this section. Now, I list my skills in the next section “Professional Experience.” I still want to showcase the tools and technologies that I use, but I absorbed these in the experiences themselves.</p><p><em>3. Professional Experience Section</em></p><p>This is, by far, the most important section on your resume. It highlights exactly who you are and what experience you have. Everyone will have a different experience (especially in data engineering). For experienced data engineers, this is your chance to show off: what data projects did you build? What are the data volumes and throughput? What technologies are you an expert at? This is the section that will be the most scrutinized by recruiters and prospective employers so make sure you spend the most time fine-tuning this section.</p><p>For aspiring data engineers, this section can be a bit more worrisome; especially, if you are trying to completely change careers. In my case, I was already working in a technology driven career so I could focus my resume on the data parts of my projects. I recommend you doing the same. Data is everywhere. Be your own data engineer. Write a small python script to automate an analysis. Automate a SQL statement that you run every day. You may have to put in more effort to add these data engineering responsibilities to your existing set of responsibilities, but it will be worth it when you get your first data engineering job.</p><p>Regardless of your experience level, I highly recommend being as metric driven as possible. After all, as data engineers, we work with data. Document the impact you have and make sure it stands out in the resume.</p><p><em>4. Projects Section</em></p><p>For experienced data engineers, this section is completely optional. I removed this section once I had relevant professional experience. However, for aspiring engineers, as I was at the time of making this resume, this section is critical. I wanted to showcase my dedication to the field and my ability to build data engineering projects. Therefore, I completed a few small projects to include on my resume. These were especially helpful during an interview as it gave more experiences to talk about.</p><p><em>5. Education Section</em></p><p>I think this section is optional for everyone. I completed a four year degree so I included it because I worked hard to obtain it. However, the great thing about data engineering is that it does not exclude you if you do not have an education. Data engineering is about the skills you have; not the education you received. I say include your education if you completed it because, hey, it was hard work and you deserve to have it recognized. However, I wouldn’t worry too much if you do not have a formal education.</p><h4>Conclusion</h4><p>There you have it! The resume that landed me my first data engineering job. A well crafted resume gets you in front of the prospective employer and it gives you a chance to show how great of a data engineer you can be. While I admit, my resume has changed in both structure and content, this resume allowed me to break into the field and begin a great career.</p><p><em>What do you think? What do you include in your data engineering resume?</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9e7be0831a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantifying Data Pipelines]]></title>
            <link>https://travis749.medium.com/quantifying-data-pipelines-1013ec9d8f1d?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/1013ec9d8f1d</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Sat, 01 Oct 2022 17:54:11 GMT</pubDate>
            <atom:updated>2022-10-01T17:54:11.637Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to show your impact as a data engineer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RrZECNh2zAG7kJNq" /><figcaption>Photo by <a href="https://unsplash.com/es/@jdiegoph?utm_source=medium&amp;utm_medium=referral">Diego PH</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Ever feel like the work you do as a data engineer is hidden from management? There is no shortage of praise going towards BI engineers who create stunning dashboards or machine learning engineers who develop models for various business domains. However, data engineers are often left out when it comes to recognition. The difference between the aforementioned engineers and data engineers is that their work has a visual or tangible component. A data engineer’s work, when done correctly, is invisible: a magical process that creates data from seemingly thin air. It is hard to illustrate a background process.</p><p>However, not all is lost! We, as data engineers, have the power to illustrate our contribution through a bit of ingenuity and time. Here I list six metrics we can track (and report on!) so that our contribution is not lost in the ether.</p><h4>Metric 1: Data Volumes</h4><p>This one is the most obvious metric to track: how much data are you processing? Non-data engineers may not understand the intricacies of your work, but they understand data volumes. Are you processing 1 TB of data? 10 TB? 500 TB? Track the amount of data you process on a monthly basis and report on it. You can even easily make it more relatable by illustrating just how big the data is. For example,</p><blockquote>“This month, the data engineering team processed 500 TB of data, which is roughly 60,000 hours worth of movies”</blockquote><p>is more relatable than</p><blockquote>“This month, the data engineering team processed 500 TB of data.”</blockquote><p>which is more relatable than</p><blockquote>“The data engineering team processed data.”</blockquote><p>If data engineers track data volumes and translate the meaning to real-world concepts, it is an easy way to show their contribution.</p><h4>Metric 2: Number of Pipelines</h4><p>Are you developing and maintaining a large amount of pipelines? Track it! The number of pipelines you develop and maintain show your contribution to the broader organization. For this metric, you can simply report YoY growth of pipelines onboarded or the number of pipelines onboarded on a month by month basis.</p><p>Alternatively, too many pipelines for a small team is an indication something is wrong. Are any of the pipelines duplicative? Can you reduce the number of pipelines via a better data model? Combine multiple pipelines into one and report on the resources saved. This is an especially important metric to track because resources translate directly to money. If you are saving resources, you are saving money and the business functions understand money more than any other metric you may report.</p><h4>Metric 3: Query Execution Time</h4><p>A well-designed table is often taken for granted. Nobody notices a table with the perfect partitioning scheme, but the moment the query takes 10 seconds too long, everyone is suddenly taking notice! Well, instead of just fixing the issue, quantify the impact. You didn’t just add an index or fix the partitioning scheme, you saved the user 5 minutes of idle time. Say that user runs this query once per day everyday, you saved the user 30 hours per year of idle time! What if you did this for 10 tables? 50 tables? Quantifying the small changes you make to fix query performance can have a large impact on the organization as a whole.</p><h4>Metric 4: Job Execution Time</h4><p>This metric is very similar to metric 3, but instead of looking at query performance, you look at the job performance as a whole. Can you implement a change to process data in parallel? Can you implement a different type of join in PySpark to improve processing time? Again, quantify these impacts and extrapolate the impact you had on a monthly or yearly basis.</p><h4>Metric 5: Analyses Powered</h4><p>Data engineers power analyses. Without data engineering, there isn’t data available for data scientists to use for their models. While we are not involved in the modeling itself, we definitely play a crucial role in the process. What is your pipeline powering? Is the data scientist showing how we can increase product adoption? Then so is your pipeline. Is the machine learning model showing how we can help operations can save X million per year? Then so is your pipeline. We can piggyback on the analyses run by other groups because, if our pipelines fail, then so do the analyses.</p><h4>Metric 6: Downtime (or lack there of)</h4><p>Nobody notices when a pipeline is running as it should. However, the moment a pipeline breaks, you get 15 messages and a dozen calls to inform you that <em>your</em> process it broken. It may break only once per year, but that is the event everyone will remember. Do yourself a favor and illustrate how infrequent these events are. If your pipeline is running 99% of the time, show that! If your team is able to fix an issue within the SLA, document it! Show how you and your team are able to build robust, reliant systems, but also that you are capable of responding to outages with a quick resolution time.</p><p>…and many more! Data engineers have an uphill battle when it comes to demonstrating impact. We do not have a fancy UI or a graphical representation of our end product. However, we do have an extremely critical role when it comes to executing the company mission. We need to be our own advocates and show that, without data engineers, there is no BI dashboard, there are no machine learning models, and, most importantly, there is no data to make business decisions.</p><p><em>What do you think? What metrics are you tracking as a data engineer to show your impact?</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1013ec9d8f1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Matrix Computation Cheatsheet]]></title>
            <link>https://travis749.medium.com/matrix-computation-cheatsheet-d8d66c0eee9c?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8d66c0eee9c</guid>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[inverse]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[matrix]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Mon, 18 Jul 2022 16:13:38 GMT</pubDate>
            <atom:updated>2022-07-18T16:13:38.393Z</atom:updated>
            <content:encoded><![CDATA[<h4>A review of the most basic matrix operations</h4><p>Matrices are common among many areas of pure and applied mathematics. It is important that we understand the basic operations we can perform for a given computation or proof. Let’s review some of the most basic operations performed on matrices.</p><p>We will assume the following definition for A and B as we proceed in the definitions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*Ci8H4FQdwVetwtOKS_u8GQ.png" /></figure><h4>Matrix Addition/Subtraction</h4><p>The simplest operation is addition and/or subtraction. We add or subtract matrices in the following way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*EafBgbx1Xse9bI2KJQJ0Uw.png" /></figure><p>Addition and subtraction are performed component wise to produce the same sized matrix. Matrix addition and subtraction have the following properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*k-_6WNZ3xmur1cqMZvOzVg.png" /></figure><h4>Matrix Multiplication</h4><p>Matrix multiplication is a bit confusing when you are first introduced to it. We define matrix multiplication in the following way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*Yg7-XuA6UbWNtJUytQzPvw.png" /></figure><p>It is not a component wise multiplication as you may have naturally gravitated towards. It is better to think of matrix multiplication as a composition of two matrices. If we think of it that way, it is easier to wrap your head around what matrix multiplication is trying to accomplish.</p><p>An interesting note about matrix multiplication is that not all matrices can be multiplied together. A good check is to determine if the number of columns in A equals the number of rows in B. If not, the matrices cannot be multiplied. Here are a few examples to illustrate this point:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*5OZ-4C2-Eq1XvujZFNT7lw.png" /></figure><p>Matrix multiplication has the following properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*Rd8Nb7SNq7grja6x9isxHg.png" /></figure><h4>Matrix Transpose</h4><p>The transpose of a matrix is defined as swapping the rows and the columns of a matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*84nICDkLRLpMsL1R_WgZQQ.png" /></figure><p>The tranpose of a matrix has the following properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*dFy0W7LoZJytVhhAwa7ahA.png" /></figure><h4>Matrix Inversion</h4><p>The matrix inverse is defined as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*ejhbThvnlqsSLyuv4PKTnQ.png" /></figure><p>Inverses can be notoriously difficult to compute. In fact, you typically will not compute inverses by hand for anything bigger than a 2x2 matrix. For a 2x2 matrix, specifically, there is a formula to compute inverses</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*UcmA2bZ8l4b4koxuBhDIfQ.png" /></figure><p>We swap the diagonal elements and negate the counterdiagonal elements of the original matrix, A. We also have an added step of multiplying the transformed matrix by one over the determinant of A.</p><p>To illustrate how inverses can be used throughout linear algebra, let’s assume we are attempting to solve</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/134/1*dYgC9pFGOY_z4rRZzVHjzw.png" /></figure><p>We can solve for x by multiplying both sides by the inverse of A.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/134/1*o6upQyJJ3FMvkaU-J1yZ3w.png" /></figure><p>Notice that when we multiply the matrix A by its inverse, it disappears from the left hand side. While matrices do not have the concept of division, the matrix inverse can be used to accomplish a very similar operation.</p><p>However, not all matrices have an inverse. If the determinant of a matrix is zero, we consider the matrix to be singular, or non-invertible.</p><p>Properties of matrix inverses include</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*ueHAtkrsq2NsdXFLzR7yLg.png" /></figure><p>Matrix operations and their properties are extremely useful in linear algebra. Whether you are computing a value, solving an expression, or proving a theorem, you will need matrix operations to navigate the world of linear algebra.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8d66c0eee9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Intuition Behind Derivatives]]></title>
            <link>https://travis749.medium.com/the-intuition-behind-derivatives-dd642b9e64b4?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd642b9e64b4</guid>
            <category><![CDATA[calculus]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[mathematics-education]]></category>
            <category><![CDATA[derivatives]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Thu, 14 Jul 2022 11:46:26 GMT</pubDate>
            <atom:updated>2022-07-14T11:46:26.571Z</atom:updated>
            <content:encoded><![CDATA[<h4>Everything you need to know about differentiation</h4><p>Derivatives are often a person’s introduction into the world of calculus. And it makes sense. Derivatives are really just an extension of the concepts learned in algebra, trigonometry, etc. However, I think the finer points of derivatives are often overlooked. Calculus is often termed as “difficult” or “complex” so we focus on computation rather than intuition. While calculus certainly requires effort to truly understand, an intuitive understanding provides a solid foundation for further study in calculus and beyond.</p><h4>Notation</h4><p>Before we start, let’s talk about notation. There are two common ways of notating a derivative: Newton notation and Leibniz notation. The notations are named after Issac Newton and Gottfried Wilhelm Leibniz, respectively. In Newton notation, the derivative of f(x) is denoted as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*O6LvtsHtFt2Zid5XaPyFuA.png" /></figure><p>and in Leibniz notation, the derivative of f(x) is denoted as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*vXK2fFX9Ey0Zbi9tDxqUfw.png" /></figure><p>There are benefits and downsides to both notations. Newton’s notation is simpler whereas Leibniz notation provides the “units” or variable with which we are differentiating. Leibniz notation is especially helpful in engineering or scientific applications since units (time, distance, etc.) are especially important.</p><p>Both notations are often used interchangeably. It is more of a personal preference regarding which notation you use.</p><h4>What is a derivative?</h4><p>Okay, let’s get started! We know how to notate a derivative, but what is it? A derivative is an instantaneous rate of change with respect to one or more variables of a function. Let’s examine each part of this definition</p><p><em>“…instantaneous…”: </em>when we determine the derivative, we are evaluating the change at a specified point rather than the average rate of change over the entire function.</p><p>“<em>…rate of change…</em>”: we have encountered rate of change in algebra when we determined the slope of a given line.</p><p>“<em>…with respect to one or more variables…</em>”: in single variable calculus, we analyze functions of one variable (e.g. f(x)), but a derivative is not limited to single variable functions. We can take derivatives of functions with N number of variables (e.g. f(x, y, z)).</p><p>Simply put, we are finding the slope of the tangent line at a particular point. It measures the variation of slope as the point progresses along the curve.</p><blockquote><strong>Did you know:</strong> a tangent is a line is a line that touches f(x), but it does not intersect at the given point</blockquote><h4>Geometric and Algebraic Interpretation</h4><p>Great! So we have described what a derivative is, but what does it actually mean?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYYn7tT-QwdNnAE82hlhlA.png" /></figure><p>Let’s start with a simple curve produced by the function f(x). The actual function itself doesn’t matter, but let’s assume it produces the curve above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4lYm4eiLUwFUVQJJ9g0_A.png" /></figure><p>Next, let’s create an arbitrary secant line that crosses at points P and Q. We will denote this as PQ.</p><blockquote><strong>Did you know:</strong> a secant line is a line that crosses a curve a minimum of two points.</blockquote><p>What happens as we bring points P and Q closer and closer together?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFOOUklWYBS1jx8NnMvwUw.png" /></figure><p>Notice that the distance between P and Q shortened. What if we kept bringing P and Q closer together? What happens to the distance between P and Q? Eventually, P and Q would become one point! However, a line that touches a function at one point is a tangent line. Therefore, we can say that the slope of the secant line as the distance between P and Q approaches zero is the definition of a derivative at that point! Let’s see this in algebraic form using limits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*J71AfI3p1wl-z3i8nh5ExQ.png" /></figure><p>The above expression looks a bit different and it is missing P and Q. However, notice that it still represents what we have already discovered. Let’s look at the numerator first. This is simply a rewriting of the values at Q and P, respectively. P is simply the function evaluated at x and Q is the function evaluated at x plus some small change in x. The denominator is the change in x from P to Q. Then, decrease the distance between P and Q (or take the limit) as the change in x approaches 0.</p><p>Notice that the definition of a derivative is simply the traditional “rise over run” definition of the slope. It is algebra disguised at calculus. The only difference is that we are taking the distance between two points of a secant line, shrinking the distance at infinity, and then finding the slope of the now tangent line.</p><h4>Applications</h4><p>The applications of derivatives are numerous. In fact, derivatives were invented (discovered?) to explain our dynamic world. However, there are a few very common applications utilized throughout engineering and science.</p><ol><li><em>Finding maximum/minimum values of a function:</em> we use derivatives to find and classify critical points. In other words, we can determine whether a function has a local maximum or minimum via the first and second derivative tests.</li><li><em>Newton’s Method:</em> this is a numerical method that helps find roots of a polynomial. We compute the derivative of f(x) during the iteration.</li><li><em>Velocity Curves:</em> velocity is the derivative of position with respect to time. Therefore, if we are given a position function, we can determine its velocity via differentiation.</li></ol><p>There are an abundance of applications of derivatives. You will find derivatives in most, if not all, areas of applied mathematics. That is because change is inevitable in real-world systems and what better to help us analyze change than derivatives?</p><h4>Derivatives in Python</h4><p>The intersection of technology and mathematics enables much more powerful analysis and computation. Calculus is no different. We can compute derivatives using a programming language called python; specifically, with the “sympy” library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*lcDa0TySxb-TqOxThxBnnA.png" /></figure><p>We can analytically differentiate using the sympy function called “diff.” We pass the function as an argument and the library will differentiate the function. Pretty cool, right? This can be extremely helpful when you want to plot functions against their derivatives like the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vOFkhVr--LnEuXctvNdvpw.png" /><figcaption>A plot of a function, its first derivative, and its second derivative. This is merely illustrative of the sympy plot functionality and not trying to convey any conceptual point.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*3xcKNXgcFe2qJer7OnW7PA.png" /><figcaption>The sympy commands to generate the plot above.</figcaption></figure><p>A simple polynomial is easily differentiated by hand, but can you imagine if you wanted to differentiate the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*RqlmwtIljUzWrMDBiWbd7g.png" /></figure><p>Admittedly, you can compute the derivative by hand, but would you want to? I don’t know about you, but I would undoubtedly make some sort of error in tracking each derivative in the various differentiation rules. It makes much more sense to utilize an extensively tested library trusted by many</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0CW2Sr3sPQMP2Gz2WAiLA.png" /></figure><p>Python is an extremely beneficial tool when computing derivatives. While hand computation is crucial to understanding the theory, I highly recommend using python to check your solutions and, when necessary, compute the derivative for you.</p><h4>Common Derivative Rules</h4><p>There are many different combinations of functions, which give rise to many different differentiation rules. It is important to familiarize yourself with these rules so that you are able to differentiate any combinations of functions you encounter.</p><p><strong>Power Rule</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*ABbl7JCmdMjIFO_goF_xEg.png" /></figure><p><strong>Sum/Difference Rule</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*dMANSaj4dvwjhhwRCN5_xQ.png" /></figure><p><strong>Product Rule</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*234kHbNll58mT-wnm8T15Q.png" /></figure><p><strong>Quotient Rule</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*pHiz-tdX1kOUA8DCg73RxA.png" /></figure><p><strong>Chain Rule</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*e9curlKfqt1nq553T-myZQ.png" /></figure><p>While I did not prove any of these rules, they can easily be derived given the definition of a derivative. I invite you to try and derive one or two of these rules.</p><p>Differential calculus is fundamental to not only the subject of calculus generally, but also to many real world applications. While computation of derivatives is imperative to success, you should also fundamentally understand what information derivatives are trying to convey about their respective functions. By doing so, you understand what you are computing and why you are computing it.</p><p><em>Interested in a specific topic? Please comment below! I am always looking for areas and concepts of mathematics to explore.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd642b9e64b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive into Matrix Determinants]]></title>
            <link>https://travis749.medium.com/deep-dive-into-matrix-determinants-ed947dcb95e5?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed947dcb95e5</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[matrix]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 21:18:34 GMT</pubDate>
            <atom:updated>2022-06-26T21:18:34.020Z</atom:updated>
            <content:encoded><![CDATA[<p>If your linear algebra class was anything like mine, you learned how to describe matrices by computing determinants. However, I found that most courses stop short of fully defining exactly what a matrix determinant is. In this discussion, I hope to provide a deep dive into how to compute determinants, but also describe <em>what</em> you are computing.</p><h4>Definition</h4><p>A determinant is a scalar value associated with a square matrix. Let’s look at the general case to see how we compute the determinant</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*SeuawGuvgILYhfPT.png" /></figure><p>We refer to this expression as the Laplace expansion. There is a quite a bit to unpack here, but it’s rather simple once you get passed the symbolic representation. It basically says to divide the matrix A into smaller and smaller sub-matrices until you can compute the determinant with relative ease. We also add a “weight” to each subsequent sub-matrix via the ith and jth column of A. We will look at this generalization in the 3x3 case. But first let’s discuss the simplest computation: the 2x2 case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*wJHA5mJuggiHEkXq.png" /></figure><p>The 2x2 case simply involves finding the difference between the main diagonal and the counterdiagonal. The sub-matrices in the Laplace expansion can be reduced to the 2x2 case. However, you can also reduce the sub-matrices to a 3x3 case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*ESs9jPY11XDJLWsV.png" /></figure><p>Notice that the 3x3 case is a direct application of the Laplace expansion. We hold the top row fixed (but it could be any row or column), which act as the multipliers, and reduce the primary matrix down into 2x2 sub-matrices. Since we can easily compute the determinant of a 2x2 sub-matrix, the computation becomes much simpler. It is also important to notice the alternating plus and minus signs. This comes from the -1 term in the Laplace expansion. We alternate signs as we create sub-matrices.</p><p>Manual computation of determinants can quickly become infeasible. Imagine a 100x100 matrix. We would need to recursively perform the Laplace expansion many times, leading to an explosion of terms. Even in a smaller matrix, such as a 5x5 matrix, it quickly becomes mundane. However, numerical methods in software can quickly compute a determinant so manual computation is not necessary in most cases.</p><h4>Geometric Interpretation</h4><p>The algebraic interpretation of a determinant is great at providing a basis for computing a determinant. It does not, however, provide an intuitive understanding of determinants. It makes it seem like the determinant is merely a product of numbers.</p><p>The geographic interpretation does a much better job of explaining determinants. Let’s explore the 2x2 case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*rssW_RF3a7K8Q1OY.png" /></figure><p>The 2x2 depiction of matrix A is seen above. The above parallelogram is constructed by recognizing that the matrix A forms two linear maps: one that maps the standard basis vectors to the rows of A and one that maps the standard basis vectors to the columns of A. Put another way, we can plot the elements of A as seen in the diagram.</p><p>This makes the determinant the area of the parallelogram! The area, then, represents the scale by which A transforms other areas. Now I know what you are thinking</p><blockquote><em>But determinants can be negative. How can there be negative area?</em></blockquote><p>Great question! This leads us to our next topic of discussion: orientation. When we apply the sign to the area, we have an oriented area. The only difference between an oriented area and the area is the sign: a negative oriented area implies the angle from the first and second vectors turns in a clockwise direction rather than a counterclockwise direction. However, the magnitude of the area is the same between the two. It is analogous vectors having a magnitude and direction. A vector does not have a negative magnitude; it simply has a direction associated with the magnitude.</p><p>Okay, that describes the 2x2 case. What about the 3x3 case? Or the NxN case? The answer is it is the same concept! The only thing changes is the shape. In the 3x3 case, it forms a parallelpiped and in the NxN case, it forms a parallelotope. In other words, the 3x3 case calculates the volume, the 4x4 case calculates a hypervolume, etc. It becomes a lot more abstract above three dimensions, but the fundamentals remain the same: we are calculating the scale at which A transforms other objects.</p><h4>Properties</h4><p>Let’s review some properties of determinants. Many of these properties can be derived via the algebraic formulas above. I will not derive these properties directly, but it is a great check to verify each of these properties via the 2x2 case.</p><ol><li>The determinant changes sign when two rows are exchanged.</li><li>If two rows are equal, the determinant is zero.</li><li>Subtracting a multiple of one row from another row leaves the same determinant.</li><li>If a matrix is singular, the determinant is zero.</li><li>The determinant of AB is det(A) * det(B)</li><li>The transpose of A has the same determinant as A</li></ol><h4>Applications</h4><p>There are several applications of a determinant, but there are three that that warrant a discussion.</p><ol><li><em>Singular Matrices</em></li></ol><p>One of the easier ways to determine if a matrix is non-singular (i.e. invertible) is to calculate its determinant. Singular matrices are not invertible if and only if the determinant is zero. It’s often extremely beneficial to know whether a matrix is invertible when working in linear algebra.</p><p>2. <em>Cramer’s Rule</em></p><p>One can argue that a primary goal of linear algebra is to solve</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/0*AtNvbEp4v1JW9jS4.png" /></figure><p>Cramer’s rule is one method of computing x. We define the jth component of x as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/0*reCJDPrOVGGWPtUR.png" /></figure><p>where B is identical to A except the jth component in a is replaced by the vector b. While an interesting approach to solving the problem, Cramer’s Rule is highly inefficient from a computational complexity perspective. There are much more efficient algorithms for computing x that can be utilized.</p><p>3. <em>Characteristic Equation</em></p><p>The characteristic equation in linear algebra is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/0*mMHTKGdabSg0LdHy.png" /></figure><p>which is used to determine the eigenvalues and eigenvectors of a matrix, A. While eigenvalues and eigenvectors are bit outside the scope of this discussion, they play a huge role in many areas of mathematics beyond linear algebra. In relation to determinants, notice that we directly compute the determinant of the above expression. We also find the eigenvalues such that the expression is a singular matrix, which is a requirement for it to be an eigenvalue.</p><h3>Determinants in Python</h3><p>As discussed earlier, manual computation is mundane and quickly becomes error prone and inefficient. Programming languages such as python and Matlab are capable of computing determinants efficiently and accurately. Let’s look at an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*b7v_NkMafaU4kJow.png" /></figure><p>We could use the Laplace expansion to divide the matrix into 3x3 sub-matrices and divide those into 2x2 sub-matrices, but notice how many terms we would need to track. We would also need to ensure the signs of each term remained consistent with the expansion. However, there is a much easier way if you just need to find the determinant: python!</p><pre>import scipy.linalg as la<br>import numpy as np<br>A = np.array([[2,4,2,5], [1,5,2,6], [8,5,3,2], [0,1,3,6]])<br>det = la.det(A)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*DaHsc3Mxtk7gGKbakkOx-A.png" /></figure><p>Quick and simple. We were able to compute the determinant of a matrix efficiently and accurately. A 4x4 matrix is relatively small, but can you imagine if we had a 10x10 matrix? A 100x100 matrix? A 1000x1000 matrix? Programming languages becomes the only option in majority of applications.</p><h3>Conclusion</h3><p>Determinants are hard to explain. It is much easier to learn how to compute the matrices and use their properties to describe a matrix. It is much harder to gain an intuitive understanding of <em>what </em>you are computing. Hopefully, this helps give you that intuitive understanding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed947dcb95e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debunking 3 Common Misconceptions about Math]]></title>
            <link>https://travis749.medium.com/debunking-3-common-misconceptions-about-math-18f2fbd0917e?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/18f2fbd0917e</guid>
            <category><![CDATA[math-education]]></category>
            <category><![CDATA[mathematics-education]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 12:49:07 GMT</pubDate>
            <atom:updated>2022-06-26T12:49:07.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wOcO0ZRbjUNMWCiz" /><figcaption>Photo by <a href="https://unsplash.com/@timmossholder?utm_source=medium&amp;utm_medium=referral">Tim Mossholder</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Throughout my career, I have encountered quite a few statements regarding math as a discipline. I was to discuss three common misconceptions regarding the field of mathematics.</p><blockquote>Math isn’t used in the real world.</blockquote><p>Math is used everywhere! It is infused in the very laws of nature. We rely on math for everything: communication, travel, medicine, etc. However, it is not surprising that people fail to realize when and where math is used. Engineers and mathematicians have cleverly abstracted out the math for reliability, efficiency, and convenience. We no longer need to perform the more mundane parts of mathematics because we have software packages to do it for us.</p><p>But is it still worth learning the fundamentals if we have software available to us? Of course it is! There is <em>always</em> a better way to do something. Even if the math itself is not changing, the situation it is applied to changes for each application. Take matrices for example. We have algorithms to efficiently compute all sorts of matrix operations: addition, multiplication, determinants, etc. However, what if the matrix is sparse? In some instances, standard algorithms and storage options are extremely inefficient. We can take advantage of the sparsity to improve upon the operations. If we had never learned the fundamentals to begin with, we would have been unable to improve upon the software packages.</p><p>Matrices are just one example. Even though we have abstracted the fundamentals, the very foundation of advanced mathematics and customization rely on them so we must devote time and effort to fully understanding them.</p><blockquote>I am not good at math.</blockquote><p>I hear this time and time again. I am a firm believer that <em>everyone </em>is capable of learning mathematics. However, not everyone is taught math in a way that is conducive to their learning style. Some students are visual learners, some students prefer to read the definitions, some students need to see worked out examples. Unfortunately, our education system is not constructed in a way to teach to an individual student. Often times, mathematics is taught in a formulaic, direct approach instead of a creative, applied approach. We focus more on how to solve a problem instead of understanding why we are solving it to begin with. Many times, students are left behind and internalize a disdain for math. They do not understand that its an incompatibility between a learning style and a teaching style rather than a rebuke of their mathematical intuition.</p><p>Furthermore, mathematics is such a broad term. People are demotivated after failing to grasp one concept of math. I argue that just because you do not understand algebra doesn’t necessarily mean you will not understand geometry. These are different branches of mathematics; branches that require a different mindset. You may thrive in geometry because it is more about visualization and less about algebraic manipulation. Before you state you are “bad” at math, I challenge you to explore the other topics in math. Maybe you will find a subject you thoroughly enjoy.</p><blockquote>Math is only useful for engineers and scientists.</blockquote><p>A subject’s usefulness is not determined based on its prevalence in the field. Sure, engineers and scientists work in a field that is fundamentally mathematics, but I argue that math is just as useful to artists, plumbers, etc. At its core, mathematics is just problem solving. It involves a logical approach to the issue at hand. Look at a mathematical proof. You are given an input, maybe make some assumptions, and take the solution step-by-step until you realize a desired output. Every field has its problems that need solved. While some use physical laws and measurement, others use common sense and emotion. Whatever the medium, most problems require a solution and math provides the perfect way to chart the path to it.</p><p>Math is hard. I do not think many people would argue with that statement. However, hopefully, I helped provide more context regarding three common statements about the field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18f2fbd0917e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vector Norms, Explained]]></title>
            <link>https://medium.com/data-science/vector-norms-explained-e72bf26e4a38?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/e72bf26e4a38</guid>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[math-education]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Fri, 24 Jun 2022 19:49:16 GMT</pubDate>
            <atom:updated>2022-07-01T05:24:07.058Z</atom:updated>
            <content:encoded><![CDATA[<h4>Shedding light on a commonly misunderstood topic in linear algebra</h4><p>Vector norms are extremely important in certain fields of engineering and mathematics. However, I think the education system often presents norms in a formulaic, “here’s how to calculate it” way as opposed to presenting an intuitive understanding of vector norms. Let’s see if we can remedy that situation with a more pragmatic discussion of vector norms.</p><h4>What is a norm?</h4><p>A norm is simply a way to describe the size of a vector, but the definition is often presented as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*T6qGFlXwzQWH1s6E.png" /><figcaption>Image by Author</figcaption></figure><p>The mathematical definition seems complicated at first, but it is really just saying that a norm is some function that has certain properties. Let’s simply the above definition a bit to make it more intuitive.</p><p>A norm is a function from a real or complex vector space that has the following properties:</p><ol><li><strong>Positive Definiteness: </strong>it is only zero at the origin</li><li><strong>Homogeneity: </strong>it commutes with scaling (i.e. we can pull out any scalars)</li><li><strong>Triangle Inequality: </strong>it obeys the triangle inequality so that the function acting on the sum of x and y is less than or equal to the sum of the functions acting on each element separately.</li></ol><p>And there you have it! An algebraic understanding of norms. However, let’s add a bit more complexity. A norm isn’t just a single function. It can be many functions!</p><h4>Types of Norms</h4><p>Norms are abundant in mathematical fields. In fact, I bet many of you have seen a norm before and you didn’t even know it. Let’s discuss a few types of norms.</p><p><strong><em>1-Norm</em></strong></p><p>The 1-Norm, or L1 norm, is defined as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/0*7MMOCZOfQzcUda3d.png" /><figcaption>Image by Author</figcaption></figure><p>which is just a fancy way of the 1-Norm is the column sum of the absolute value of each entry. For Nx1 vectors, simply add the absolute value of each element and it will yield the 1-Norm.</p><p>You typically see 1-Norms used in machine learning applications. It can be used as a technique to reduce model coefficients, thus, reducing the overall complexity of the model. It can be used where sparsity of a vector is important as the 1-Norm is only influenced by the non-zero elements.</p><p><strong><em>2-Norm</em></strong></p><p>The 2-Norm, or L2 norm, is defined as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/0*LVsjhQilbmyJdLqp.png" /><figcaption>Image by Author</figcaption></figure><p>It is commonly referred to as the Euclidian norm. You have probably seen the 2-Norm as the standard way of calculating the length, or magnitude, of a vector. It is the “square root of the sum of squares” method. Engineers and scientists typically default to the Euclidian norm because distances behave according to this norm in nature for standard scales.</p><p>The most common application of Euclidian norms is using it to determine a vector’s magnitude and, therefore, distance from point A to point B.</p><p><strong><em>P-Norm</em></strong></p><p>The 1-Norm and the 2-Norm are P-Norms, where P=1 and P=2, respectively. We choose the values of one and two because they are commonly used throughout applications, but P can be set to any number greater than one. The P-Norm is defined as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/0*hm-xH2ImZjY6dh1P.png" /><figcaption>Image by Author</figcaption></figure><blockquote><strong><em>Did you know: </em></strong><em>p must be greater than or equal to 1 because values greater than zero, but less than 1, violate the triangle inequality and, therefore, are not norms.</em></blockquote><p>Values of P are often specific to the application. There are a few relatively popular ones that you should be aware of for a given field and/or application. However, since it is application-specific, I will leave it to you to explore the best P value for your application.</p><p><strong><em>∞-Norm</em></strong></p><p>The ∞-Norm is defined as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/0*tPtBghDhfoLJ3lBc.png" /><figcaption>Image by Author</figcaption></figure><p>which is the maximum absolute value of the rows. For Nx1 vectors, the ∞-Norm is simply the maximum absolute value in the vector since there are N rows.</p><p>One application of ∞-Norms is error analysis of numerical methods. The ∞-Norm provides a maximum bound which makes it the perfect estimator for error bounds.</p><h4>Geometric Interpretation</h4><p>Okay, so we know what a vector norm is and we know the different types of vector norms. For me, I didn’t gain an intuitive understanding of norms until I saw a geometric interpretation of what a norm is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TmuhusX-BV3ZWTdN.png" /><figcaption>Image by Author</figcaption></figure><p>We have the geometric interpretation of the norms described above. The shapes above are unit shapes; that is, they cross the axes one unit away. Starting at the diamond (P=1), P can either increase or decrease. If it decreases, the sides of the diamond collapse inward toward the origin. If P increases, the sides begin to bend outward as seen in P=2. As P continues to increase, the sides continue outward, straightening until we get to P=∞, where it ends at a square.</p><p>It is easy to see that each type of norm behaves differently in the same vector space. You can see this algebraically, but the geometric interpretation helps solidify the concept. Therefore, different vector norms are used in different applications to produce a desired result.</p><h4>Norms and Python</h4><p>Let’s look at some code! We will review how to compute a norm using a common python library known as scipy; specifically, the linear algebra package. We will look at how to compute the norms listed above.</p><pre>import scipy.linalg as la<br>import numpy as np</pre><pre>arr = np.array([4, 3, 1, 25, 0, 5, 2, 4])<br>one_norm = la.norm(arr, ord=1)<br>two_norm = la.norm(arr, ord=2)<br>seven_norm = la.norm(arr, ord=7)<br>inf_norm = la.norm(arr, ord=np.inf)</pre><p>Computation of a norm is made easy in the scipy library. We simply declare our vector and call the “norm” function. It is imperative that you specify which norm you want to compute as the default is the Euclidian norm (i.e. P=2). Let’s run the above code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*akIyiyYKmgr4hUTz.png" /><figcaption>Image by Author</figcaption></figure><blockquote><em>NOTE: P=7 is simply an illustrative example. I am not aware of any relevance in this value.</em></blockquote><p>As we can see, the output is as expected. Notice that as we increase P, we converge to the value of the ∞-Norm. It is often much easier to compute norms via software rather than by hand. I often use python in error analysis for iterative techniques.</p><h4>Conclusion</h4><p>Vector norms are extremely common in mathematics and engineering. Much of the discussion here can be extrapolated beyond vectors and onto induced matrix norms. Hopefully, this helped give you a more intuitive understanding of matrix norms and how we can use software to compute them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e72bf26e4a38" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/vector-norms-explained-e72bf26e4a38">Vector Norms, Explained</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Query’s Journey Through PostgreSQL]]></title>
            <link>https://travis749.medium.com/a-querys-journey-through-postgresql-1c27904e24d1?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c27904e24d1</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[query-understanding]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Mon, 09 May 2022 14:52:21 GMT</pubDate>
            <atom:updated>2022-05-09T14:52:21.794Z</atom:updated>
            <content:encoded><![CDATA[<h4>How PostgreSQL transforms a query into data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EjnEUvxu6VwyZCo7" /><figcaption>Photo by <a href="https://unsplash.com/@nasa?utm_source=medium&amp;utm_medium=referral">NASA</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>PostgreSQL is an open-source, relational database system widely used in the software and data communities. It has strong support in the open-source community, ACID-compliant, and it runs on all major operation systems. It is often labeled as the relational database of choice for a large amount of applications. As with most, if not all, relational databases, it relies on a query engine to interact with the data which it stores, but, what does the query engine actually do? How is it that a query returns the underlying data? Let’s find out.</p><h3>I wrote my query. Now what?</h3><p>Okay, so you wrote the query and pressed enter. Data has magically been sent back to you. How did PostgreSQL do it? Generally speaking, the journey of a query takes place in five processes:</p><ol><li>Connection</li><li>Parser</li><li>Rule System</li><li>Optimizer</li><li>Execution</li></ol><p>Each process plays a crucial role in the query lifecycle. Let’s look at each process in detail to find out its role in returning your data.</p><h3>Connection</h3><p>An important, yet often overlooked, step in the query’s lifecycle is the connection. If there is no connection between the database server and the UI in which you type your query, you might as well be typing in a text editor! PostgreSQL is implemented in a client/server architecture, where each client process is connected to exactly one server process. PostgreSQL listens at a TCP/IP port for incoming connections and spawns a new server process with each request.</p><blockquote><strong>Fun Fact</strong>: in order to maintain data integrity, server processes communicate with one another through shared memory and semaphores (special objects used to control access to common resources).</blockquote><p>Once a connection is established, a query is passed over the connection and into the next stage: the parser.</p><h3>Parser</h3><p>The parser has two primary responsibilities</p><ol><li>Checks the transmitted query for syntactical errors</li><li>Creates a query tree</li></ol><p>The transmitted query arrives to the parser as plain text. A process known as the lexer is responsible for recognizing key words in the plain text (e.g. SELECT, FROM, etc.) and generating tokens for the parser. The parser process contains grammar rules and actions, which are executed to determine if the query has the correct syntactical structure. If the syntax violates a particular rule, an error is returned to the submitter.</p><blockquote><strong>Fun Fact: </strong>In PostgreSQL, the parser and lexer processes are implemented using Unix tools.</blockquote><p>Assuming there are not any syntactical violations in the submitted query, a process known as the transformation process takes the parser tree and performs semantic interpretation to understand the actual query itself. It does so by performing lookups in system catalogs. In doing so, it builds a new data structure known as the query tree.</p><h3>Optimizer</h3><p>Once the query tree is generated, it is sent to the to the optimizer. The optimizer, sometimes referred to as a planner, is responsible for creating an <em>optimal</em> execution plan. The query tree generated from the parser can be executed in multiple ways to produce the same results. However, PostgreSQL attempts to minimize the computational work required so that the operations are completed as efficiently as possible. The optimizer uses scans, indexes, joins, etc. to generate a set of query plans and chooses the most optimal.</p><p>However, the query engine is not perfect. Performance is also impacted by</p><ol><li>Table setup</li><li>Query structure</li></ol><p>In regards to table set up, a good example is a lack of indexes. Indexes on columns make queries fast by creating pointers to the data locations. If an index does not exist, the query is slower when compared to if it did exist.</p><p>Query structure also impacts performance. For example, for various reasons, statements such as “SELECT * …” or “SELECT DISTINCT …” impact performance metrics. While the optimizer process attempts to reduce computational complexities, it is still important to perform SQL tuning yourself if performance is important.</p><h3>Execution</h3><p>The last stage in our journey is the executor. The executor takes the optimized query plan and recursively processes it to extract the required result set. Each tree node from the optimized query tree computes and returns its next output row each time it is executed. The node itself is responsible for applying expressions assigned during the planning stage. Once the the root node is processed, the result is returned via the established connection.</p><h3>Conclusion</h3><p>It is easy to forget the complexities of retrieving data from a database. We simply write a query and take for granted that data is always returned. After reviewing the journey of a SQL query through the PostgreSQL database engine, I hope you have a better understanding of some of the processes that are ongoing behind the scenes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c27904e24d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Five Myths of Data Engineering]]></title>
            <link>https://medium.com/learning-sql/five-myths-of-data-engineering-816cfd972342?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/816cfd972342</guid>
            <category><![CDATA[data-engineer]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Thu, 05 May 2022 19:34:29 GMT</pubDate>
            <atom:updated>2023-12-03T19:12:51.674Z</atom:updated>
            <content:encoded><![CDATA[<h4>Debunking five prevailing myths in data engineering</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l3RWbDJKPtkJM6BX" /><figcaption>Photo by <a href="https://unsplash.com/@lukechesser?utm_source=medium&amp;utm_medium=referral">Luke Chesser</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Data engineering is an ever-evolving field. Let’s discuss a few of the most common myths about the industry.</p><h4>MYTH 1: Data engineers never get any credit.</h4><p>This is my favorite myth because I tend to be a very results-oriented person. Any data engineer knows that as soon as a pipeline is broken or behaving unexpectedly, end users begin to panic. As they should. Data is core to any business hoping to survive. The idea that the work of a data engineer goes unnoticed is hard to fathom.</p><p>I think the sentiment behind this myth is that when a data engineer does a good job, most business-minded people do not see the work as it is hidden behind the scenes. After all, it is easy to show your work as a front end engineer or data scientist as there are often visualizations. While I will admit data engineers need to put in more work to identify their contribution, it is still absolutely feasible to display the work performed on every project.</p><p>Given data engineers work with, well, data, it shouldn’t be a surprise that we should be tracking metrics! How much data are you processing in a given week? Month? Year? How much downtime was associated with your pipeline? Did you implement a unified pipeline logging library to save X amount of engineering time? Metrics are everywhere! It is important, as data engineers, to act almost like a project manager and outline the key metrics and KPIs that your project is tracking. However, and this is the most important part, share your results! Advocate for yourself and your team by presenting to the broader team. It will not only help show your team’s contribution, but it may also spark further innovation and collaboration with other teams.</p><h4>MYTH 2: You are not a data engineer unless you have a title saying as such.</h4><p>The role data engineer is a relatively new term. Does that mean companies never had to move data around? Of course not. There was often a designated “data person” with varying roles titles. Even today, after the advent of the term data engineer, there are still companies or teams that have employees performing data engineering work without classifying the role as a data engineer. Sometimes data scientists, data analysts or BI professionals act in a data engineering capacity. Just because a role isn’t deemed a data engineer doesn’t imply that the work being done isn’t data engineering.</p><h4>MYTH 3: Data engineers must learn THIS technology.</h4><p>Data engineering is less so about the technology and more so about the mind set. At the end of the day, all a data engineer cares about is whether the data is stored properly and it moves from point A to point B. How this is done can almost be irrelevant as long it is done properly. Sure, there are a few standard tools (e.g. python, SQL), but do you really need to know python if all of your development is done in a low code tool? Do you really need to know Airflow if your company has a custom built pipeline manager? Data engineers should absolutely broaden their skill set as different companies have different expectations, but I do not think learning a specific technology makes a data engineer.</p><h4>MYTH 4: Data engineering work is not specialized.</h4><p>I tend to believe data engineering is a specialty in computer science. In fact, I do not think you can really function as a data engineer without at least the fundamental understanding of software and/or data architecture. However, disregarding that thought, data engineering is still specialized in its own right. You can ask five data engineers what they do for a living and you will get five different answers. Party because companies cannot agree of the job function, but also there are different areas within data engineering that can be a focus: databases, real-time streaming, batch processes, scheduling, API development, low code tools, enterprise tooling, etc. I’ve found that many roles tend to focus on one or two of these, but all are part of the data engineering landscape. Each can act as a speciality in its own right.</p><h4>MYTH 5: Low (or no) code engineering tools will replace data engineers.</h4><p>Low (or no) code tools are collections of software or interfaces that allow less technical savvy people to get similar functionality to that of a fully customized solution. These tools have been around for many years, always with the claim that they can solve all of your problems. However, this is rarely the case. Every business is unique, which means that every business has a unique set of data needs. While these tools offer some flexibility, my experience has been that there are always limitations, such as: data volume limits, throughput limits, lack of extensibility, too much abstraction, etc.</p><p>These tools are great at generalizing the mundane and act as a complement to the data engineering profession. I suggest learning some of these tools so that when there is an appropriate use case, you can save time (and maybe money?) by taking advantage of the generalized work loads offered in these pre-built solutions. However, in terms of a full replacement, we have a long way to go before data can be modeled, extracted, transformed, or loaded with a few clicks of a button</p><h3>Closing Thoughts</h3><p>There seems to be a lot of ambiguity within the field of data engineering. Hopefully, after reading my thoughts of often expressed claims above, there is more clarity into the role of a data engineer.</p><p><strong>Go from SELECT * to interview-worthy project. </strong><a href="https://learning-sql.ck.page/aa03293372"><strong>Get our free 5-page guide</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=816cfd972342" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learning-sql/five-myths-of-data-engineering-816cfd972342">Five Myths of Data Engineering</a> was originally published in <a href="https://medium.com/learning-sql">Learning SQL</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quality Assurance in Data Pipelines]]></title>
            <link>https://medium.com/data-science/quality-assurance-in-data-pipelines-19ebe1cb1a8e?source=rss-351f12843f28------2</link>
            <guid isPermaLink="false">https://medium.com/p/19ebe1cb1a8e</guid>
            <category><![CDATA[data-integrity]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[data-engineer]]></category>
            <dc:creator><![CDATA[Travis Cooper]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 05:57:41 GMT</pubDate>
            <atom:updated>2021-04-13T05:57:41.353Z</atom:updated>
            <content:encoded><![CDATA[<h4>Techniques to create trust in your data solution</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YoBmZkNy0IZ67_rq" /><figcaption>Photo by <a href="https://unsplash.com/@zanilic?utm_source=medium&amp;utm_medium=referral">Zan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A core responsibility of a data engineer is to build data pipelines. The flow of data from one location to another with mutations along the way is a primary focus for any data engineer. However, when you change data, you make people nervous. Even though you are actively changing the data from its raw form into something usable, it doesn’t change the fact that it is no longer the data that was collected. In order to mitigate these fears, it is vital that data engineers build as many data integrity measures into the solution as possible.</p><h3>Techniques in quality assurance</h3><h4>1. Byte-by-Byte Comparison</h4><p>A byte-by-byte comparison is performed to confirm the integrity of the data. A byte-by-byte comparison involves the following:</p><ol><li>Ingest the source data, transform it, and load it into the target destination</li><li>Read the data in the target destination, reverse the transformations, and compare it byte-by-byte to the original source</li></ol><p>While a byte-by-byte comparison can confirm the integrity of the data, it is a very expensive operation with respect to time and resources. It also adds an added complexity to the development work as you need to, not only develop the transformations, but also the logic to reverse those transformations. However, it can be executed along side the regular ingestion process to ensure data integrity.</p><p><em>Use Case: </em>This can be used in most pipelines given it transforms the data and reverses the transformations to ensure validity.</p><h4>2. Checksums</h4><p>Checksums allow us to check data integrity without as much overhead as a byte-by-byte comparison. There are several ways of calculating a checksum, but it typically involves summing a hashed value(s). In other words, if you calculate the checksum of the source data and compare it to the checksum of the destination data, the two values should match so long as there isn’t a mutation in the data.</p><p><em>Use Case: </em>This can be used where data sets are not expected to change from source to destination.</p><h4>3. Row Counts</h4><p>A non-expensive operation to confirm data integrity is a simple row count. If you compare the number of rows in the source to the number of rows in the destination, it should be the same. If not, there may be an unanticipated transformation. However, row counts should only be used as a first check of the data. There are many issues with relying on row counts to validate the data in its entirety. It does not validate the actual data nor does it account for NULL values that may have appeared during the migration.</p><p><em>Use Case: </em>This can be used where data sets are not expected to change from source to destination.</p><h4>4. Unit Tests</h4><p>Unit tests are a standard with any code you develop; especially data pipelines that actively mutate the data. Pipelines can be tested at both the micro and macro levels. A micro unit test looks at the individual methods. These tests are easier to create as you do not need a full data set to confirm their function (e.g. if a function is meant to filter out null values, a simple matrix with various data types will suffice.). A macro unit test focuses on the pipeline as a whole. A macro unit test is slightly more difficult to test as it involves a full data set to ensure all transformation steps are performing as expected. Unit tests are essential to ensure data integrity remains in tact during any and all mutations in a data pipeline.</p><p><em>Use Case: </em>This can be used in most pipelines given it transforms the data and reverses the transformations to ensure validity.</p><h3>Final Thoughts</h3><p>As a data engineer, data integrity should be considered a top priority when building a pipeline. Not only does it give you confidence that your code is working as expected, but it also gives the user confidence that their data is accurate. Build integrity into your solutions by ensuring any movement or mutation of data functions as expected. Hopefully, the techniques above give a good starting point for building reliable solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19ebe1cb1a8e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/quality-assurance-in-data-pipelines-19ebe1cb1a8e">Quality Assurance in Data Pipelines</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>