<?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 Saadat Khalid Awan on Medium]]></title>
        <description><![CDATA[Stories by Saadat Khalid Awan on Medium]]></description>
        <link>https://medium.com/@me.saadat?source=rss-70e9b977d088------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5NLTgpFf9oxAKrxhhjMamQ.png</url>
            <title>Stories by Saadat Khalid Awan on Medium</title>
            <link>https://medium.com/@me.saadat?source=rss-70e9b977d088------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:51:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@me.saadat/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[Python 101 Series Part 4 — Guide to Python Programming]]></title>
            <link>https://medium.com/@me.saadat/python-101-series-part-4-guide-to-python-programming-69e628e0c182?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/69e628e0c182</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Thu, 21 Nov 2024 05:25:18 GMT</pubDate>
            <atom:updated>2024-11-21T05:25:18.554Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python 101 Series Part 4 — Guide to Python Programming</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2PGRlVD0DpD408a1ZE9aw.png" /></figure><h3>Welcome to Part 4 of the Python 101 Series!</h3><p>If you’ve missed the previous parts, don’t worry. You can check out <a href="https://thesaadat.blogspot.com/2024/11/python-101-guide-to-python-programming.html"><strong>Part 1</strong></a>, <a href="https://thesaadat.blogspot.com/2024/11/python-101-series-part-2-guide-to.html"><strong>Part 2</strong></a>, and <a href="https://thesaadat.blogspot.com/2024/11/python-101-series-part-3-guide-to.html"><strong>Part 3</strong></a> to catch up.</p><p>In this blog, we’ll cover the following topics:</p><ul><li><strong>Lambda Functions</strong></li><li><strong>Exception Handling</strong></li><li><strong>File Handling</strong></li></ul><p>Let’s dive right in!</p><h3>1. Lambda Functions</h3><p>A <strong>lambda function</strong> is a small, anonymous function in Python. It can take multiple arguments but is restricted to a single expression. Lambda functions are often used for short-term tasks and are written in a single line.</p><p>lambda arguments: expression</p><pre># Adding 10 to a number<br>number = lambda num: num + 10<br>print(number(5))  # Output: 15<br><br># Multiplying two numbers<br>x = lambda a, b: a * b<br>print(x(5, 6))  # Output: 30</pre><h3>Exception Handling</h3><p>Exception handling ensures your program doesn’t crash when errors occur. Instead of abruptly stopping, Python allows you to handle errors gracefully and continue running the program.</p><h4>Key Components of Exception Handling:</h4><ol><li><strong>try</strong>: Tests a block of code for errors.</li><li><strong>except</strong>: Handles the error if one occurs.</li><li><strong>else</strong>: Executes code if no error occurs.</li><li><strong>finally</strong>: Executes code regardless of whether an error occurred or not.</li></ol><h4>Example: Basic Exception Handling</h4><pre>try:<br>    print(x)  # &#39;x&#39; is not defined<br>except:<br>    print(&quot;An exception occurred&quot;)  # Output: An exception occurred</pre><p><strong>Example:</strong> Handling Specific Errors</p><pre>try:<br>    print(x)<br>except NameError:<br>    print(&quot;Variable x is not defined&quot;)  # Output if NameError occurs<br>except:<br>    print(&quot;Something else went wrong&quot;)  # Output for other errors</pre><h4>Example: Using else</h4><p>The else block runs only when no error occurs in the try block.</p><pre>try:<br>    print(&quot;Hello&quot;)<br>except:<br>    print(&quot;Something went wrong&quot;)<br>else:<br>    print(&quot;Nothing went wrong&quot;)  # Output: Nothing went wrong</pre><h4>Example: Using finally</h4><p>The finally block runs no matter what.</p><pre>try:<br>    print(x)  # &#39;x&#39; is not defined<br>except:<br>    print(&quot;Something went wrong&quot;)<br>finally:<br>    print(&quot;The &#39;try except&#39; block is finished&quot;)  # Always executes</pre><h3>File Handling</h3><p>File handling allows you to <strong>create</strong>, <strong>read</strong>, <strong>write</strong>, <strong>append</strong>, and <strong>delete files</strong> in Python.</p><h4>Opening Files with open()</h4><p>The open() function is used to work with files. It requires two parameters:</p><ol><li><strong>Filename</strong>: The name of the file.</li><li><strong>Mode</strong>: Specifies the purpose (read, write, etc.).</li></ol><h4>File Modes:</h4><ul><li><strong>r</strong>: Read mode (Error if the file doesn’t exist).</li><li><strong>a</strong>: Append mode (Creates the file if it doesn’t exist).</li><li><strong>w</strong>: Write mode (Creates the file if it doesn’t exist).</li><li><strong>x</strong>: Create mode (Error if the file already exists).</li></ul><h4>Example: Reading a File</h4><pre>file = open(&quot;textfile.txt&quot;, &quot;r&quot;)<br>print(file.read())<br>file.close()  # Always close the file after working with it</pre><p><strong>Example:</strong> Appending to a File</p><pre>file = open(&quot;textfile.txt&quot;, &quot;a&quot;)<br>file.write(&quot;Now the file has more content!&quot;)<br>file.close()<br><br># Reading the updated file<br>file = open(&quot;textfile.txt&quot;, &quot;r&quot;)<br>print(file.read())</pre><h4>Example: Deleting a File</h4><p>To delete a file, you’ll need the os module.</p><pre>import os<br><br># Deleting a file<br>os.remove(&quot;textfile.txt&quot;)</pre><h3>Key Notes:</h3><ul><li>Always close files after working with them using file.close().</li><li>File handling errors can be managed using <strong>exception handling</strong> for a smoother workflow.</li></ul><p>That’s it for Part 4 of the <a href="https://thesaadat.blogspot.com/search/label/Python-101"><strong>Python 101 Series!</strong></a> Keep practicing these concepts to master them.</p><p>If you have any questions, drop them in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69e628e0c182" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 101 Series Part 3 — Guide to Python Programming]]></title>
            <link>https://medium.com/@me.saadat/python-101-series-part-3-guide-to-python-programming-4525061fa797?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/4525061fa797</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[computer-language]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[programming-for-beginners]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Tue, 19 Nov 2024 07:13:08 GMT</pubDate>
            <atom:updated>2024-11-19T07:13:08.334Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python 101 Series Part 3 — Guide to Python Programming</h3><figure><img alt="Python 101 Series Part 3 — Guide to Python Programming" src="https://cdn-images-1.medium.com/max/1024/1*421GIYpbSvyaJtgIlmxtRg.png" /></figure><h3>Welcome to Part 3 of the Python 101 Series!</h3><p>If you’ve missed <a href="https://thesaadat.blogspot.com/2024/11/python-101-guide-to-python-programming.html"><strong>Part 1</strong></a> or <a href="https://thesaadat.blogspot.com/2024/11/python-101-series-part-2-guide-to.html"><strong>Part 2</strong></a>, make sure to check them out to stay on track.</p><p>Today, we’ll explore <strong>Data Types</strong> in Python.</p><h3>Data Types in Python</h3><p>Python has several built-in data types for storing and managing data. This blog will cover four key data types: <strong>List</strong>, <strong>Tuple</strong>, <strong>Dictionary</strong>, and <strong>Set</strong>.</p><h4>1. Lists</h4><p>A <strong>list</strong> can hold multiple values in a single variable, and each value can be accessed using its <strong>index number</strong>. The index represents the position of an element in the list, starting from 0 and going up to the last element.</p><p>Lists are:</p><ul><li><strong>Ordered</strong>: Elements have a defined order that will not change unless explicitly modified.</li><li><strong>Changeable</strong>: You can add, remove, or update elements.</li><li><strong>Allow Duplicates</strong>: Lists can store duplicate values.</li></ul><p>Lists are created using square brackets []. They can hold elements of different data types, such as numbers, strings, or booleans.</p><pre>fruit_basket = [&quot;Apple&quot;, &quot;Banana&quot;, &quot;Mango&quot;, &quot;Orange&quot;, &quot;Pineapple&quot;]<br><br># Accessing elements using index numbers<br>print(fruit_basket[0])  # Output: Apple<br>print(fruit_basket[3])  # Output: Orange<br><br># Checking the length of the list<br>print(len(fruit_basket))  # Output: 5</pre><h4>2. Tuples</h4><p>A <strong>tuple</strong> is similar to a list, but unlike lists, <strong>tuples are immutable</strong>, meaning their elements cannot be changed, added, or removed after creation.</p><p>Tuples are:</p><ul><li><strong>Ordered</strong>: Like lists, tuples have a defined order.</li><li><strong>Unchangeable</strong>: Elements cannot be modified.</li></ul><p>Tuples are created using round brackets ().</p><p>Here’s an example of a tuple:</p><pre>my_fruit_tuple = (&quot;Apple&quot;, &quot;Banana&quot;, &quot;Mango&quot;, &quot;Orange&quot;, &quot;Pineapple&quot;)<br><br># Accessing elements using index numbers<br>print(my_fruit_tuple[0])  # Output: Apple<br>print(my_fruit_tuple[3])  # Output: Orange</pre><h4>3. Dictionaries</h4><p>A <strong>dictionary</strong> is a collection of key-value pairs, where each key is unique, and each key maps to a specific value.</p><p>Dictionaries are:</p><ul><li><strong>Ordered</strong> (Python 3.7+): Elements maintain insertion order.</li><li><strong>Changeable</strong>: You can add, update, or delete key-value pairs.</li><li><strong>Unique Keys</strong>: Duplicate keys are not allowed.</li></ul><p>Dictionaries are created using curly brackets {} and have the following structure: {Key: Value}</p><pre>student1 = {<br>    &quot;name&quot;: &quot;Saadat&quot;,<br>    &quot;roll_number&quot;: 2211,<br>    &quot;section&quot;: &quot;B&quot;,<br>}<br><br># Accessing values using keys<br>print(student1[&quot;name&quot;])  # Output: Saadat<br><br># Another example<br>my_car = {<br>    &quot;brand&quot;: &quot;Ford&quot;,<br>    &quot;model&quot;: &quot;Mustang&quot;,<br>    &quot;year&quot;: 1964<br>}<br><br>print(my_car[&quot;brand&quot;])  # Output: Ford</pre><h4>4. Sets</h4><p>A <strong>set</strong> is an unordered collection of unique elements. Sets do not allow duplicate values and cannot be accessed using an index since they are unordered.</p><p>Sets are:</p><ul><li><strong>Unordered</strong>: The elements have no defined order.</li><li><strong>Unchangeable</strong>: Although you cannot modify individual elements, you can add or remove elements.</li><li><strong>Unique Elements Only</strong>: Duplicate values are automatically removed.</li></ul><p>Sets are created using curly brackets {}.</p><pre>fruits_set = {&quot;Apple&quot;, &quot;Banana&quot;, &quot;Mango&quot;, &quot;Orange&quot;, &quot;Pineapple&quot;}<br><br># Displaying the set<br>print(fruits_set)<br><br># Note: Sets are unordered, so the output order may vary.</pre><p><strong>Bonus Tip:</strong> If you’re unsure about the type of a variable, use the type() function to check.</p><pre>print(type(fruit_basket))  # Output: &lt;class &#39;list&#39;&gt;<br>print(type(my_fruit_tuple))  # Output: &lt;class &#39;tuple&#39;&gt;<br>print(type(student1))  # Output: &lt;class &#39;dict&#39;&gt;<br>print(type(fruits_set))  # Output: &lt;class &#39;set&#39;&gt;</pre><p>Follow: <a href="http://x.com/@saadat_96">X</a> | <a href="https://www.facebook.com/Saadat.Khalid.Awan/">Facebook</a> | <a href="https://www.instagram.com/saadii_awan66/">Instagram</a> | <a href="https://www.linkedin.com/in/saadatawan/">Linkedin</a></p><p>These four data types are foundational to Python programming. Understanding their properties will help you choose the right one based on the problem you are solving. Stay tuned for the next part of this series, where we’ll dive deeper into Python programming!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4525061fa797" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A small guide on how to install and run Python on a PC]]></title>
            <link>https://medium.com/@me.saadat/a-small-guide-on-how-to-install-and-run-python-on-a-pc-c9448afc7356?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9448afc7356</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[how-to-install-python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Mon, 18 Nov 2024 06:23:31 GMT</pubDate>
            <atom:updated>2024-11-18T06:23:31.686Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A small guide on how to install and run Python on a PC" src="https://cdn-images-1.medium.com/max/1024/1*uAZ-A_2VnzWITsWhwo_xCA.png" /></figure><h3>How to Run Python on Your PC?</h3><p>To begin your Python learning journey, the first step is to install Python on your system. Follow these simple steps to get started:</p><ul><li>Open your browser and search for Download Python as shown in the image below. Click on the official link that appears.</li></ul><figure><img alt="download python — google search — Saadat Khalid" src="https://cdn-images-1.medium.com/max/979/1*RNIrymwGNnERvSemjd6s1Q.png" /></figure><ul><li>If you’re a Windows user, click on the <strong>Download Python</strong> button. For Linux or macOS users, select the appropriate option for your operating system.</li></ul><figure><img alt="python website" src="https://cdn-images-1.medium.com/max/1024/1*zI6UUSR9stEbrr_4U35r-Q.png" /></figure><ul><li>Once the setup file is downloaded, run the installer. Click on the <strong>Install Now</strong> option.</li></ul><p><strong>Note:</strong> Be sure to check the box for <strong>Add Python to PATH/Environment Variable</strong> during installation. This step is crucial to run Python from the command line.</p><p>If you face any issues, you can refer to the <a href="https://docs.python.org/3/using/windows.html">official Python documentation</a> for detailed instructions.</p><ul><li>After the installation is complete, open the command prompt (Windows) or terminal (Linux/macOS) and type python or python3. If Python is installed correctly, you should see the Python version and prompt appear.</li></ul><h3>Which IDE is Best for Python?</h3><p>An IDE (Integrated Development Environment) provides tools and features to help programmers write code more efficiently.</p><p>For Python, there are many popular IDEs to choose from, including:</p><ul><li>PyCharm</li><li>Visual Studio Code (VS Code)</li><li>Spyder</li><li>Atom</li><li>PyDev</li></ul><p>I recommend <strong>VS Code (Visual Studio Code)</strong> for its versatility and ease of use. You can download it <a href="https://code.visualstudio.com/download">here</a>.</p><h4>Setting Up Python in VS Code:</h4><ol><li>After installing VS Code, open it.</li><li>Install the <strong>Python Extension</strong>:</li></ol><ul><li>On the left sidebar, click on the Extensions icon (or press Ctrl + Shift + X).</li><li>Search for “Python” and install the extension.</li></ul><p>With this setup, you’re ready to write and execute Python code!</p><figure><img alt="Python Extension in VS Code" src="https://cdn-images-1.medium.com/max/370/1*fBkO--eM-7UNcRhljP_H_Q.png" /></figure><p><strong>Note:</strong> Python files have the .py extension. For example: file_name.py</p><p>Check out the next blog in this series to learn <a href="https://thesaadat.blogspot.com/2024/11/python-101-guide-to-python-programming.html"><strong>How to Write Your First Python Code</strong>!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9448afc7356" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 101 Series Part 2 — Guide to Python Programming]]></title>
            <link>https://medium.com/@me.saadat/python-101-series-part-2-guide-to-python-programming-4a1258f124c1?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a1258f124c1</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programing-language]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 15:05:10 GMT</pubDate>
            <atom:updated>2024-11-17T15:05:10.572Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python 101 Series Part 2 — Guide to Python Programming</h3><figure><img alt="PYthon — 101 — Guide to Python Programming part2 — Saadat Khalid Awan — Data Scientist" src="https://cdn-images-1.medium.com/max/1024/1*VWBQEg670qbGe53y6BeS2w.jpeg" /></figure><p>Welcome to the next blog in our <strong>Python 101 Blog Series</strong>! You can check this blog [<a href="https://thesaadat.blogspot.com/2024/11/python-101-guide-to-python-programming.html">Python 101 — Guide to Python Programming</a>] if you missed the first part.</p><h4>Let’s dive into the topic:</h4><h3>1. Operators in Python</h3><p>Today, we’ll explore <strong>Operators</strong>, which allow us to perform mathematical operations like addition, subtraction, multiplication, and more.</p><h4>1. Addition (+)</h4><p>Addition is used to add the numbers.</p><pre>print(5 + 5)  <br># Output: 10</pre><h4>2. Subtraction (-)</h4><p>Subtraction is used to calculate the difference between numbers.</p><pre>print(5 - 2)  <br># Output: 3</pre><h4>3. Multiplication (*)</h4><p>Multiplication gives the product of two numbers.</p><pre>print(5 * 5)  <br># Output: 25</pre><h4>4. Division (/)</h4><p>Division divides one number by another.</p><pre>print(10 / 2)  <br># Output: 5.0</pre><h4>5. Modulus (%)</h4><p>The modulus operator gives the remainder when one number is divided by another.</p><pre>print(10 % 3)  <br># Output: 1</pre><h4>6. Floor Division (//)</h4><p>Floor division gives the quotient, excluding the decimal part.</p><pre>print(10 // 3)  <br># Output: 3</pre><h4>7. Power ()**</h4><p>The power operator raises a number to the power of another.</p><pre>print(3 ** 2)  <br># Output: 9</pre><h3>Complex Expressions</h3><p>In Python, expressions are evaluated using the <strong>PEMDAS</strong> rule:</p><ul><li><strong>P</strong>arentheses</li><li><strong>E</strong>xponents</li><li><strong>M</strong>ultiplication</li><li><strong>D</strong>ivision</li><li><strong>A</strong>ddition</li><li><strong>S</strong>ubtraction</li></ul><p>It evaluates from <strong>left to right</strong> for operators of the same precedence.</p><pre>print(3**2 / 2 * 3 / 3 + 6 - 4)  <br># Output: 7.5</pre><h3>2. Strings</h3><p>Strings are text enclosed in single, double, or triple quotes.</p><pre>print(&#39;Single Quotes&#39;)  <br>print(&quot;Double Quotes&quot;)  <br>print(&#39;&#39;&#39;Triple Quotes&#39;&#39;&#39;)</pre><blockquote><strong>Task:</strong> How to write this: <em>Hello, What’s up?</em></blockquote><h3>3. Variables</h3><p>Variables are containers that hold data. Python automatically determines the type of a variable based on its value.</p><pre>number = 10  <br># Here, the value 10 is assigned to the variable `number`.</pre><h4>Types of Variables</h4><ul><li><strong>Numeric:</strong> Numbers like 10 or 3.14</li><li><strong>String:</strong> Text like “Hello”</li><li><strong>Boolean:</strong> True or False</li></ul><h4>Bonus: Check a variable’s type using the type() function:</h4><pre>print(type(number))  <br># Output: &lt;class &#39;int&#39;&gt;</pre><h4>Rules for Naming Variables</h4><ol><li>Use letters, numbers, or underscores.</li><li>Don’t start with a number.</li><li>Avoid reserved keywords like if, else, etc.</li><li>Don’t use spaces in variable names.</li></ol><h3>4. Input Variables</h3><p>Input variables allow us to take user input and store it in a variable.</p><pre>name = input(&quot;What is your name? &quot;)  <br>greeting = &quot;Hello&quot;  <br>print(greeting, name)  <br># If the user enters &quot;Saadat&quot;, the output will be: Hello Saadat</pre><p>Note: The input() function always returns a string. Convert it to another type if needed.</p><h3>5. Conditional Operators</h3><p>Conditional operators are used to compare values.</p><pre>print(10 == 10)  # Equal to  <br>print(10 != 5)   # Not equal to  <br>print(10 &lt; 15)   # Less than  <br>print(10 &gt; 5)    # Greater than  <br>print(10 &gt;= 10)  # Greater than or equal to  <br>print(10 &lt;= 20)  # Less than or equal to</pre><p>Simple Program:</p><pre>age_of_student = 4  <br>required_age_at_school = 5  <br>print(age_of_student &gt;= required_age_at_school)  <br># Output: False</pre><h3>6. Type Conversion</h3><p>Type conversion is used to convert a variable from one type to another.</p><h4>Implicit Conversion</h4><p>Python does this automatically where possible.</p><pre>x = 10 + 2.5  <br>print(type(x))  <br># Output: &lt;class &#39;float&#39;&gt;</pre><h4>Explicit Conversion</h4><p>You can convert types manually using int(), float(), or str().</p><pre>age = input(&quot;Enter your age: &quot;)  <br>age = int(age)  # Converts the string input into an integer</pre><h3>7. If, Else, and Elif Statements</h3><p>These are used to check conditions in your program. If the condition is `True` the block of code under the if will execute, if the condition is `False` then the else part will be executed. The elif is used where you need to add extra conditions.</p><pre>if student_score &gt;= 60:  <br>    print(&quot;Congrats! You passed.&quot;)  <br>elif student_score == 50:  <br>    print(&quot;You barely passed. Work harder!&quot;)  <br>else:  <br>    print(&quot;You failed. Better luck next time!&quot;)</pre><h3>8. Loops</h3><p>Loops are used to repeat a block of code. The loop will execute until the condition/limit is hit.</p><p>There are two types of loops `while` and `for`.</p><p><strong>while loop:</strong></p><pre>x = 1  <br>while x &lt;= 10:  <br>    print(x)  <br>    x += 1</pre><p><strong>for loop:</strong></p><pre>for x in range(1, 11):  <br>    print(x)</pre><p><strong>Breaking a loop:</strong></p><pre>fruits = [&#39;Apple&#39;, &#39;Banana&#39;, &#39;Orange&#39;, &#39;Mango&#39;]  <br>for fruit in fruits:  <br>    print(fruit)  <br>    if fruit == &#39;Orange&#39;:  <br>        break</pre><h3>9. Functions</h3><p>Functions are blocks of code designed to perform specific tasks.</p><h4>Built-in Functions:</h4><p>Examples: print(), type(), len()</p><p><strong>User-Defined Functions:</strong></p><pre>def greet(name):  <br>    print(&quot;Hello&quot;, name)  <br><br>greet(&quot;Saadat&quot;)  <br># Output: Hello Saadat</pre><h3>10. Importing Libraries</h3><p>Libraries extend Python’s capabilities. Examples: math, statistics, sklearn.</p><pre>import math  <br>import statistics  <br><br>print(&quot;Value of Pi:&quot;, math.pi)  <br>numbers = [10, 20, 30, 40]  <br>print(&quot;Average:&quot;, statistics.mean(numbers))</pre><p>Follow: <a href="http://x.com/@saadat_96">X</a> | <a href="https://www.facebook.com/Saadat.Khalid.Awan/">Facebook</a> | <a href="https://www.instagram.com/saadii_awan66/">Instagram</a> | <a href="https://www.linkedin.com/in/saadatawan/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a1258f124c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 101 — Guide to Python Programming]]></title>
            <link>https://medium.com/@me.saadat/python-101-guide-to-python-programming-3dfe58acc8a4?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dfe58acc8a4</guid>
            <category><![CDATA[intro-to-programming]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Sat, 16 Nov 2024 07:21:30 GMT</pubDate>
            <atom:updated>2024-11-16T07:21:30.732Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python 101 — Guide to Python Programming</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JEDaFy3wljeV8GEtllfH5Q.png" /></figure><h3>Python 101 Blog Series</h3><h4>What is Python?</h4><p>Python is a versatile and widely-used programming language created by <strong>Guido van Rossum</strong> and first released in 1991. Known for its simplicity and readability, Python feels as intuitive as the English language. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming.</p><p>Python is cross-platform, meaning it works seamlessly on <strong>Windows</strong>, <strong>Mac</strong>, <strong>Linux</strong>, and even <strong>Raspberry Pi</strong>.</p><h4>What Can Python Be Used For?</h4><p>Python is a multipurpose language, powering applications in diverse fields such as:</p><ul><li><strong>Software Development</strong></li><li><strong>Web Development</strong></li><li><strong>Mobile App Development</strong></li><li><strong>Game Development</strong></li><li><a href="https://thesaadat.blogspot.com/search/label/Data-Science"><strong>Data Science</strong></a></li><li><a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html"><strong>Machine Learning &amp; Artificial Intelligence</strong></a></li><li><strong>Task Automation</strong></li><li><strong>Building Bots</strong></li></ul><p>Its versatility and extensive libraries make it a top choice for beginners and experts alike!</p><p><a href="https://medium.com/@me.saadat/subscribe">https://medium.com/@me.saadat/subscribe</a></p><blockquote>01# First Python Program: print()</blockquote><p>The print() function is one of the most basic yet powerful features of Python. It’s used to display output on the screen, whether it’s the result of a calculation or a message wrapped in single or double quotes.</p><p>Below are a few examples to help you get started:</p><p><strong>Example #1: Simple Math</strong></p><pre>print(2 + 3)  <br># This will display the sum of 2 and 3, which is 5.</pre><p>Example #2: Hello, World!</p><pre>print(&quot;Hello, World!&quot;)  <br># The classic first program that every new programmer writes.</pre><p>Example #3: Using Single and Double Quotes</p><pre>print(&quot;I&#39;m learning Python with &#39;Saadat&#39;&quot;)  <br># Single quotes can be used inside double quotes without escaping.</pre><p>Example #4: Printing Multiple Arguments</p><pre>print(&quot;Hello&quot;, &quot;how are you?&quot;)  <br># Outputs: Hello how are you? (notice the space between the arguments)</pre><p><strong>Bonus Tip</strong>:<br>You can customize the behavior of print() using its parameters:</p><pre>print(&quot;Hello&quot;, &quot;World&quot;, sep=&quot;-&quot;, end=&quot;!&quot;)<br># Outputs: Hello-World!</pre><h3>Next Steps</h3><p>Now that you’ve learned how to use the print() function, start experimenting with your own variations. Try printing numbers, strings, or even emojis!</p><p>Start your Python journey today and stay tuned for the next blog in the <a href="https://thesaadat.blogspot.com/search/label/Python-101"><strong>Python 101 Blog Series</strong>!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dfe58acc8a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to Support Vector Machine— Supervised Machine Learning]]></title>
            <link>https://medium.com/@me.saadat/an-introduction-to-support-vector-machine-supervised-machine-learning-aa03c6073568?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa03c6073568</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[support-vector-machine]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Thu, 18 Jul 2024 09:23:57 GMT</pubDate>
            <atom:updated>2024-07-18T09:23:57.049Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLR0Qp6mWjKOAQCXuMzFuw.png" /></figure><h3>Support Vector Machine</h3><p>Support Vector Machine (SVM) is a s<a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html">upervised machine learning</a> algorithm used for <a href="https://thesaadat.blogspot.com/2024/07/what-is-classification-and-regression.html">regression, classification</a>, and outlier detection problems. It is widely used for classification problems, known as Support Vector Classifier (SVC), and for regression problems, known as Support Vector Regression (SVR). The term “vectors” refers to the data points that help in creating the boundary between classes. These boundaries are defined near the extreme data points, which are called support vectors.</p><p>SVM uses a hyperplane that acts as a boundary to separate data points from one class to another. This hyperplane is based on the features of the data. If there are two features, the hyperplane is a straight line; if there are three features, the plane would be 2D.</p><h4>Types of SVM:</h4><ol><li><strong>Linear SVM</strong>: Used when the data is linearly separable by a straight line.</li><li><strong>Non-Linear SVM</strong>: Used when the data is not linearly separable.</li></ol><p><strong>Key Terms:</strong></p><ul><li><strong>Hyperplane</strong>: The line or plane that acts as a separator between different classes.</li><li><strong>Support Vectors</strong>: The data points that are closest to the hyperplane and influence its position.</li><li><strong>Margins</strong>: The distance between the support vectors and the hyperplane.</li></ul><pre># importing the libraries<br>import pandas as pd<br>import numpy as np<br>from sklearn.model_selection import train_test_split<br>from sklearn.svm import SVC, SVR<br>from sklearn.metrics import accuracy_score, mean_squared_error<br><br># import the dataset<br>df = pd.read_csv(&quot;dataset.csv&quot;)<br><br># Separating X - Features and y - Target<br>X = df.drop(&quot;target&quot;, axis=1)<br>y = df[&quot;target&quot;]<br><br># Train and Test Split<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<br><br># SVC model<br>svc_model = SVC()<br>svc_model.fit(X_train, y_train)<br>y_pred_svc = svc_model.predict(X_test)<br>accuracy = accuracy_score(y_test, y_pred_svc)<br>print(f&quot;The Accuracy for SVC is: {accuracy}&quot;)<br><br># SVR model<br>svr_model = SVR()<br>svr_model.fit(X_train, y_train)<br>y_pred_svr = svr_model.predict(X_test)<br>mse = mean_squared_error(y_test, y_pred_svr)<br>print(f&quot;The Mean Squared Error for SVR is: {mse}&quot;)</pre><p>Ready to dive deeper into the world of Data Science? <a href="https://medium.com/@me.saadat/subscribe">Join me</a> as we explore essential topics like <a href="https://thesaadat.blogspot.com/2024/06/unlock-power-of-exploratory-data.html">Exploratory Data Analysis (EDA)</a>, <a href="https://www.upwork.com/services/product/development-it-exploratory-data-analysis-eda-in-python-uncover-insights-and-trends-1794697571088322243?ref=project_share">Data Visualization</a>, and building powerful <a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html">Machine Learning</a> models. <a href="https://thesaadat.blogspot.com/">Subscribe to my blog</a> for the latest tutorials, insights, and practical tips.</p><p>Follow: <a href="http://x.com/@saadat_96">X</a> | <a href="https://www.facebook.com/Saadat.Khalid.Awan/">Facebook</a> | <a href="https://www.instagram.com/saadii_awan66/">Instagram</a> | <a href="https://www.linkedin.com/in/saadatawan/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa03c6073568" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to Logistic Regression — Supervised Machine Learning]]></title>
            <link>https://medium.com/@me.saadat/an-introduction-to-logistic-regression-supervised-machine-learning-bbdc73d2635d?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbdc73d2635d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[classification-algorithms]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Wed, 17 Jul 2024 12:41:32 GMT</pubDate>
            <atom:updated>2024-07-17T12:41:32.843Z</atom:updated>
            <content:encoded><![CDATA[<h3>An Introduction to Logistic Regression — Supervised Machine Learning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ToOjqBGQAYk8EMKl8rUz2w.png" /></figure><h3>Logistic Regression</h3><p>Logistic Regression is a type of <a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html">supervised machine learning</a> algorithm used for binary <a href="https://thesaadat.blogspot.com/2024/07/what-is-classification-and-regression.html">classification</a> tasks. It predicts the outcome based on probability, for example, the probability of a coin toss resulting in heads or tails, which is 50% for each. The probability ranges from 0 to 1. Logistic regression uses these probabilities to classify outcomes.</p><h4>How Logistic Regression Works</h4><p>Logistic regression uses the “Sigmoid Function” function to predict probabilities. In a binary classification problem, there are two classes (outputs), such as 0 and 1, True and False, Male and Female, or Patient vs. Healthy. The probability for a class is either 0 or 1, with a threshold of 0.5. If the probability is below 0.5, the class is 0; if it is 0.5 or above, the class is 1.</p><p>Simply put, logistic regression uses the “Sigmoid” function, which is an S-shaped curve, to map the predicted values into discrete classes.</p><h4>Use Cases for Logistic Regression:</h4><ol><li>Binary Classification</li><li>Multiclass Classification</li><li>One-vs-Rest Classification</li></ol><h4>Advantages of Logistic Regression:</h4><ol><li>Simple and easy to implement</li><li>Works well with linearly separable data</li><li>It does not require high computational power</li></ol><h4>Assumptions to Meet:</h4><ol><li>The independent variables (features) must be independent.</li><li>The dependent variable (target) must be categorical.</li><li>There should be no outliers.</li><li>There should be no high correlation between the independent variables.</li></ol><h3>Types of Logistic Regression</h3><ol><li><strong>Binary Logistic Regression</strong>:</li></ol><ul><li><strong>Purpose</strong>: Used for binary classification tasks with only two possible outcomes.</li><li><strong>Examples</strong>: Predicting whether an email is spam or not (0 and 1), determining if a patient is healthy or has a disease (True or False).</li></ul><p><strong>2. Multinomial Logistic Regression</strong>:</p><ul><li><strong>Purpose</strong>: Used for multiclass classification tasks with more than two possible outcomes.</li><li><strong>Examples</strong>: Classifying types of flowers into species like Setosa, Versicolour, and Virginica.</li></ul><p><strong>3. Unordered Logistic Regression</strong>:</p><ul><li><strong>Purpose</strong>: Used for classification tasks where the classes are not ordered.</li><li><strong>Examples</strong>: Categorizing types of fruits into apples, oranges, and bananas, where the categories have no inherent order.</li></ul><p><strong>4. Ordinal Logistic Regression</strong>:</p><ul><li><strong>Purpose</strong>: Used for classification tasks where the classes have a natural order.</li><li><strong>Examples</strong>: Classifying customer satisfaction levels into high, medium, and low.</li></ul><h3>Logistic Regression Implementaion</h3><pre># Importing libraries<br>import pandas as pd<br>import numpy as np<br>from sklearn.model_selection import train_test_split<br>from sklearn.linear_model import LogisticRegression<br>from sklearn.metrics import accuracy_score<br><br># Importing our dataset<br>df = pd.read_csv(&quot;dataset.csv&quot;)<br><br># Separate X (independent variables aka features) and y (dependent variable aka target)<br>X = df.drop(&#39;target&#39;, axis=1)<br>y = df[&#39;target&#39;]<br><br># Splitting the data into training and testing sets<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<br><br># Initializing the model<br>lr = LogisticRegression()<br><br># Training the model<br>lr.fit(X_train, y_train)<br><br># Making predictions<br>y_pred = lr.predict(X_test)<br><br># Calculating accuracy<br>accuracy = accuracy_score(y_test, y_pred)<br>print(&#39;Accuracy:&#39;, accuracy)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Weaalw88QudIJvdU8zjnWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5SmgjTr69mOId6SOpCXN-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HvyZepADe4h-fjQzX7rf1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kH1HfIEYR3oROHBgqVGGWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TL-xNg20l-o2ehh0QsuF3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3vDKmetxeLY0B_x0YS60MA.png" /></figure><p>Ready to dive deeper into the world of Data Science? <a href="https://medium.com/@me.saadat/subscribe">Join me</a> as we explore essential topics like <a href="https://thesaadat.blogspot.com/2024/06/unlock-power-of-exploratory-data.html">Exploratory Data Analysis (EDA)</a>, <a href="https://www.upwork.com/services/product/development-it-exploratory-data-analysis-eda-in-python-uncover-insights-and-trends-1794697571088322243?ref=project_share">Data Visualization</a>, and building powerful <a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html">Machine Learning</a> models. <a href="https://thesaadat.blogspot.com/">Subscribe to my blog</a> for the latest tutorials, insights, and practical tips.</p><p>Follow: <a href="http://x.com/@saadat_96">X</a> | <a href="https://www.facebook.com/Saadat.Khalid.Awan/">Facebook</a> | <a href="https://www.instagram.com/saadii_awan66/">Instagram</a> | <a href="https://www.linkedin.com/in/saadatawan/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbdc73d2635d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Classification and Regression in Supervised Machine Learning?]]></title>
            <link>https://medium.com/@me.saadat/what-is-classification-and-regression-in-supervised-machine-learning-e2004951eb64?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2004951eb64</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[machine-intelligence]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 10:34:14 GMT</pubDate>
            <atom:updated>2024-07-18T09:28:43.561Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*51jOvV9PpDydIM7IsY4MRQ.png" /></figure><p>The topic is <a href="https://thesaadat.blogspot.com/2024/07/what-is-classification-and-regression.html">classification and regression</a>, which are types of supervised <a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html">machine learning</a>. In supervised machine learning, we have labeled data, meaning the input data is mapped with the correct output, known as the label.</p><p>We come across two types of problems in supervised machine learning:</p><ol><li><strong>Classification</strong></li><li><strong>Regression</strong></li></ol><h4>Classification</h4><p>Classification is a type of machine learning where the output (label) is a categorical value. To better understand classification, consider the example of heart disease data. In the heart patient data, if a patient has a heart problem, they will be labeled as a patient, whereas a patient with no heart problem will be classified as Healthy.</p><p>Classification can involve two categories or multiple categories, which is known as a multi-class classification problem. For example, we can categorize patient conditions from Healthy to Critical:</p><ol><li>Healthy</li><li>Minor Problem</li><li>Critical</li></ol><p>In this classification of heart data, Healthy, Minor Problem, and Critical are the classes (categories).</p><p>So, in classification, the machine learns from the input and output, and upon feeding new data, it classifies the new data based on its learning as Healthy or Critical.</p><p><strong>Other examples of classification include:</strong></p><ol><li><strong>Email Spam Classification</strong>: Classifying an email as spam or not.</li><li><strong>Customer Churn</strong>: Determining if a customer will churn or not.</li><li><strong>Iris Flower Classification</strong>: The famous example of classifying iris flowers into different species.</li></ol><p><a href="https://medium.com/@me.saadat/subscribe">Get an email whenever Saadat Awan publishes.</a></p><p>We have different kinds of algorithms that deal with classification problems. I’ll write a blog on each of these algorithms:</p><ol><li><a href="https://thesaadat.blogspot.com/2024/07/an-introduction-to-logistic.html">Logistic Regression</a></li><li><a href="https://thesaadat.blogspot.com/2024/07/an-introduction-to-support-vector.html">Support Vector Machines</a></li><li>Decision Trees</li><li>Random Forest</li><li>Naive Bayes</li><li>K-Nearest Neighbors (KNN) models</li></ol><h4>Regression</h4><p>Regression is another type of supervised machine learning where the output is a continuous value, such as price (PKR, DOLLAR) or weight. Regression is used when the data output is numerical, like predicting house prices. The dataset has different inputs with corresponding outputs as the house price. The machine learns from the data, and upon receiving new input values, it predicts the house price.</p><p>Another common example of a regression problem is stock price prediction or cryptocurrency price prediction.</p><p><strong>Some common regression algorithms are:</strong></p><ol><li>Linear Regression</li><li>Polynomial Regression</li><li><a href="https://thesaadat.blogspot.com/2024/07/an-introduction-to-support-vector.html">Support Vector Machine Regression</a></li><li>Decision Tree Regression</li></ol><p>Ready to dive deeper into the world of Data Science? <a href="https://medium.com/@me.saadat/subscribe">Join me</a> as we explore essential topics like <a href="https://thesaadat.blogspot.com/2024/06/unlock-power-of-exploratory-data.html">Exploratory Data Analysis (EDA)</a>, <a href="https://www.upwork.com/services/product/development-it-exploratory-data-analysis-eda-in-python-uncover-insights-and-trends-1794697571088322243?ref=project_share">Data Visualization</a>, and building powerful <a href="https://thesaadat.blogspot.com/2024/07/understanding-machine-learning-types.html">Machine Learning</a> models. <a href="https://thesaadat.blogspot.com/">Subscribe to my blog</a> for the latest tutorials, insights, and practical tips.</p><p>Follow: <a href="http://x.com/@saadat_96">X</a> | <a href="https://www.facebook.com/Saadat.Khalid.Awan/">Facebook</a> | <a href="https://www.instagram.com/saadii_awan66/">Instagram</a> | <a href="https://www.linkedin.com/in/saadatawan/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2004951eb64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Machine Learning: Types, Applications, and How It Works]]></title>
            <link>https://medium.com/@me.saadat/understanding-machine-learning-types-applications-and-how-it-works-cea557291079?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/cea557291079</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 14:19:24 GMT</pubDate>
            <atom:updated>2024-07-15T14:19:24.295Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e51i5Vru-YdBDT1beJ0nfg.png" /></figure><h3>What is Machine Learning?</h3><p>Machine Learning (ML) is a fascinating and rapidly growing field of study where computers can learn without being explicitly programmed. As the name suggests, ML gives machines the human-like ability to adapt and learn from experience. In ML, machines learn from past data fed into them. By analyzing this data, they can identify features and patterns. When new data is provided, the machine uses the knowledge it has gained to make predictions or decisions based on those features and patterns it has already seen during training.</p><h3>Types of Machine Learning</h3><p>There are four main types of machine learning:</p><ol><li><strong>Supervised Machine Learning</strong></li><li><strong>Unsupervised Machine Learning</strong></li><li><strong>Semi-Supervised Machine Learning</strong></li><li><strong>Reinforcement Learning</strong></li></ol><h3>Supervised Machine Learning</h3><p>The data provided to train the model is labeled in supervised machine learning. This means that for each input, there is a corresponding known output or label. The machine learning model learns the relationship between the inputs and their labels by analyzing the labeled training data. Once trained, the model can then take new, unlabeled data as input and predict the corresponding output labels.</p><p>For example, consider a dataset of fruit characteristics like color, size, and shape, with each data point labeled with the fruit type (e.g., “apple,” “orange,” “banana”). A supervised machine learning model trained on this data could then take new fruit characteristics as input and predict the fruit type as the output label.</p><p><a href="https://medium.com/@me.saadat/subscribe">Get an email whenever Saadat Awan publishes.</a></p><h3>Unsupervised Machine Learning</h3><p>In unsupervised machine learning, the machine learns from patterns and relationships within unlabeled data. Unlike supervised learning, where the data has labeled inputs and outputs, unsupervised learning deals with data that has no labels. The machine must identify hidden patterns, and similarities, or group the data based on similar features.</p><p>Example: Suppose you have a dataset of fruits with no labels indicating which fruit is which. Using unsupervised learning, the algorithm analyzes the features of the fruits and groups them based on similarities. It then creates clusters of the same fruits, such as Cluster A for one type of fruit, Cluster B for another, and so on.</p><h3>Semi-Supervised Machine Learning</h3><p>As the name suggests, semi-supervised machine learning operates between supervised and unsupervised learning paradigms. In semi-supervised learning, the dataset is partially labeled, meaning some data points have labels while others do not. This approach is particularly useful when obtaining labeled data is costly, time-consuming, or resource-intensive.</p><p>Semi-supervised learning predicts the labels of unlabeled data based on patterns and structures in the dataset. Once these labels are predicted, they can be utilized in supervised machine-learning techniques for further refinement and model training. This hybrid approach effectively leverages both labeled and unlabeled data to enhance predictive accuracy and optimize resource utilization in machine learning tasks.</p><h3>Reinforcement Learning (RL)</h3><p>Reinforcement Learning is a type of machine learning where models mimic the human behavior of trial-and-error learning to achieve better results. A reinforcement learning agent can perceive and interpret its environment, take actions, and learn through the process of trial and error. When the agent achieves a desirable outcome, it receives a reward; in the case of an undesirable outcome, it gets a punishment. This feedback loop helps the agent improve its decision-making over time.</p><p>Example: Computer Games like Chess.</p><p>Ready to dive deeper into the world of Data Science? <a href="https://medium.com/@me.saadat/subscribe">Join me</a> as we explore essential topics like <a href="https://www.fiverr.com/s/5rA8Emz">Exploratory Data Analysis (EDA)</a>, <a href="https://www.upwork.com/services/product/development-it-exploratory-data-analysis-eda-in-python-uncover-insights-and-trends-1794697571088322243?ref=project_share">Data Visualization</a>, and building powerful Machine Learning models. <a href="https://thesaadat.blogspot.com/">Subscribe to my blog</a> for the latest tutorials, insights, and practical tips.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cea557291079" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Data Analysis? Understanding Its Importance and Process and Types of Data Analysis]]></title>
            <link>https://medium.com/@me.saadat/what-is-data-analysis-understanding-its-importance-and-process-and-types-of-data-analysis-2a1d8f8a1757?source=rss-70e9b977d088------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a1d8f8a1757</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Saadat Khalid Awan]]></dc:creator>
            <pubDate>Fri, 28 Jun 2024 12:12:30 GMT</pubDate>
            <atom:updated>2024-07-05T06:58:53.731Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PCxcYsu-k1TvfJ78pXpwSA.png" /></figure><h3>What is Data Analysis?</h3><p>In the digital age, data is ubiquitous. However, this data often exists in a raw, unstructured form that is not immediately useful. Data analysis is the process of systematically processing and transforming this data to extract meaningful insights. By applying statistical, mathematical, or computational techniques to datasets, data analysis uncovers patterns, trends, and correlations hidden within the raw data.</p><h3>The Data Analysis Process</h3><p>The <a href="https://www.upwork.com/services/product/development-it-exploratory-data-analysis-eda-in-python-uncover-insights-and-trends-1794697571088322243?ref=project_share">data analysis</a> process typically involves several key steps:</p><ol><li><strong>Inspecting the Data</strong>: Reviewing the raw data to understand its structure and content.</li><li><strong>Cleaning and Transforming the Data</strong>: Preparing the data for analysis by handling missing values, outliers, and other anomalies.</li><li><strong>Modeling the Data</strong>: Applying statistical or computational models to identify patterns and relationships.</li><li><strong>Extracting Insights and Drawing Conclusions</strong>: Interpreting the results to make informed decisions.</li></ol><p>Through this process, analysts can turn raw data into valuable information that supports strategic decision-making.</p><h3>Data Analysis: The Key to Informed Decision-Making</h3><p><a href="https://www.upwork.com/services/product/development-it-data-analysis-and-visualization-using-python-1795018639026368275?ref=project_share">Data analysis is crucial for effective decision-making</a>. It provides valuable insights that help organizations develop strategic plans, identify opportunities, and improve their operations. For instance, if you are planning to develop an Android app, data analysis can be invaluable. By analyzing data from the Google Play Store, a data scientist can identify the top-performing app categories, the types of apps that get the most downloads and views, and other relevant insights. This information can guide your app development strategy and help you make informed decisions about the best opportunities to pursue.</p><p>More broadly, data analysis helps reduce risks and solve problems. By collecting and examining relevant data, you can gain a deeper understanding of your market, your customers, and your own business performance. This knowledge empowers you to make well-informed decisions that drive growth and success. Whether you’re launching a new product, optimizing your marketing strategy, or exploring new business opportunities, data analysis should be a crucial part of your decision-making process. By leveraging the power of data, you can ensure that your strategic plans are grounded in reality and positioned for maximum impact.</p><p>In conclusion, data analysis is an essential tool for any organization that wants to make informed, data-driven decisions. By investing in data analysis capabilities, you can unlock valuable insights, minimize risks, and position your business for long-term success.</p><h3>Types of Data Analysis</h3><h4>1. Descriptive Analysis</h4><p>Descriptive Analysis is the first step of data analysis. It focuses on summarizing and presenting past data to understand “What happened?” By looking at past data, organizations can make informed decisions for the future. For example, suppose you run a perfume shop and record each sale throughout the month. At the end of the month, a data scientist can analyze this sales data to determine which perfumes are in stock, which are out of stock, and which ones had the most sales. Based on this analysis, you can order more stock of the best-selling perfumes in larger quantities.</p><h4>2. Diagnostic Analysis</h4><p>After understanding the “what” through Descriptive Analysis, Diagnostic Analysis dives deeper to investigate the underlying causes. It explores the “why” behind the insights, uncovering the cause-and-effect relationships that led to the observed outcomes. By understanding the reasons and drivers, we can develop more informed solutions to address the identified issues.</p><h4>3. Predictive Analysis</h4><p>The third type of data analysis is “Predictive,” which relates to forecasting future events. Predictive analysis utilizes past data to make informed predictions about what is likely to happen in the future. For example, if you own a perfume shop, you can analyze past sales data to identify which perfumes sold the most. Using data science techniques, you can then predict which perfumes are likely to be popular in the coming month. This approach helps in making data-driven decisions to optimize inventory and sales strategies.</p><h4>4. Prescriptive Analysis</h4><p>In the final step of our data journey, Prescriptive Analysis takes center stage. After harnessing insights from past data, it’s time to chart the course forward with decisive action. This phase is all about implementing the best strategies to achieve optimal outcomes. Prescriptive analysis uses the insights gained from previous analysis phases to recommend specific actions that will drive success.</p><blockquote><em>If you found this article helpful, be sure to follow me for more insights on Data Analysis and other data science topics.</em></blockquote><blockquote><em>And if you need a data scientist to help with your projects, don’t hesitate to </em><a href="https://www.linkedin.com/in/saadatawan/"><em>connect with me on LinkedIn</em></a><em>. I’d be happy to discuss how I can assist you in unlocking the power of your data.</em></blockquote><h3>Conclusion</h3><blockquote>Data analysis is an indispensable tool in today’s data-driven world. By understanding and applying the different types of data analysis, organizations can make informed decisions that drive growth, optimize operations, and achieve strategic objectives. Whether you are just starting with data analysis or looking to refine your existing processes, the insights gained from data can transform your business and pave the way for success.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a1d8f8a1757" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>