<?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 Aditya Daria on Medium]]></title>
        <description><![CDATA[Stories by Aditya Daria on Medium]]></description>
        <link>https://medium.com/@adityadaria?source=rss-9fb450c3bdd1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gwamAIOycL8MvnkgB4vX6Q@2x.jpeg</url>
            <title>Stories by Aditya Daria on Medium</title>
            <link>https://medium.com/@adityadaria?source=rss-9fb450c3bdd1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:53:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adityadaria/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[Keep it Simple, Stupid.]]></title>
            <link>https://adityadaria.medium.com/keep-it-simple-stupid-53ccf7b7bd36?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/53ccf7b7bd36</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[modeling]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Sun, 28 Jan 2024 06:20:28 GMT</pubDate>
            <atom:updated>2024-01-28T06:20:28.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Basic Model Development Still Rocks in the Age of AI Hype</h3><p>Alright, let’s be honest. The world of AI can be intimidating. Jargon flies like confetti at a tech conference, everyone’s throwing around buzzwords like “deep learning” and “neural networks,” and suddenly your perfectly functional linear regression model feels about as cutting-edge as a rotary phone. But hold your horses, because amid all this algorithmic excitement, there’s a crucial truth we sometimes forget: sometimes, keeping it simple is simply the best approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*If9r-YrfMnWLfMV4pNi0fw.png" /></figure><p>Think of it like building a house. Sure, you could go all Tony Stark and whip up a self-replicating mansion with built-in jetpacks, but honestly, most of us just need a sturdy roof over our heads. And that’s where basic model development shines. It’s the trusty hammer and nails of the AI world, the duct tape and chewing gum that gets the job done, even if it doesn’t look fancy on Instagram (pun intended).</p><p>Here’s why embracing the “<strong>Keep it Simple, Stupid” (KISS)</strong> principle in model development can be advantageous:</p><ul><li><strong>Transparency and Interpretability:</strong> Complex models often operate as black boxes, their inner workings shrouded in obscurity. This hinders interpretability, making it difficult to understand how predictions are made and diagnose potential biases. Basic models, on the other hand, offer transparency. Their equations are accessible, allowing for a clear understanding of their decision-making processes and fostering trust within the development team.</li><li><strong>Efficiency and Speed:</strong> Training complex models can be resource-intensive, requiring extensive computational power and lengthy processing times. Basic models, in contrast, are computationally efficient. They train quickly, readily adapting to small datasets and delivering actionable insights much faster. This agility helps accelerate iteration and experimentation, leading to quicker advancements in model performance.</li><li><strong>Generalizability and Robustness:</strong> While complex models excel at fitting intricate patterns within specific datasets, they can be susceptible to overfitting, and memorizing training data without truly learning underlying relationships. Basic models, with their emphasis on simpler features and relationships, achieve better generalizability. They perform well on unseen data, demonstrating greater resilience against noise and outliers.</li><li><strong>A Stepping Stone for Complexity:</strong> Basic models serve as an ideal starting point for exploring more intricate techniques. By gaining a clear understanding of fundamental concepts and achieving initial success with simpler models, developers can build a strong foundation for delving into advanced approaches with greater confidence and efficiency.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mkQt2BUi42acoj_4gVq5Ew.jpeg" /></figure><p>But don’t get me wrong, complex models have their place. When you’re dealing with messy, unstructured data or highly complex problems, they can be a game-changer. But before you jump on the deep learning bandwagon, ask yourself:</p><ul><li>Do I really need all that complexity? Can a simpler model get the job done just as well, or even better?</li><li>Do I have the data and resources to train a complex model effectively? Remember, throwing more algorithms at a problem isn’t always the answer.</li><li>Can I understand and explain the results of my complex model? If not, you might be building a fancy castle on sand.</li></ul><p><strong>Embracing the KISS principle does not imply shunning complexity altogether.</strong> Rather, it advocates for a judicious approach, starting with foundational techniques and utilizing complex models only when warranted by the specific problem and available resources. This ensures building robust and sustainable ML solutions that deliver lasting value.</p><p>So, the next time you’re tempted to get lost in the AI hype, remember the power of simplicity. Keep it real, keep it basic, and you might just be surprised at what you can achieve. Because sometimes, the best models are the ones that don’t need a million parameters to say something profound.</p><p>They’re the ones that whisper, “<strong>Keep it simple, stupid</strong>,” and then quietly get the job done.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53ccf7b7bd36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of Hive/Impala: Writing Efficient Queries Like a Pro!]]></title>
            <link>https://adityadaria.medium.com/unleashing-the-power-of-hive-impala-writing-efficient-queries-like-a-pro-345017f1a5b7?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/345017f1a5b7</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[hive]]></category>
            <category><![CDATA[impala]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Mon, 31 Jul 2023 06:24:22 GMT</pubDate>
            <atom:updated>2023-07-31T06:34:51.799Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there data enthusiasts! Are you ready to dive into the world of Hive and Impala and unleash their true potential? Whether you’re a seasoned pro or just starting out, writing efficient queries is the key to supercharging your data analysis. In this article, I’ll walk you through some casual tips and tricks with real-life examples to make your queries lightning-fast and your data analysis a breeze. Let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78ibUFnVKFNj3FaxgJ_38Q.png" /></figure><p><strong>Know Your Data:</strong></p><p>Before you jump into writing queries, take some time to understand your data. Familiarize yourself with the schema, data types, and distribution of data across partitions. This knowledge will help you optimize your queries and avoid unnecessary scans.</p><p>Example: Let’s say you have a table named “sales_data,” and you want to filter data based on a specific date range. If your table is partitioned by date, you can take advantage of partition pruning to speed up your query.</p><pre>-- Slow query without partition pruning<br>SELECT * FROM sales_data WHERE order_date BETWEEN &#39;2023-01-01&#39; AND &#39;2023-06-30&#39;;<br><br>-- Efficient query using partition pruning<br>SELECT * FROM sales_data WHERE order_date BETWEEN &#39;2023-01-01&#39; AND &#39;2023-06-30&#39;<br>AND partition_date &gt;= &#39;2023-01-01&#39; AND partition_date &lt;= &#39;2023-06-30&#39;;</pre><p><strong>Choose the Right Data Format:</strong></p><p>Picking the right data format can significantly impact query performance. As we discussed <a href="https://adityadaria.medium.com/using-apache-parquet-to-store-data-586a7e6d766c">here</a>, Parquet files are often more efficient due to their columnar storage and compression capabilities.</p><p>Example: Suppose you have two tables, “user_data_csv” and “user_data_parquet,” containing the same data, but in different formats. Let’s compare their query performance.</p><pre>-- Query on CSV table<br>SELECT COUNT(*) FROM user_data_csv WHERE age &gt;= 25;<br><br>-- Same query on Parquet table<br>SELECT COUNT(*) FROM user_data_parquet WHERE age &gt;= 25;</pre><p>You’ll likely notice that the query on the Parquet table executes faster, thanks to its optimized storage format.</p><p><strong>Limit Your Data with WHERE Clause:</strong></p><p>When writing queries, try to filter your data early in the process. The WHERE clause helps reduce the volume of data being processed, resulting in faster query execution.</p><p>Example: Let’s assume you have a “product_sales” table, and you only want to analyze sales from the last year. Use the WHERE clause to filter the data before performing calculations.</p><pre>-- Inefficient query without WHERE clause<br>SELECT SUM(sales_amount) FROM product_sales<br>WHERE YEAR(sales_date) = YEAR(CURRENT_DATE) - 1;<br><br>-- Efficient query with WHERE clause<br>SELECT SUM(sales_amount) FROM product_sales<br>WHERE sales_date &gt;= DATE_SUB(CURRENT_DATE, 365);</pre><p><strong>Utilize Indexes:</strong></p><p>In Hive/Impala, you can create indexes on certain columns to speed up searches. However, use indexes wisely, as they can also slow down data updates.</p><p>Example: If your “customer_data” table has a unique customer ID, you can create an index on this column for faster lookups.</p><pre>-- Creating an index<br>CREATE INDEX idx_customer_id ON TABLE customer_data (customer_id) AS &#39;COMPACT&#39;;<br><br>-- Query utilizing the index<br>SELECT * FROM customer_data WHERE customer_id = &#39;12345&#39;;</pre><p>Congratulations, query guru! You’ve learned some nifty tricks to make your Hive/Impala queries perform like a charm. By understanding your data, choosing the right format, optimizing with WHERE clauses, and utilizing indexes, you’ll be well on your way to efficient data analysis.</p><p>So go ahead, put these tips into practice, and let Hive and Impala work their magic on your data. Happy querying! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=345017f1a5b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Rising Interest Rates Can Boost Bank Profits]]></title>
            <link>https://adityadaria.medium.com/how-rising-interest-rates-can-boost-bank-profits-52e9b44264f0?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/52e9b44264f0</guid>
            <category><![CDATA[interest-rates]]></category>
            <category><![CDATA[profit]]></category>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[banks]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 07:36:46 GMT</pubDate>
            <atom:updated>2023-07-24T07:36:46.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BGgMJ2XXn8nExNCtTfM3A.png" /><figcaption>Image created through DALL-E</figcaption></figure><p>Hey there! So, picture this: interest rates are on the rise! 📈 You might be wondering, “What’s the big deal?”</p><p>Well, for banks, it’s actually pretty awesome news because it can boost their profits! Let me break it down for you in a laid-back way with some cool pointers and also mention the risks they need to watch out for.</p><ol><li><strong>Net Interest Margin (NIM)</strong> 💸 Alright, so banks make money by charging interest on the loans they give out and paying interest on the deposits they receive. When interest rates go up, they can charge borrowers higher rates on loans, while the cost of paying out interest on deposits doesn’t rise that quickly. This difference in interest earned and paid is called the net interest margin (NIM). When it widens, it’s party time for banks! More moolah for them!</li><li><strong>High Five for Loan Yields </strong>🤚 With interest rates going up, banks might offer new loans at higher rates to keep up with the market. Existing fixed-rate loans remain unchanged, but new loans get some extra spice in their yields. This means more dough coming in from loans, which obviously leads to a bigger smile on the banker’s face!</li><li><strong>Let’s Talk Deposits</strong> 💬 When interest rates rise, banks might start offering higher rates on deposits to lure in more cash. Here’s the thing, though: the interest they pay on deposits might not rise as quickly as the rates they charge on loans. So, banks enjoy a sweet spot of better NIM for a while. Nice, right?</li><li><strong>Lending Frenzy! </strong>🏦 Higher interest rates might make folks and businesses think, “Hey, let’s grab those loans now before rates go even higher!” This frenzy for loans means more business for banks and more revenue coming their way. Plus, when the economy is doing well (which often happens with rising rates), people are more likely to borrow and spend. Yay for banks!</li><li><strong>Investment Magic</strong> 🌟 Banks invest their money in stuff like government bonds and other securities. Now, when interest rates climb, newly issued bonds offer better returns. Cha-ching! This means the bank’s investments can bring in more cash, and who doesn’t love that?</li></ol><p>But, hold on! 💡 Let’s not forget about the risks they face:</p><ol><li><strong>Funding Costs Rise:</strong> As banks try to attract more deposits with higher rates, their own funding costs can shoot up, eating into some of those profits.</li><li><strong>Loan Demand Slows:</strong> If rates climb too fast, borrowers might back off, fearing high-interest payments. This could lead to a slowdown in loan demand, and that’s not what banks want to see.</li><li><strong>Risky Business:</strong> Rising rates can impact the creditworthiness of some borrowers, leading to a potential increase in bad loans. That’s not a fun risk to take!</li></ol><p>So, there you have it, the lowdown on how rising interest rates can pump up bank profits. It’s like a financial rollercoaster ride with all its ups and downs, but banks know how to ride it and make the most of the opportunities. 🎢 They keep a close eye on the risks too, ’cause they wanna be the winners in this rate-raising game!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e9b44264f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python List Comprehension: A Beginner’s Guide]]></title>
            <link>https://adityadaria.medium.com/python-list-comprehension-a-beginners-guide-d3c295d33d8c?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3c295d33d8c</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[list-comprehension]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Sat, 25 Feb 2023 09:56:18 GMT</pubDate>
            <atom:updated>2023-02-25T09:56:18.876Z</atom:updated>
            <content:encoded><![CDATA[<p>Picture this: you’re stranded on a deserted island with nothing but a laptop and a thirst for programming. You want to create lists in Python, but you don’t want to write lengthy for loops or complicated conditional statements. What do you do? Fear not, my friend, for Python List Comprehension is here to save the day!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nOASifxQKlUIxSsi" /><figcaption>Photo by <a href="https://unsplash.com/@marekokon?utm_source=medium&amp;utm_medium=referral">Marek Okon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>With Python List Comprehension, you can create lists with ease and finesse, all while sipping on a coconut and watching the waves crash against the shore. Say goodbye to verbose code and hello to succinct, readable code that will make your fellow castaways green with envy.</p><h3>What is List Comprehension?</h3><p>List comprehension is a way to create new lists by applying a transformation to an existing list or sequence. It provides a concise syntax for creating lists in a single line of code. List comprehension is a Pythonic way of expressing a for loop that appends elements to a list.</p><p>The syntax for list comprehension is as follows:</p><pre>new_list = [expression for item in iterable if condition]</pre><ul><li>new_list is the name of the new list that will be created.</li><li>expression is the transformation that will be applied to each element of the iterable.</li><li>item is the current element of the iterable that is being transformed.</li><li>iterable is the list, tuple, or sequence that is being iterated over.</li><li>condition is an optional condition that filters the elements that are included in the new list.</li></ul><h4>Example 1: Creating a List of Squares</h4><p>Suppose we have a list of integers and we want to create a new list that contains the squares of those integers. We can use list comprehension to achieve this in a single line of code:</p><pre>numbers = [1, 2, 3, 4, 5]<br>squares = [num**2 for num in numbers]<br>print(squares) # Output: [1, 4, 9, 16, 25]</pre><p>In this example, we are applying the transformation num**2 to each element of the numbers list, which results in a new list of squares.</p><h4>Example 2: Filtering Elements</h4><p>We can also use list comprehension to filter elements based on a condition. Suppose we have a list of integers and we want to create a new list that only contains the even integers. We can use list comprehension with a condition to achieve this:</p><pre>numbers = [1, 2, 3, 4, 5]<br>evens = [num for num in numbers if num % 2 == 0]<br>print(evens) # Output: [2, 4]</pre><p>In this example, we are using the condition num % 2 == 0 to filter out the odd integers from the numbers list, resulting in a new list of even integers.</p><p><a href="https://adityadaria.medium.com/analyzing-banking-data-with-pyspark-2a55acce7e25">Analyzing Banking Data with PySpark</a></p><h4>Example 3: Creating a List of Tuples</h4><p>List comprehension can also be used to create lists of tuples. Suppose we have two lists, one containing names and another containing ages. We can use list comprehension to create a new list of tuples that contains the name and age of each person:</p><pre>names = [&#39;Alice&#39;, &#39;Bob&#39;, &#39;Charlie&#39;]<br>ages = [25, 30, 35]<br>people = [(name, age) for name, age in zip(names, ages)]<br>print(people) # Output: [(&#39;Alice&#39;, 25), (&#39;Bob&#39;, 30), (&#39;Charlie&#39;, 35)]</pre><p>In this example, we are using the zip function to combine the names and ages lists into a list of tuples. The list comprehension then applies the transformation (name, age) to each tuple in the new list.</p><h4>Example 4: Comparing List Comprehension and for loops</h4><ul><li>Using a for loop to create a list of even numbers from 0 to 10</li></ul><pre>even_numbers = []<br>for x in range(11):<br>    if x % 2 == 0:<br>        even_numbers.append(x)<br>print(even_numbers)</pre><ul><li>Using list comprehension to create a list of even numbers from 0 to 10</li></ul><pre>even_numbers = [x for x in range(11) if x % 2 == 0]<br>print(even_numbers)</pre><p>As you can see, both the for loop and the list comprehension achieve the same output. However, the list comprehension is more concise and readable. It allows you to create a new list and apply a conditional filter to the list elements in one line of code. This makes your code shorter, easier to read and more efficient.</p><p>In summary, the benefits of using list comprehension in Python are:</p><ul><li>Concise and readable code</li><li>More efficient than using a for loop with append statements</li><li>Provides a way to filter elements based on a condition</li><li>Can be used to create lists of tuples in a single line of code</li></ul><h3>Conclusion</h3><p>So there you have it, folks! Python List Comprehension is the ultimate survival tool for all your programming needs. Whether you’re stranded on a deserted island or just trying to write more efficient code, list comprehension will help you get the job done with style and grace. So go forth, my friends, and create those lists with reckless abandon! Who knows, you may just end up building the next big thing in Python…or at least impressing your co-workers with your newfound coding prowess.</p><p>If you would like me to continue sharing insights on a wider range of topics, you can show your support by <a href="https://www.paypal.com/paypalme/adityadaria?country.x=IN&amp;locale.x=en_GB">buying</a> me a cup of coffee. Additionally, I welcome any suggestions or feedback you may have, so please feel free to comment. If you enjoy my content, please consider following and subscribing through my <a href="https://adityadaria.medium.com/subscribe">link</a>. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3c295d33d8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preparing for your SQL interview in 2023]]></title>
            <link>https://adityadaria.medium.com/preparing-for-your-sql-interview-in-2023-927710d2e9e2?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/927710d2e9e2</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 06:53:12 GMT</pubDate>
            <atom:updated>2023-02-18T06:57:35.555Z</atom:updated>
            <content:encoded><![CDATA[<p>Congratulations, fresher! You’ve landed an interview for a SQL job. Now, it’s time to prepare for the technical grilling that lies ahead. Don’t worry, though; with the right mindset and preparation, you can nail the interview and impress your potential employer.</p><blockquote>Also, please crush that clap and follow button.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AHdM9ON4J1xkdKtm" /><figcaption>Photo by <a href="https://unsplash.com/es/@andrewtneel?utm_source=medium&amp;utm_medium=referral">Andrew Neel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li><strong>Review the basics of SQL</strong></li></ol><p>Before diving into more complex topics, it’s essential to have a solid understanding of the basics of SQL. Review concepts such as data types, operators, functions, and clauses, as well as the structure of SQL queries and the use of SQL statements.</p><p>2.<strong> Practice writing SQL queries</strong></p><p>SQL is all about writing queries, so it’s essential to practice writing SQL statements to become more familiar with the language. Start with simple queries and work your way up to more complex scenarios. Try using sample databases or online resources to practice and test your skills.</p><p>I have covered SQL basics here:</p><p><a href="https://adityadaria.medium.com/sql-basics-simplified-2023-97c001050cb4">SQL Basics Simplified : 2023</a></p><p>3. <strong>Familiarize yourself with common SQL interview questions</strong></p><p>While every interview is unique, some common questions come up in most SQL interviews. Make sure you’re prepared to answer questions related to SQL basics, querying and filtering data, joins and subqueries, database design and normalization, and optimization and performance tuning. Practice answering these questions with a friend or mentor and seek feedback to improve your responses.</p><blockquote>You can also schedule time with me on topmate <a href="http://topmate.io/aditya_daria">here</a>.</blockquote><p>4. <strong>Prepare for hands-on scenarios</strong></p><p>Some SQL interviews may require you to perform hands-on tasks or solve real-world scenarios. Familiarize yourself with database management tools and practice solving sample problems. This will help you gain practical experience and prepare you for questions related to real-world scenarios and use cases.</p><p>5. <strong>Showcase your problem-solving skills</strong></p><p>As a fresher, you may not have extensive experience with SQL or database management, but you can still demonstrate your problem-solving skills. Be prepared to discuss how you’ve approached challenges in the past and how you’ve used logic and critical thinking to solve problems. Emphasize your willingness to learn and your enthusiasm for the field.</p><p>6. <strong>Keep up-to-date with the latest SQL trends and updates</strong></p><p>SQL is constantly evolving, with new features, tools, and updates released regularly. Make sure you’re up-to-date with the latest trends and developments in SQL by following SQL blogs, podcasts, and social media channels. This will show potential employers that you’re committed to staying current and are passionate about the field.</p><h3><strong>Conclusion</strong></h3><p>Remember, preparing for a SQL interview as a fresher is all about showcasing your skills, problem-solving abilities, and willingness to learn. By following the tips and strategies outlined in this article, you can demonstrate your expertise and enthusiasm for the field. So go ahead, ace that interview, and show the world what you’re made of!</p><p>I hope that you will find this article insightful and informative. If you enjoyed it, please consider sharing the link with your friends, family, and colleagues. If you have any suggestions or feedback, please feel free to leave a comment and a clap. And if you’d like to stay updated on my future content, please consider following and subscribing using the provided <a href="https://adityadaria.medium.com/subscribe"><strong>link</strong></a><strong>. </strong>Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=927710d2e9e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Saving the Day with AWS S3: The Reliable Cloud Storage Solution]]></title>
            <link>https://adityadaria.medium.com/saving-the-day-with-aws-s3-the-reliable-cloud-storage-solution-1df6581e17f3?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1df6581e17f3</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 06:38:36 GMT</pubDate>
            <atom:updated>2023-02-18T06:38:36.494Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you tired of managing stacks of hard drives and external storage devices? Do you find yourself constantly worrying about data loss and system failures? Fear not, because AWS S3 is here to save the day!</p><p>Amazon Simple Storage Service, commonly known as AWS S3, is a highly scalable and reliable cloud storage service provided by Amazon Web Services (AWS). S3 allows you to store and retrieve data from anywhere on the internet and provides a highly durable and available storage solution for your applications.</p><p>In this article, we will explore the key features and benefits of AWS S3, and how it can be used to store and manage data in the cloud.</p><p><a href="https://adityadaria.medium.com/sql-basics-simplified-2023-97c001050cb4">SQL Basics Simplified : 2023</a></p><h3><strong>What is AWS S3?</strong></h3><p>AWS S3 is an object storage service that allows you to store and retrieve data from anywhere on the internet. It is highly scalable, durable, and provides high availability for your data. S3 provides a simple web services interface that allows you to store and retrieve any amount of data, at any time, from anywhere on the internet.</p><p>S3 is designed to be highly flexible and scalable, making it ideal for a wide range of use cases, including data backup and archiving, content distribution, media storage, and big data analytics. S3 can be used to store and manage virtually any type of data, including text, images, videos, and audio files.</p><h3><strong>Key Features of AWS S3</strong></h3><ol><li>Scalability: S3 is designed to be highly scalable, allowing you to store and retrieve virtually any amount of data, from anywhere on the internet. You can scale your S3 storage capacity up or down as your business needs change, without any disruption to your applications.</li><li>Durability: S3 provides a highly durable storage solution for your data, with built-in redundancy and automatic data replication across multiple data centers. S3 is designed to provide 99.999999999% (11 nines) durability, ensuring that your data is always available when you need it.</li><li>Availability: S3 provides high availability for your data, with a service level agreement (SLA) of 99.99%. S3 is designed to be highly resilient, with automatic failover and self-healing capabilities, ensuring that your data is always available, even in the event of a failure.</li><li>Security: S3 provides a variety of security features to help you protect your data, including encryption at rest and in transit, access control using AWS Identity and Access Management (IAM), and integration with AWS CloudTrail for audit logging.</li><li>Versioning: S3 allows you to enable versioning for your objects, allowing you to preserve, retrieve, and restore every version of every object in your bucket. This can be useful for compliance, data backup, and disaster recovery scenarios.</li><li>Lifecycle Policies: S3 allows you to define lifecycle policies for your objects, allowing you to automatically transition objects to different storage classes or delete them based on their age or other criteria. This can be useful for managing the cost of storing large amounts of data in S3.</li><li>Replication: S3 allows you to replicate your objects across multiple regions, providing an additional layer of protection for your data and enabling disaster recovery scenarios.</li></ol><blockquote>Also, if my articles leave you wanting more, don’t hesitate to follow and show your appreciation with a round of applause!</blockquote><h3><strong>How to Use AWS S3</strong></h3><p>To use AWS S3, you need to create a bucket, which is a container for your objects. You can create a bucket using the AWS Management Console, the AWS CLI, or programmatically using the AWS SDKs. Once you have created a bucket, you can start uploading objects to it.</p><p>Objects in S3 can be any type of data, such as text, images, videos, or audio files. Objects can be uploaded to S3 using the AWS Management Console, the AWS CLI, or programmatically using the AWS SDKs. Once an object is uploaded to S3, it is automatically replicated across multiple data centers to ensure durability and availability.</p><p>S3 provides a variety of storage classes, each optimized for different use cases and cost considerations. The standard storage class is designed for frequent access to your data and provides the highest level of durability and availability. The standard storage class is recommended for most use cases.</p><p>S3 also provides several other storage classes, including:</p><ol><li><strong>Infrequent Access (IA)</strong>: IA is designed for data that is accessed less frequently, but still requires immediate availability when needed. IA provides lower storage costs compared to the standard storage class but incurs additional retrieval fees when accessing the data.</li><li><strong>One Zone-Infrequent Access (One Zone-IA):</strong> One Zone-IA is similar to IA, but stores data in a single availability zone, rather than across multiple zones. This makes One Zone-IA less durable than IA but provides lower storage costs for use cases that do not require high durability.</li><li><strong>Glacier:</strong> Glacier is designed for data that is rarely accessed and can tolerate longer retrieval times. Glacier provides the lowest storage costs compared to other storage classes but incurs additional retrieval fees when accessing the data.</li></ol><p>To optimize costs, S3 also provides a feature called S3 Object Lifecycle Management. This allows you to define rules to automatically transition objects between different storage classes or delete them based on their age or other criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xZhQbyAABvyrgdSg0rJqgg.png" /><figcaption>Image Source : Whizlabs</figcaption></figure><p>S3 also provides a variety of management and monitoring tools to help you manage and monitor your S3 resources, including the S3 Management Console, AWS CLI, and AWS SDKs. S3 also integrates with AWS CloudWatch to provide metrics and logs for monitoring and troubleshooting.</p><h3>Use Cases for AWS S3</h3><ol><li>Data Backup and Archiving: S3 is an ideal solution for storing and managing backups and archives of your critical data. S3 provides a highly durable and available storage solution, with built-in redundancy and automatic data replication across multiple data centers.</li><li>Content Distribution: S3 is often used to distribute large media files, such as videos and images, to users around the world. S3 integrates with Amazon CloudFront, a content delivery network (CDN), to provide low-latency and high-performance content delivery.</li><li>Big Data Analytics: S3 is often used as a data lake for big data analytics. S3 provides a scalable and durable storage solution for storing and managing large amounts of data, which can be accessed and analyzed using big data analytics tools such as Amazon EMR, Amazon Athena, and Amazon Redshift.</li><li>Web Hosting: S3 can be used to host static websites, such as HTML pages and client-side JavaScript applications. S3 integrates with Amazon Route 53, a DNS service, to provide a custom domain name for your website.</li></ol><h3>Conclusion</h3><p>AWS S3 is a highly scalable and flexible object storage service that provides durable, available, and cost-effective storage for your data. With its variety of storage classes and management and monitoring tools, S3 is suitable for a wide range of use cases, from data backup and archiving to big data analytics and web hosting. Additionally, S3 provides a variety of security features to help you protect your data, making it a reliable and secure solution for storing and managing your critical data.</p><p>So the next time you find yourself drowning in data and storage woes, just remember that AWS S3 is always there to lend a helping hand. With its scalable, durable, and cost-effective storage solutions, AWS S3 is the superhero you need to save the day and keep your data safe and secure. So why wait? Sign up for AWS S3 today and start storing your data in the cloud!</p><p>I hope that you will find this article insightful and informative. If you enjoyed it, please consider sharing the link with your friends, family, and colleagues. If you have any suggestions or feedback, please feel free to leave a comment and a clap. And if you’d like to stay updated on my future content, please consider following and subscribing using the provided <a href="https://adityadaria.medium.com/subscribe"><strong>link</strong></a><strong>. </strong>Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1df6581e17f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing ROW_NUMBER(), RANK(), and DENSE_RANK() Functions in SQL]]></title>
            <link>https://adityadaria.medium.com/comparing-row-number-rank-and-dense-rank-functions-in-sql-9ce278d71515?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ce278d71515</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[advanced-sql]]></category>
            <category><![CDATA[window-functions]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 13:37:38 GMT</pubDate>
            <atom:updated>2023-02-12T13:37:38.393Z</atom:updated>
            <content:encoded><![CDATA[<p>ROW_NUMBER(), RANK(), and DENSE_RANK() are all functions in SQL that are used to assign unique rankings to rows in a result set. They are similar, but have some important differences:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pZ0ao9VNhdwqskfG" /><figcaption>Photo by <a href="https://unsplash.com/es/@casparrubin?utm_source=medium&amp;utm_medium=referral">Caspar Camille Rubin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Also Hey ! Show your support and appreciation by clapping for my posts!</blockquote><p><a href="https://adityadaria.medium.com/sql-basics-simplified-2023-97c001050cb4">SQL Basics Simplified : 2023</a></p><ol><li>ROW_NUMBER(): This function assigns a unique number to each row in the result set, based on the order specified in the ORDER BY clause. The numbers are sequential and have no gaps. For example:</li></ol><pre>SELECT name, salary, ROW_NUMBER() OVER (ORDER BY salary DESC) AS row_number<br>FROM employees;</pre><p>This query assigns a unique row number to each employee based on their salary, in descending order.</p><p>2. RANK(): This function also assigns a unique rank to each row in the result set but takes into account ties in the values. If there are two or more rows with the same value, they are assigned the same rank, and the next rank is skipped. For example:</p><pre>SELECT name, salary, RANK() OVER (ORDER BY salary DESC) AS rank<br>FROM employees;</pre><p>This query assigns a rank to each employee based on their salary, in descending order. If there are two employees with the same salary, they are assigned the same rank, and the next rank is skipped.</p><p>3. DENSE_RANK(): This function works similarly to RANK(), but does not skip ranks for ties. Instead, it assigns the same rank to tied values and the next rank to the next value. For example:</p><pre>SELECT name, salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS dense_rank<br>FROM employees;</pre><p>This query assigns a dense rank to each employee based on their salary, in descending order. If there are two employees with the same salary, they are assigned the same rank, and the next rank is assigned to the next value.</p><p>Here&#39;s an example of what the output might look like:</p><pre>name       | salary | row_number | rank | dense_rank<br>-----------|--------|------------|------|-----------<br>John Doe   | 50000  | 1          | 1    | 1<br>Jane Doe   | 45000  | 2          | 2    | 2<br>Jim Smith  | 45000  | 3          | 2    | 2<br>Sarah Johnson | 40000  | 4          | 4    | 3</pre><p>In this example, the employees table has four rows, and the data is ordered by salary in descending order.</p><ul><li>For the ROW_NUMBER() function, a unique number is assigned to each row, with no gaps.</li><li>For the RANK() function, two employees (Jane Doe and Jim Smith) have the same salary, so they are assigned the same rank (2), and the next rank (3) is skipped.</li><li>For the DENSE_RANK() function, two employees (Jane Doe and Jim Smith) have the same salary, so they are assigned the same rank (2), but the next rank (3) is assigned to the next value (Sarah Johnson).</li></ul><p>So, to summarize:</p><ul><li>ROW_NUMBER() assigns a unique number to each row, with no gaps</li><li>RANK() assigns a unique rank to each row, skipping ranks for tied values</li><li>DENSE_RANK() assigns a unique rank to each row, without skipping ranks for tied values.</li></ul><p>I hope that you will find this article insightful and informative. If you enjoyed it, please consider sharing the link. If you have any suggestions or feedback, please feel free to leave a comment/clap. And if you’d like to stay updated on my future content, please consider following and subscribing using the provided <a href="https://adityadaria.medium.com/subscribe"><strong>link</strong></a><strong>. </strong>Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ce278d71515" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Basics Simplified : 2023]]></title>
            <link>https://adityadaria.medium.com/sql-basics-simplified-2023-97c001050cb4?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/97c001050cb4</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 06:40:27 GMT</pubDate>
            <atom:updated>2023-02-08T06:40:27.032Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Basics Simplified : 2023</h3><p>Welcome to the exciting world of SQL! SQL, or Structured Query Language, is the language used to manage and manipulate data stored in relational databases. Whether you’re looking to become a data analyst, a database administrator, or just want to improve your data literacy, learning SQL is a great place to start.</p><p>In this comprehensive article, we will simplify and demystify the basics of SQL, so you can start your journey with confidence. From creating tables and inserting data, to filtering data using operators and performing calculations using functions, we’ll cover everything you need to know to get started.</p><p>So, if you’re ready to dive into the world of SQL and unlock the power of your data, grab a cup of coffee (tea in my case!) and let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*al06oP0hQny7o90VH4aKig.png" /><figcaption>Source : Google</figcaption></figure><blockquote>SQL, short for Structured Query Language, is a standard programming language used to manage relational databases. A relational database is a collection of data organized into tables, with each table containing rows and columns that represent the data. The data in a relational database can be easily searched, sorted, and manipulated using SQL commands. In this article, we will explore the basics of SQL and how you can use it to work with databases.</blockquote><h3>What is a relational database?</h3><p>A relational database is a collection of data organized into tables. Each table has columns, also known as fields, that define the type of data that can be stored in that column, and rows, also known as records, which contain the actual data. The columns in a table represent the attributes of the data, while the rows represent individual instances of the data.</p><p>For example, consider a table that contains information about employees in a company. This table could have columns for the employee’s name, employee ID, date of birth, and job title, and a row for each employee.</p><h3>SQL commands</h3><p>SQL commands are used to interact with a relational database. These commands can be used to create, modify, and query tables and their data. Some of the most common SQL commands are:</p><h3>SELECT</h3><p>The SELECT command is used to retrieve data from a table. The syntax for the SELECT command is as follows:</p><pre>SELECT column1, column2, ..., columnN<br>FROM table_name;</pre><p>For example, if you want to retrieve the names of all employees in the employee table, you would use the following SQL command:</p><pre>SELECT name<br>FROM employee;</pre><h3>INSERT</h3><p>The INSERT command is used to add new data to a table. The syntax for the INSERT command is as follows:</p><pre>INSERT INTO table_name (column1, column2, ..., columnN)<br>VALUES (value1, value2, ..., valueN);</pre><p>For example, if you want to add a new employee to the employee table, you would use the following SQL command:</p><pre>INSERT INTO employee (name, employee_id, date_of_birth, job_title)<br>VALUES (&#39;John Doe&#39;, &#39;1234&#39;, &#39;1980-01-01&#39;, &#39;Manager&#39;);</pre><h3>UPDATE</h3><p>The UPDATE command is used to modify existing data in a table. The syntax for the UPDATE command is as follows:</p><pre>UPDATE table_name<br>SET column1 = value1, column2 = value2, ..., columnN = valueN<br>WHERE condition;</pre><p>For example, if you want to change the job title of an employee with the employee ID 1234 to “Director”, you would use the following SQL command:</p><pre>UPDATE employee<br>SET job_title = &#39;Director&#39;<br>WHERE employee_id = &#39;1234&#39;;</pre><h3>DELETE</h3><p>The DELETE command is used to delete data from a table. The syntax for the DELETE command is as follows:</p><pre>DELETE FROM table_name<br>WHERE condition;</pre><p>For example, if you want to delete an employee with the employee ID 1234 from the employee table, you would use the following SQL command:</p><pre>DELETE FROM employee<br>WHERE employee_id = &#39;1234&#39;;</pre><h3>CREATE</h3><p>The CREATE command is used to create a new table. The syntax for the CREATE command is as follows:</p><pre>CREATE TABLE table_name (<br>  column1 data_type constraint,<br>  column2 data_type constraint,<br>  ...<br>  columnN data_type constraint<br>);</pre><p>For example, if you want to create a new table called “employee”, you would use the following SQL command:</p><pre>CREATE TABLE employee (<br>  name varchar(50),<br>  employee_id varchar(10),<br>  date_of_birth date,<br>  job_title varchar(50)<br>);</pre><p>In this example, we are creating a table called “employee” with four columns: “name”, “employee_id”, “date_of_birth”, and “job_title”. The data type of each column is specified using the “varchar” or “date” keywords. The number in parentheses after “varchar” specifies the maximum length of the data that can be stored in that column.</p><h3>ALTER</h3><p>The ALTER command is used to modify an existing table. The syntax for the ALTER command is as follows:</p><pre>ALTER TABLE table_name<br>ADD COLUMN column_name data_type constraint;</pre><p>For example, if you want to add a new column to the employee table called “hire_date”, you would use the following SQL command:</p><pre>ALTER TABLE employee<br>ADD COLUMN hire_date date;</pre><h3>SQL operators</h3><p>SQL operators are used to perform operations on data in a relational database. Some of the most common SQL operators are:</p><h3>WHERE</h3><p>The WHERE operator is used to filter data based on a specified condition. The syntax for the WHERE operator is as follows:</p><pre>SELECT column1, column2, ..., columnN<br>FROM table_name<br>WHERE condition;</pre><p>For example, if you want to retrieve the names of all employees who were born in 1980, you would use the following SQL command:</p><pre>SELECT name<br>FROM employee<br>WHERE date_of_birth = &#39;1980-01-01&#39;;</pre><h3>AND / OR</h3><p>The AND and OR operators are used to combine multiple conditions in a WHERE clause. The syntax for the AND and OR operators is as follows:</p><pre>SELECT column1, column2, ..., columnN<br>FROM table_name<br>WHERE condition1 AND condition2;<br><br>SELECT column1, column2, ..., columnN<br>FROM table_name<br>WHERE condition1 OR condition2;</pre><p>For example, if you want to retrieve the names of all employees who were born in 1980 and have the job title “Manager”, you would use the following SQL command:</p><pre>SELECT name<br>FROM employee<br>WHERE date_of_birth = &#39;1980-01-01&#39; AND job_title = &#39;Manager&#39;;</pre><h3>IN / NOT IN</h3><p>The IN and NOT IN operators are used to filter data based on a set of values. The syntax for the IN and NOT IN operators is as follows:</p><pre>SELECT column1, column2, ..., columnN<br>FROM table_name<br>WHERE column_name IN (value1, value2, ..., valueN);<br><br>SELECT column1, column2, ..., columnN<br>FROM table_name<br>WHERE column_name NOT IN (value1, value2, ..., valueN);</pre><p>For example, if you want to retrieve the names of all employees who have the job titles “Manager” or “Developer”, you would use the following SQL command:</p><pre>SELECT name<br>FROM employee<br>WHERE job_title IN (&#39;Manager&#39;, &#39;Developer&#39;);</pre><h3>LIKE</h3><p>The LIKE operator is used to filter data based on a pattern. The syntax for the LIKE operator is as follows:</p><pre>SELECT column1, column2, ..., columnN<br>FROM table_name<br>WHERE column_name LIKE pattern;</pre><p>For example, if you want to retrieve the names of all employees whose name starts with the letter “J”, you would use the following SQL command:</p><pre>SELECT name<br>FROM employee<br>WHERE name LIKE &#39;J%&#39;;</pre><p>The “%” symbol is used as a wildcard, which means it can match any number of characters.</p><h3>SQL functions</h3><p>SQL functions are used to perform operations on data in a relational database. Some of the most common SQL functions are:</p><h3>COUNT</h3><p>The COUNT function is used to count the number of rows in a table. The syntax for the COUNT function is as follows:</p><pre>SELECT COUNT(column_name)<br>FROM table_name;</pre><p>For example, if you want to count the number of employees in the employee table, you would use the following SQL command:</p><pre>SELECT COUNT(name)<br>FROM employee;</pre><h3>SUM</h3><p>The SUM function is used to calculate the sum of a column’s values. The syntax for the SUM function is as follows:</p><pre>SELECT SUM(column_name)<br>FROM table_name;</pre><p>For example, if you have a table with a column called “salary”, and you want to calculate the sum of all salaries in the table, you would use the following SQL command:</p><pre>SELECT SUM(salary)<br>FROM table_name;</pre><h3>AVG</h3><p>The AVG function is used to calculate the average of a column’s values. The syntax for the AVG function is as follows:</p><pre>SELECT AVG(column_name)<br>FROM table_name;</pre><h3>MIN / MAX</h3><p>The MIN and MAX functions are used to retrieve the minimum and maximum values in a column, respectively. The syntax for the MIN and MAX functions is as follows:</p><pre>SELECT MIN(column_name)<br>FROM table_name;<br><br>SELECT MAX(column_name)<br>FROM table_name;</pre><p>For example, if you have a table with a column called “salary”, and you want to retrieve the minimum and maximum salaries in the table, you would use the following SQL commands:</p><pre>SELECT MIN(salary)<br>FROM table_name;<br><br>SELECT MAX(salary)<br>FROM table_name;</pre><h3>Conclusion</h3><p>In this article, we’ve covered the basics of SQL, including how to create and modify tables, filter data using operators, and perform calculations using functions. With these skills, you’re now ready to start working with SQL databases and retrieving valuable insights from the data stored within them.</p><p>It’s important to note that there’s much more to SQL than what’s covered in this article. For example, we’ve only touched briefly on SQL Joins, which allow you to combine data from multiple tables into a single result set. Additionally, there are advanced SQL concepts like subqueries, stored procedures, and triggers that can greatly enhance the power and flexibility of your SQL applications.</p><p>However, even with just the basics of SQL, you can already perform powerful data analysis and reporting, and it’s a great foundation to build upon as you continue to grow your skills.</p><p>In conclusion, SQL is a fundamental tool for data analysis and management, and learning the basics can help you unlock insights from large data sets. Whether you’re working with a small database or managing a massive data warehouse, SQL is a valuable skill to have in your toolkit.</p><p>I hope that you will find this article insightful and informative. If you enjoyed it, please consider sharing the link with your friends, family, and colleagues. If you have any suggestions or feedback, please feel free to leave a comment. And if you’d like to stay updated on my future content, please consider following and subscribing using the provided <a href="https://adityadaria.medium.com/subscribe"><strong>link</strong></a><strong>. </strong>Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97c001050cb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing Banking Data with PySpark]]></title>
            <link>https://adityadaria.medium.com/analyzing-banking-data-with-pyspark-2a55acce7e25?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a55acce7e25</guid>
            <category><![CDATA[pyspark]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 16:46:44 GMT</pubDate>
            <atom:updated>2023-01-27T16:46:44.076Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>PySpark is the alchemist of big data, turning vast amounts of information into actionable insights and knowledge.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOF1XGTAffNBLomXuOVmcg.png" /></figure><p>PySpark’s ability to handle large datasets makes it a valuable tool for data processing and analysis in the banking industry. In this project, we will utilize PySpark to analyze banking transactions and gain insights into customer behavior. From data cleaning to feature engineering and model building, we will explore the various capabilities of PySpark and how it can be applied to real-world problems in the banking sector.</p><h3>Introduction</h3><p>In this project, we will be using PySpark, a powerful Python library for big data processing, to analyze a dataset from a bank. The goal of this project is to gain insights into the banking industry by cleaning, transforming, and analyzing the data using PySpark.</p><h3>Data</h3><p>The dataset used in this project is a real-world dataset from a bank. It contains information such as customer demographics, account balances, and transaction history. The dataset is stored in a CSV file and will be loaded into a PySpark DataFrame for analysis.</p><h3>Data Cleaning</h3><p>The first step in this project is to clean the data. This includes handling missing values, removing duplicate records, and ensuring that the data is in a format that can be easily analyzed. We will use PySpark’s built-in functions for data cleaning, such as dropna(), dropDuplicates(), and cast().</p><h3>Feature Engineering</h3><p>Once the data is cleaned, we will move on to feature engineering. This step involves creating new features from the existing data that will be useful for our analysis. We will create new features such as average account balance, number of transactions, and customer age.</p><h3>Exploratory Data Analysis</h3><p>After the data is cleaned and feature engineered, we will perform exploratory data analysis (EDA) to gain a better understanding of the data. We will use PySpark’s built-in functions for EDA, such as describe(), groupBy(), and count(). We will also use PySpark&#39;s built-in visualization library, matplotlib, to create visualizations of the data.</p><h3>Model Building</h3><p>Finally, we will use the cleaned and feature-engineered data to build a model. We will train and evaluate different models using PySpark’s machine learning library, ml, to predict customer churn. We will also use cross-validation and grid search to find the best parameters for our model.</p><pre># Import necessary libraries<br>from pyspark.sql import SparkSession<br>from pyspark.sql.functions import *<br>from pyspark.ml.feature import VectorAssembler<br>from pyspark.ml.classification import LogisticRegression<br>from pyspark.ml.evaluation import BinaryClassificationEvaluator<br>from pyspark.ml.tuning import ParamGridBuilder, CrossValidator<br><br># Create a SparkSession<br>spark = SparkSession.builder.appName(&quot;BankingProject&quot;).getOrCreate()<br><br># Load the data into a DataFrame<br>df = spark.read.csv(&quot;path/to/data.csv&quot;, header=True, inferSchema=True)<br><br># Data cleaning<br>df = df.dropna()<br>df = df.dropDuplicates()<br>df = df.withColumn(&quot;age&quot;, col(&quot;age&quot;).cast(&quot;integer&quot;))<br><br># Feature engineering<br>df = df.withColumn(&quot;avg_balance&quot;, (col(&quot;balance&quot;) / col(&quot;transactions&quot;)))<br>df = df.withColumn(&quot;customer_age&quot;, (col(&quot;year&quot;) - col(&quot;birth_year&quot;)))<br><br># Exploratory Data Analysis<br>df.describe().show()<br>df.groupBy(&quot;churn&quot;).count().show()<br>df.select(&quot;avg_balance&quot;).show()<br><br># Prepare data for model building<br>assembler = VectorAssembler(inputCols=[&quot;avg_balance&quot;, &quot;customer_age&quot;], outputCol=&quot;features&quot;)<br>data = assembler.transform(df)<br><br># Split data into training and test sets<br>train, test = data.randomSplit([0.7, 0.3])<br><br># Build the model<br>lr = LogisticRegression(labelCol=&quot;churn&quot;)<br><br># Set up the parameter grid for cross-validation<br>paramGrid = ParamGridBuilder() \<br>    .addGrid(lr.regParam, [0.1, 0.01]) \<br>    .addGrid(lr.elasticNetParam, [0.5, 0.8]) \<br>    .build()<br><br># Set up the evaluator<br>evaluator = BinaryClassificationEvaluator(labelCol=&quot;churn&quot;)<br><br># Set up the cross-validator<br>cv = CrossValidator(estimator=lr, estimatorParamMaps=paramGrid, evaluator=evaluator)<br><br># Train the model<br>model = cv.fit(train)<br><br># Make predictions on the test set<br>predictions = model.transform(test)<br><br># Evaluate the model<br>print(&quot;Accuracy: &quot;, evaluator.evaluate(predictions))</pre><p>The code above is a sample implementation of a PySpark project that aims to predict customer churn in a banking dataset using machine learning.</p><p>The first step is to import necessary libraries such as SparkSession, functions, VectorAssembler, LogisticRegression, BinaryClassificationEvaluator, and CrossValidator.</p><p>Then a SparkSession is created, this is the entry point for creating DataFrames, DataSets, and working with the Data API.</p><p>The data is loaded into a DataFrame from a CSV file with the help of spark.read.csv() method, with the inferSchema option set to true and header set to true.</p><p>Next, the data is cleaned by dropping missing values and duplicates, also the age column is casted to integer type.</p><p>Then, feature engineering is applied to the dataset, two new columns are added avg_balance and customer_age.</p><p>After that, Exploratory Data Analysis (EDA) is done to understand the data better, describe(), groupBy(&quot;churn&quot;).count().show() and select(&quot;avg_balance&quot;).show() methods are used to get the statistical summary, group the data by churn, and check the avg_balance column respectively.</p><p>Once EDA is done, the data is prepared for model building by creating a VectorAssembler object, this object is used to combine the input columns into a single vector column.</p><p>The data is then split into training and test sets in the ratio of 70:30 using the randomSplit() method.</p><p>The next step is building the model, a LogisticRegression object is created with the labelCol set to &quot;churn&quot;.</p><p>A parameter grid is created using the ParamGridBuilder() method, this grid contains different combinations of regularization parameter and elastic net mixing parameter.</p><p>A BinaryClassificationEvaluator object is created to evaluate the model’s performance.</p><p>A CrossValidator object is created that takes the estimator, parameter grid, and evaluator as arguments, this object is used to train the model.</p><p>The model is trained using the fit() method on the training data.</p><p>Predictions are made on the test set using the transform() method, the accuracy of the model is printed using the evaluate() method of the BinaryClassificationEvaluator.</p><p>In conclusion, the project above demonstrates how PySpark can be used to analyze banking transactions and predict customer churn. By using PySpark’s powerful data processing capabilities and machine learning libraries, we were able to clean and prepare the data, perform exploratory data analysis, and train a model to accurately predict customer churn. This project shows the potential of PySpark in the banking industry and how it can be used to gain valuable insights from large datasets. It could be a good reference for anyone who would like to apply PySpark on banking dataset to get some insight.</p><p>I hope that you will find this article insightful and informative. If you enjoyed it, please consider sharing the link with your friends, family, and colleagues. If you have any suggestions or feedback, please feel free to leave a comment. And if you’d like to stay updated on my future content, please consider following and subscribing using the provided <a href="https://adityadaria.medium.com/subscribe"><strong>link</strong></a><strong>. </strong>Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a55acce7e25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Data Modeling]]></title>
            <link>https://adityadaria.medium.com/understanding-data-modeling-dd882a48690?source=rss-9fb450c3bdd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd882a48690</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-modeling]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Aditya Daria]]></dc:creator>
            <pubDate>Thu, 26 Jan 2023 12:55:06 GMT</pubDate>
            <atom:updated>2023-01-26T12:55:06.551Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Data modeling is like a game of Tetris, every piece fits perfectly in its place to build a solid foundation.”</blockquote><p>Data modeling is the process of creating a conceptual representation of data and the relationships between different data entities. The goal of data modeling is to create a structure that is easy to understand and use, and that accurately reflects the real-world relationships between data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*M-0uE1haOzfDcnuS0hZRyQ.png" /></figure><p>There are several basic concepts and techniques used in data modeling:</p><ul><li>Entities and Attributes: Data entities are the objects or concepts that are represented in the data model, such as customers or orders. Attributes are the properties or characteristics of an entity, such as a customer’s name or an order’s total cost.</li><li>Relationships: Data entities can be related to each other in various ways, such as one-to-one, one-to-many, and many-to-many. Relationships are used to link different entities together and define how they are related.</li><li>Keys: Keys are unique identifiers used to identify individual records in a table. Primary keys are the unique identifiers used to identify an individual entity within a table, while foreign keys are used to link records across multiple tables. Example snippets below</li></ul><pre>CREATE TABLE customers (<br>  customer_id INT PRIMARY KEY,<br>  name VARCHAR(255),<br>  address VARCHAR(255)<br>); --PRIMARY KEY<br><br>CREATE TABLE orders (<br>  order_id INT PRIMARY KEY,<br>  customer_id INT,<br>  order_date DATE,<br>  FOREIGN KEY (customer_id) REFERENCES customers(customer_id)<br>); --FOREIGN KEY<br><br>CREATE TABLE flight_schedule (<br>  flight_number INT,<br>  departure_date DATE,<br>  arrival_date DATE,<br>  PRIMARY KEY (flight_number, departure_date)<br>); --COMPOSITE KEY<br><br>CREATE TABLE sales (<br>  sales_id INT AUTO_INCREMENT PRIMARY KEY,<br>  product_id INT,<br>  sales_date DATE,<br>  quantity INT<br>); --SURROGATE KEY<br></pre><ul><li>Normalization: Normalization is the process of organizing data in a way that reduces data redundancy and improves data integrity. There are several normal forms, such as first normal form (1NF), second normal form (2NF), and third normal form (3NF), that provide guidelines for creating a normalized data model.</li><li>Indexing: Indexing is the process of creating a data structure that allows for fast access to specific records. This can be done using various types of indexes, such as clustered and non-clustered indexes, to optimize data retrieval.</li><li>Modeling Notations: There are several notation methods used to create data models such as Entity-Relationsship Notation (ER), Unified Modeling Language (UML), and Object Role Modeling (ORM). Each notation has its own set of symbols and conventions for representing entities, attributes, relationships, and other concepts in the data model.</li><li>Data Quality: Data quality is an important consideration in data modeling. It involves ensuring that the data is accurate, complete, and consistent. This can be achieved by implementing data validation rules, data cleansing, and data standardization techniques.</li><li>Scalability: As the amount of data grows, it’s important that the data model is scalable, to handle the increased volume and complexity of data. This can be achieved by using techniques such as partitioning, denormalization, and data warehousing.</li><li>Performance: Data modeling also involves considering the performance of the data model. This includes optimizing the data model for specific query patterns, using indexing and partitioning to improve data retrieval, and using appropriate data types and storage methods.</li><li>Flexibility: The data model should be flexible enough to adapt to changing business requirements and new data sources. This can be achieved by using a modular design, using generic data structures, and implementing a data dictionary to document the data model.</li></ul><p>To sum it all up, data modeling is a critical aspect of data management and analytics. It helps organize and structure data in a way that makes it easy to understand, use, and analyze. By understanding the basics of data modeling, including entities, attributes, and relationships, as well as the different types of data models, such as relational and NoSQL, data professionals can effectively design and implement data models that support the needs of their organization.</p><p>Furthermore, by keeping in mind the best practices and principles of data modeling, such as data integrity and normalization, data professionals can ensure the quality and accuracy of their data models. Data modeling is not only a technical task, but also a strategic one that can help organizations make better decisions, improve efficiency, and support business objectives.</p><p>I hope that you will find this article insightful and informative. If you enjoyed it, please consider sharing the link with your friends, family, and colleagues. If you have any suggestions or feedback, please feel free to leave a comment. And if you’d like to stay updated on my future content, please consider following and subscribing using the provided <a href="https://adityadaria.medium.com/subscribe"><strong>link</strong></a><strong>. </strong>Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd882a48690" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>