<?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 Haroon khan on Medium]]></title>
        <description><![CDATA[Stories by Haroon khan on Medium]]></description>
        <link>https://medium.com/@hk4897286?source=rss-af2707393e11------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5TMmq1EvVH2JQzKe3cZdWw.jpeg</url>
            <title>Stories by Haroon khan on Medium</title>
            <link>https://medium.com/@hk4897286?source=rss-af2707393e11------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:44:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hk4897286/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[What is Python? A Comprehensive Guide to Its Role in AI and Machine Learning]]></title>
            <link>https://medium.com/@hk4897286/what-is-python-a-comprehensive-guide-to-its-role-in-ai-and-machine-learning-2432cebcfbd7?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/2432cebcfbd7</guid>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[cv]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[dl]]></category>
            <category><![CDATA[mlops]]></category>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 12:16:32 GMT</pubDate>
            <atom:updated>2024-08-17T12:16:32.449Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Python? A Comprehensive Guide to Its Role in AI and Machine Learning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oz7QX0CM7ZB_5FGTXp310Q.png" /></figure><h3>Introduction</h3><p>Python is one of the most popular programming languages in the world, and for good reason. It’s known for its simplicity, readability, and versatility, making it a favorite among developers, data scientists, and AI engineers alike. But what exactly is Python, and why has it become the go-to language for artificial intelligence (AI) and machine learning (ML)?</p><p>In this article, we’ll explore the fundamentals of Python, its unique features, and how it’s used in AI and ML. Whether you’re new to programming or looking to deepen your understanding of Python’s role in the AI field, this guide will provide you with the insights you need.</p><h3>What is Python?</h3><p>Python is a high-level, interpreted programming language created by Guido van Rossum and first released in 1991. It was designed with simplicity in mind, allowing developers to write clear and logical code for small and large-scale projects.</p><p>Key features of Python include:</p><ul><li><strong>Readability:</strong> Python’s syntax is clean and easy to understand, making it accessible to beginners.</li><li><strong>Versatility:</strong> Python can be used for web development, data analysis, automation, scripting, and more.</li><li><strong>Community Support:</strong> With a large and active community, Python offers extensive libraries and frameworks that simplify complex tasks.</li></ul><h3>Why Python is Popular in AI and Machine Learning</h3><p>Python’s popularity in AI and machine learning can be attributed to several factors:</p><ol><li><strong>Ease of Learning and Use:</strong> Python’s simple syntax allows developers to focus on solving problems rather than getting bogged down by complex code. This is especially important in AI, where understanding algorithms and models is critical.</li><li><strong>Rich Ecosystem of Libraries:</strong> Python boasts a vast array of libraries and frameworks that simplify AI and ML development. Libraries like TensorFlow, PyTorch, Scikit-Learn, and Keras provide pre-built functions for building and training AI models.</li><li><strong>Flexibility:</strong> Python can be integrated with other languages like C, C++, and Java, allowing for flexibility in AI development. This makes it suitable for both research and production environments.</li><li><strong>Community and Support:</strong> Python has a strong community of AI and ML developers who contribute to open-source projects, share knowledge, and provide support through forums, tutorials, and conferences.</li></ol><h3>Python Libraries for AI and Machine Learning</h3><p>Here are some of the most popular Python libraries used in AI and ML:</p><ol><li><strong>TensorFlow:</strong> Developed by Google, TensorFlow is an open-source library for building and training deep learning models. It provides tools for creating neural networks and deploying them in production.</li><li><strong>PyTorch:</strong> Created by Facebook’s AI Research lab, PyTorch is known for its dynamic computational graph, which allows developers to build and modify neural networks on the go. It’s popular for research and experimentation.</li><li><strong>Scikit-Learn:</strong> A powerful library for traditional machine learning algorithms like decision trees, k-nearest neighbors, and support vector machines. It’s great for tasks like classification, regression, and clustering.</li><li><strong>Keras:</strong> A high-level neural networks API that runs on top of TensorFlow, Keras simplifies building deep learning models. It’s user-friendly and ideal for beginners.</li><li><strong>NumPy:</strong> Essential for numerical computations in Python, NumPy provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions.</li><li><strong>Pandas:</strong> Pandas is a library for data manipulation and analysis. It offers data structures like DataFrames, making it easier to clean, process, and analyze data.</li><li><strong>OpenCV:</strong> For computer vision tasks, OpenCV is a powerful library that allows for real-time image and video processing. It’s widely used in AI applications like object detection and facial recognition.</li></ol><h3>How Python is Used in AI and Machine Learning</h3><p>Python’s versatility allows it to be used in various stages of AI and machine learning development. Here’s a look at some of the key areas where Python shines:</p><h4>1. Data Preprocessing</h4><p>Data is the foundation of any AI or ML model. Before training a model, data needs to be cleaned, transformed, and prepared. Python’s Pandas and NumPy libraries are indispensable for data manipulation, while libraries like Matplotlib and Seaborn are used for data visualization.</p><h4>2. Building Machine Learning Models</h4><p>Python simplifies the process of building machine learning models. Scikit-Learn offers tools for traditional ML algorithms, while TensorFlow and PyTorch provide frameworks for deep learning. With Python, you can build models for tasks like classification, regression, clustering, and reinforcement learning.</p><h4>3. Natural Language Processing (NLP)</h4><p>Python plays a significant role in NLP, the field that focuses on the interaction between computers and human language. Libraries like NLTK (Natural Language Toolkit) and SpaCy allow developers to process and analyze text data, build language models, and create chatbots.</p><h4>4. Computer Vision</h4><p>Computer vision is another area where Python excels. Using libraries like OpenCV and TensorFlow, developers can create models that recognize objects, detect faces, and analyze images and videos. Python’s simplicity makes it easy to implement complex computer vision algorithms.</p><h4>5. AI Deployment</h4><p>Once a model is trained, it needs to be deployed in a production environment. Python’s flexibility allows it to be integrated with web frameworks like Flask and Django, enabling AI models to be served as APIs or embedded into web applications.</p><h4>6. Automation and Scripting</h4><p>Beyond building models, Python is also used to automate repetitive tasks. From web scraping to data extraction, Python scripts can streamline workflows, allowing AI engineers to focus on more complex tasks.</p><h3>Conclusion</h3><p>Python’s combination of simplicity, versatility, and a rich ecosystem of libraries makes it the ideal language for AI and machine learning. Whether you’re preprocessing data, building models, or deploying AI solutions, Python offers the tools and support you need to succeed.</p><p>As AI continues to evolve, Python will remain at the forefront, empowering developers to push the boundaries of what’s possible. If you’re looking to enter the field of AI or deepen your expertise, mastering Python is the first step on your journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2432cebcfbd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Optical Character Recognition (OCR) with PaddleOCR and EasyOCR]]></title>
            <link>https://medium.com/@hk4897286/introduction-to-optical-character-recognition-ocr-with-paddleocr-and-easyocr-a4b0d01acc5e?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4b0d01acc5e</guid>
            <category><![CDATA[paddleocr]]></category>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[optical-character-recogn]]></category>
            <category><![CDATA[easyocr]]></category>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Fri, 31 May 2024 08:08:25 GMT</pubDate>
            <atom:updated>2024-05-31T08:08:25.370Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q58WcEPblOYEtktH_UmNbg.jpeg" /></figure><p>Optical Character Recognition (OCR) is a technology used to convert different types of documents, such as scanned paper documents, PDF files, or images captured by a digital camera, into editable and searchable data. OCR technology is essential for digitizing printed texts, enabling electronic editing, searching, and storage.</p><h3>How OCR Works</h3><ol><li>Image Preprocessing: The image containing the text is processed to improve the quality and enhance the recognition rate.</li><li>Text Detection: The regions containing text are detected and extracted.</li><li>Character Segmentation: The detected text regions are further processed to segment individual characters.</li><li>Character Recognition: The segmented characters are recognized using pattern recognition techniques.</li><li>Post-Processing: Recognized text may undergo spell checking and context analysis to correct errors.</li></ol><h3>Applications of OCR</h3><ul><li>Digitizing Historical Documents: Converting old manuscripts, books, and newspapers into digital format.</li><li>Automating Data Entry: Extracting text from invoices, receipts, and forms to automate data entry processes.</li><li>Assistive Technology: Helping visually impaired individuals by converting printed text to speech.</li><li>Text Mining and Analytics: Extracting valuable information from large volumes of text for analysis.</li></ul><h3>Practical Implementation Using Python</h3><h4>Prerequisites</h4><p>You will need to install either PaddleOCR or EasyOCR libraries. You can install them using pip:</p><ul><li>For PaddleOCR:</li><li>pip install paddlepaddle paddleocr</li><li>For EasyOCR:</li><li>pip install easyocr</li></ul><h4>Using PaddleOCR</h4><p>PaddleOCR is an OCR tool developed by the PaddlePaddle team, supporting multiple languages and scripts.</p><p>import paddleocr<br>from paddleocr import PaddleOCR, draw_ocr<br>import matplotlib.pyplot as plt<br>from PIL import Image</p><p># Initialize PaddleOCR with English language support<br>ocr = PaddleOCR(use_angle_cls=True, lang=’en’)</p><p># Path to the image file<br>image_path = ‘path_to_your_image_file.png’</p><p># Perform OCR on the image<br>result = ocr.ocr(image_path, cls=True)</p><p># Print the recognized text<br>for line in result:<br> print(line)</p><p># Draw the OCR results on the image<br>image = Image.open(image_path).convert(‘RGB’)<br>boxes = [line[0] for line in result[0]]<br>txts = [line[1][0] for line in result[0]]<br>scores = [line[1][1] for line in result[0]]<br>im_show = draw_ocr(image, boxes, txts, scores, font_path=’path_to_font.ttf’)<br>im_show = Image.fromarray(im_show)</p><p># Display the image with OCR results<br>plt.imshow(im_show)<br>plt.axis(‘off’)<br>plt.show()</p><h4>Using EasyOCR</h4><p>EasyOCR is a lightweight OCR library that supports 80+ languages and is built with PyTorch.</p><p>import easyocr<br>import matplotlib.pyplot as plt<br>from PIL import Image</p><p># Initialize EasyOCR with English language support<br>reader = easyocr.Reader([‘en’])</p><p># Path to the image file<br>image_path = ‘path_to_your_image_file.png’</p><p># Perform OCR on the image<br>result = reader.readtext(image_path)</p><p># Print the recognized text<br>for (bbox, text, prob) in result:<br> print(f’Text: {text}, Probability: {prob}’)</p><p># Draw the OCR results on the image<br>image = Image.open(image_path).convert(‘RGB’)<br>plt.imshow(image)<br>for (bbox, text, prob) in result:<br> plt.plot([bbox[0][0], bbox[1][0], bbox[2][0], bbox[3][0], bbox[0][0]],<br> [bbox[0][1], bbox[1][1], bbox[2][1], bbox[3][1], bbox[0][1]], color=’red’, linewidth=2)<br> plt.text(bbox[0][0], bbox[0][1], text, color=’blue’, fontsize=12)<br>plt.axis(‘off’)<br>plt.show()</p><h3>Conclusion</h3><p>OCR technology has revolutionized the way we handle and process text data from images. With tools like PaddleOCR and EasyOCR, you can easily integrate OCR capabilities into your applications using Python. PaddleOCR provides robust support for multiple languages and scripts, while EasyOCR is lightweight and easy to use, making it a great choice for quick and effective OCR solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4b0d01acc5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Humidity Prediction Using Machine Learning]]></title>
            <link>https://medium.com/@hk4897286/humidity-prediction-using-machine-learning-e9fefa0d3ce4?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9fefa0d3ce4</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[articles]]></category>
            <category><![CDATA[humidity]]></category>
            <category><![CDATA[predictions]]></category>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 08:47:42 GMT</pubDate>
            <atom:updated>2024-02-04T08:47:42.067Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*9EGD4KgbTSni0QxAmhMdNQ.png" /></figure><p>Humidity is a measure of the amount of water vapor present in the air. It is an essential parameter in weather and climate studies and has a significant impact on various environmental factors, human comfort, and the behavior of materials.</p><h3>Key Points about Humidity:</h3><p>Relative Humidity (RH): Relative humidity is the most commonly used measure of humidity. It is expressed as a percentage and represents the amount of water vapor in the air relative to the maximum amount the air could hold at that temperature. For example, if the air is holding half the moisture it could potentially hold at a particular temperature, the relative humidity would be 50%.</p><p>2. Dew Point: The dew point is the temperature at which air becomes saturated with moisture, leading to the formation of dew or frost. It is a useful indicator of how much moisture is present in the air.</p><p>3. Absolute Humidity: Absolute humidity is the actual amount of water vapor present in a unit volume of air, usually expressed in grams per cubic meter.</p><p>4. Specific Humidity: Specific humidity is the ratio of the mass of water vapor to the total mass of the air parcel. It is expressed as a fraction.</p><p>5. Importance in Weather Patterns: Humidity plays a crucial role in the formation of weather patterns. High humidity levels contribute to the potential for precipitation, while low humidity levels are associated with dry and arid conditions.</p><p>6. Human Comfort: Humidity affects human comfort by influencing the perceived temperature. High humidity levels can make a given temperature feel warmer due to reduced evaporative cooling, while low humidity can make it feel cooler.</p><p>7. Impact on Health: Extremely high or low humidity levels can have health implications. High humidity can contribute to discomfort, mold growth, and respiratory issues, while low humidity can lead to dry skin, irritated respiratory passages, and other health issues.</p><p>8. Instruments for Measurement: Hygrometers are instruments used to measure humidity. They can be based on various principles, such as the use of hair, capacitance, or electrical resistance.</p><h3>Import libraries</h3><p>We will need to import the required libraries into the jupyter notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_rGQh2wmZ5iAGsxbIH5ynQ.png" /></figure><h3>Loading the Dataset</h3><p>The data can be stored in the CSV file or excel file. we simply use <strong>pd.read_csv(‘your dataset path’)</strong> function to load the dataset.</p><p>data = pd.read_csv(‘iot_telemetry_data.csv’)<br>data.head(5)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KfbJSpNLVQ0mTIXAlEwFrA.png" /></figure><h3><strong>Machine learning models</strong></h3><p>Machine learning models are computational algorithms or systems that learn patterns and relationships from data to make predictions or decisions without being explicitly programmed. These models are a central component of machine learning and are designed to recognize patterns, generalize from data, and adapt to new input. The process of creating and refining machine learning models involves training them on labeled datasets and evaluating their performance on unseen data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFoA2jA4Kxi2g_ijNXeACg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9fefa0d3ce4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Computer vision]]></title>
            <link>https://medium.com/@hk4897286/what-is-computer-vision-65824a4e922a?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/65824a4e922a</guid>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Sun, 31 Dec 2023 21:30:25 GMT</pubDate>
            <atom:updated>2023-12-31T21:30:25.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*Km8DOUdBV8xEDL2uuZkpbw.jpeg" /></figure><p>Computer vision is a multidisciplinary field of study that enables computers to interpret and understand visual information from the world. The goal of computer vision is to teach machines to gain a high-level understanding of images or videos, similar to the way humans perceive and interpret visual data.</p><p>Key components of computer vision include:</p><ol><li>Image Acquisition:</li></ol><p>Involves obtaining images or video frames from various sources such as cameras, satellites, or other imaging devices.</p><p>2.Image Processing:</p><ul><li>Manipulating and enhancing raw images to improve their quality or extract relevant information. This may include techniques like filtering, noise reduction, and image enhancement.</li></ul><p>3.Feature Extraction:</p><ul><li>Identifying key features in the images that are relevant for the analysis. Features could be edges, corners, textures, or other distinctive patterns.</li></ul><p>4.Image Recognition and Classification:</p><ul><li>Assigning labels or categories to images based on their content. This involves training models to recognize patterns and objects within images.</li></ul><p>5.Object Detection:</p><ul><li>Identifying and locating multiple objects within an image. Object detection goes beyond classification by providing information about the precise location of each object.</li></ul><p>6.Image Segmentation:</p><ul><li>Dividing an image into meaningful segments or regions. This can be useful for understanding the structure of objects within an image.</li></ul><p>7.Scene Understanding:</p><ul><li>Combining information from various sources to understand the context of an entire scene. This involves recognizing objects, their relationships, and the overall scene layout.</li></ul><p>8.Motion Analysis:</p><ul><li>Analyzing the movement of objects within a sequence of images or videos. This can be applied in tracking objects, recognizing gestures, or understanding dynamic scenes.</li></ul><p>9.3D Reconstruction:</p><ul><li>Creating three-dimensional models of objects or scenes from two-dimensional images. This is particularly valuable in applications such as robotics, augmented reality, and virtual reality.</li></ul><p>10.Deep Learning in Computer Vision:</p><ul><li>Deep learning, especially convolutional neural networks (CNNs), has played a significant role in advancing computer vision tasks. CNNs are particularly effective for image classification, object detection, and feature extraction.</li></ul><h3>Import libraries</h3><p>We will need to import the required libraries into the jupyter notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SluCSEeQl2-mV06hJzVsZQ.png" /></figure><p>Real Time Webcam</p><p>Real-time webcam in computer vision refers to the continuous and immediate analysis of video frames captured by a webcam or any other camera in real-time. It involves processing the video stream frame by frame, enabling the system to respond dynamically to the changing visual information. This real-time analysis is crucial for applications that require immediate feedback or interaction with the environment.</p><p># Running real time from webcam<br>cap = cv2.VideoCapture(‘fire4.mp4’)<br>model = YOLO(‘fire1.pt’)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfyBs6kNOpVtD_MNLoGa_A.png" /></figure><p>Bonding Boxes</p><p>Bounding boxes in computer vision refer to rectangular or square regions that are drawn around objects or regions of interest within an image. These boxes serve to enclose and delineate the identified areas, providing a way to represent and locate objects within an image or video frame. Each bounding box is defined by its coordinates, typically in terms of the top-left and bottom-right corners.</p><p>while True:<br> ret, frame = cap.read()<br> frame = cv2.resize(frame, (640, 480))<br> result = model(frame, stream=True)</p><p># Getting bbox, confidence, and class names information to work with<br> for info in result:<br> boxes = info.boxes<br> for box in boxes:<br> confidence = box.conf[0]<br> confidence = math.ceil(confidence * 100)<br> Class = int(box.cls[0])<br> if confidence &gt; 50:<br> x1, y1, x2, y2 = box.xyxy[0]<br> x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)<br> cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 0, 255), 5)<br> cvzone.putTextRect(frame, f’{classnames[Class]} {confidence}%’, [x1 + 8, y1 + 100],<br> scale=1.5, thickness=2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5x1vQ2w3x6oEu5F970Bvg.png" /></figure><p>Release Window Frame</p><p>Release window use for when some one press any button so then window will be release and destroy the window program will be ending which have starts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nu_q2ZW7xHlAQEh5hlVd2w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65824a4e922a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Statistical Methods using for Machine learning]]></title>
            <link>https://medium.com/@hk4897286/statistical-methods-using-for-machine-learning-1f2adf0a1d4e?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f2adf0a1d4e</guid>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Sun, 31 Dec 2023 20:57:14 GMT</pubDate>
            <atom:updated>2023-12-31T20:57:14.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*EaoqZkFOu2bkRc6k6cfJiA.jpeg" /></figure><p>Statistics in machine learning involves the application of statistical methods and concepts to analyze data, make predictions, and draw inferences. Statistics plays a crucial role in various aspects of the machine learning pipeline, from data preprocessing and exploration to model training and evaluation. Here are key areas where statistics is applied in machine learning:</p><ol><li>Descriptive Statistics:</li></ol><ul><li><em>Summary Statistics:</em> Techniques like mean, median, mode, standard deviation, and variance provide a concise summary of the main features of a dataset. Descriptive statistics help in understanding the central tendency, dispersion, and shape of the data distribution.</li><li>2. Inferential Statistics:</li><li><em>Hypothesis Testing:</em> Statistical tests are used to make inferences about population parameters based on sample data. For example, hypothesis testing might be employed to assess whether a model’s performance is significantly different from random chance.</li><li><em>Confidence Intervals:</em> Estimate the range within which a population parameter is likely to fall, providing a measure of the uncertainty associated with sample estimates.</li><li>3. Probability Distributions:</li><li>Understanding and modeling probability distributions is fundamental in machine learning. Common distributions include the normal distribution (used in many statistical methods), Bernoulli distribution (for binary outcomes), and others.</li><li>4. Regression Analysis:</li><li><em>Linear Regression:</em> A statistical method that models the relationship between a dependent variable and one or more independent variables. It is used for predicting continuous outcomes.</li><li><em>Logistic Regression:</em> Applied for binary classification problems, logistic regression models the probability of an event occurring.</li><li>5. Statistical Metrics for Model Evaluation:</li><li><em>Accuracy, Precision, Recall, F1 Score:</em> Common metrics used to evaluate the performance of classification models. These metrics are based on concepts from confusion matrices and provide insights into the model’s predictive capabilities.</li></ul><h3>Import libraries</h3><p>We will need to import the required libraries into the jupyter notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*18SMh2Xr8upbP7hBCxE6Kg.png" /></figure><h3>Loading the Dataset</h3><p>The data can be stored in the CSV file or excel file. we simply use <strong>pd.read_csv(‘your dataset path’)</strong> function to load the dataset.</p><p>data = pd.read_csv(‘zameen-updated.csv’)<br>data.head()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yl2WrK1uAORvCsQFOIOKGw.png" /></figure><h3>1. datatype</h3><p>In Pandas, dtype refers to the data type of a Pandas object, such as a Series or a DataFrame. Pandas supports various data types, and dtype provides information about the type of data stored in a particular column or element. The dtype attribute is available for both Series and DataFrame objects.</p><p>data.dtypes()<br>print(data.dtypes)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZgJCz6_SF-j8zaKkwJwn3g.png" /></figure><p>Describe</p><p>In Pandas, the describe() method is used to generate descriptive statistics of a DataFrame or Series. It provides a summary of the central tendency, dispersion, and shape of the distribution of the data. The output includes various statistics, such as the mean, standard deviation, minimum, 25th percentile (Q1), median (50th percentile or Q2), 75th percentile (Q3), and maximum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFg3_T4Ww8Mro1AhKdVWhA.png" /></figure><p>Machine learning models</p><p>Machine learning models are computational algorithms or systems that learn patterns and relationships from data to make predictions or decisions without being explicitly programmed. These models are a central component of machine learning and are designed to recognize patterns, generalize from data, and adapt to new input. The process of creating and refining machine learning models involves training them on labeled datasets and evaluating their performance on unseen data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkVQTtptzQCBx6GlKRxx5w.png" /></figure><p>Mean Squared Error</p><p>Mean Squared Error (MSE) is a commonly used metric to measure the average squared difference between the actual and predicted values in a regression problem. It provides a measure of the overall accuracy of a predictive model.</p><p>The formula for Mean Squared Error is given by:</p><p><em>MSE</em>=<em>n</em>1​∑<em>i</em>=1<em>n</em>​(<em>yi</em>​−<em>y</em>^​<em>i</em>​)2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5I4Rd9wwK-5hJ0JfM5Xlg.png" /></figure><p>R-squared</p><p>R-squared (R²) is a statistical metric that measures the proportion of the variance in the dependent variable (target) that is explained by the independent variables (features) in a regression model. It provides an indication of how well the model fits the observed data.</p><p>The formula for R-squared is given by:</p><p><em>R</em>2=1− ∑<em>i</em>=1<em>n</em>​(<em>yi</em>​−<em>y</em>ˉ​)2∑<em>i</em>=1<em>n</em>​(<em>yi</em>​−<em>y</em>^​<em>i</em>​)2​</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5I4Rd9wwK-5hJ0JfM5Xlg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f2adf0a1d4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Data Analysis with Pandas and Python]]></title>
            <link>https://medium.com/@hk4897286/mastering-data-analysis-with-pandas-and-python-84a0e8080450?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/84a0e8080450</guid>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 13:24:07 GMT</pubDate>
            <atom:updated>2023-12-13T13:24:07.007Z</atom:updated>
            <content:encoded><![CDATA[<p>Data analysis is at the heart of informed decision-making in various domains, and Python’s pandas library is a powerful ally in this realm. In this article, we’ll explore the fundamentals of data analysis using pandas, a versatile library that simplifies the manipulation and analysis of structured data.</p><h3>What is Pandas?</h3><p>Pandas is an open-source data manipulation and analysis library for Python. Built on top of NumPy, it offers data structures like DataFrames and Series, which are designed for efficient and intuitive handling of structured data. Whether you’re working with spreadsheets, CSV files, or databases, pandas provides a wealth of tools to make your data analysis tasks seamless.</p><h3>Key Concepts in Pandas:</h3><ol><li>DataFrame: The central data structure in pandas is the DataFrame, a two-dimensional table with labeled axes (rows and columns). It allows for easy manipulation and analysis of data, similar to a spreadsheet.</li><li>Series: A one-dimensional array-like object in pandas, Series is used to represent a column or row of data in a DataFrame.</li><li>Data Cleaning: Pandas provides functions to handle missing data, remove duplicates, and perform other operations to ensure your data is in a clean and usable state.</li><li>Data Selection and Indexing: Pandas allows for easy slicing, indexing, and filtering of data, making it simple to extract the information you need.</li></ol><h3>Getting Started with Pandas</h3><h3>Installing Pandas:</h3><p>Before diving into data analysis with pandas, you need to install it. Use the following command:</p><pre>pip install pandas</pre><h3>Importing Pandas:</h3><p>Once installed, import pandas into your Python script or Jupyter notebook:</p><pre>import pandas as pd</pre><h3>Loading Data:</h3><p>Pandas supports various file formats, including CSV, Excel, JSON, and SQL databases. Loading data into a DataFrame is a breeze</p><pre># Read a CSV file<br>df = pd.read_csv(&#39;your_data.csv&#39;)</pre><h3>Basic Data Analysis Operations</h3><h3>Exploring the Data:</h3><p>Let’s start by exploring the basic features of your dataset:</p><pre># Display the first few rows of the DataFrame<br>print(df.head())</pre><pre># Get information about the columns and data types<br>print(df.info())</pre><pre># Descriptive statistics for numerical columns<br>print(df.describe())</pre><h3>Data Cleaning:</h3><p>Clean your data by handling missing values and removing duplicates:</p><pre># Drop rows with missing values<br>df_cleaned = df.dropna()</pre><pre># Remove duplicate rows<br>df_no_duplicates = df.drop_duplicates()</pre><h3>Data Selection and Filtering:</h3><p>Select and filter data based on specific criteria:</p><pre># Select a single column<br>column_data = df[&#39;column_name&#39;]</pre><pre># Filter data based on a condition<br>filtered_data = df[df[&#39;numeric_column&#39;] &gt; 10]</pre><h3>Advanced Data Analysis Techniques</h3><h3>Grouping and Aggregation:</h3><p>Group your data by a specific column and perform aggregation operations:</p><pre># Group by a column and calculate the mean<br>grouped_data = df.groupby(&#39;category_column&#39;)[&#39;numeric_column&#39;].mean()</pre><h3>Pivot Tables:</h3><p>Create pivot tables for a more organized view of your data</p><pre># Create a pivot table<br>pivot_table = df.pivot_table(index=&#39;category_column&#39;, columns=&#39;another_column&#39;, values=&#39;numeric_column&#39;, aggfunc=&#39;mean&#39;)</pre><h3>Time Series Analysis:</h3><p>Pandas excels in time series data analysis. Utilize its features for tasks like resampling and date-based indexing.</p><pre># Convert a column to datetime format<br>df[&#39;date_column&#39;] = pd.to_datetime(df[&#39;date_column&#39;])</pre><pre># Set the date column as the index<br>df.set_index(&#39;date_column&#39;, inplace=True)</pre><h3>Conclusion</h3><p>Pandas is a game-changer for anyone involved in data analysis with Python. Its versatility, ease of use, and extensive functionality make it an indispensable tool. Whether you’re cleaning messy data, performing exploratory data analysis, or preparing data for machine learning models, pandas empowers you to work efficiently and effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84a0e8080450" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Numerical Computing with NumPy: A Deep Dive]]></title>
            <link>https://medium.com/@hk4897286/mastering-numerical-computing-with-numpy-a-deep-dive-982f8498392d?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/982f8498392d</guid>
            <category><![CDATA[what-is-numpy]]></category>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 13:02:26 GMT</pubDate>
            <atom:updated>2024-02-04T09:02:47.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*myUljb2lYF9DUSe4oemF9A.jpeg" /></figure><p>When it comes to numerical computing in Python, one library stands out as the backbone of the scientific computing ecosystem: NumPy. In this article, we’ll take a comprehensive look at what NumPy is, why it’s so crucial for numerical operations, and how you can harness its power for your data science and machine learning endeavors.</p><h3>What is NumPy?</h3><p>NumPy, short for Numerical Python, is an open-source library that provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays. It is the foundation upon which many other libraries in the Python scientific stack, such as pandas and scikit-learn, are built.</p><h3>Key Features of NumPy:</h3><ol><li>N-dimensional Arrays: The core of NumPy is the ndarray, a highly efficient, multi-dimensional array object. These arrays can be one-dimensional (vectors), two-dimensional (matrices), or even higher-dimensional, providing a flexible way to represent and manipulate data.</li><li>Universal Functions (ufuncs): NumPy offers a wide range of mathematical functions that operate element-wise on arrays, known as universal functions or ufuncs. These functions are implemented in C, making them incredibly fast and efficient.</li><li>Broadcasting: NumPy’s broadcasting mechanism allows for performing operations on arrays of different shapes and sizes, eliminating the need for explicit looping and improving code readability.</li><li>Linear Algebra Operations: NumPy includes a comprehensive set of functions for linear algebra, such as matrix multiplication, eigenvalue decomposition, and singular value decomposition.</li><li>Random Number Generation: The library provides robust tools for generating random numbers and creating random samples from various probability distributions.</li></ol><h3>Getting Started with NumPy</h3><p>To begin using NumPy, you first need to install it. You can install NumPy using the following command:</p><pre>pip install numpy</pre><p>Once installed, you can import NumPy into your Python script or Jupyter notebook:</p><pre>import numpy as np</pre><h3>Creating NumPy Arrays</h3><p>Creating NumPy arrays is straightforward. You can create arrays from lists or use functions provided by NumPy:</p><pre># Creating a one-dimensional array<br>arr_1d = np.array([1, 2, 3, 4, 5])</pre><pre># Creating a two-dimensional array<br>arr_2d = np.array([[1, 2, 3], [4, 5, 6]])</pre><pre># Creating arrays with specific values<br>zeros_array = np.zeros((3, 3))<br>ones_array = np.ones((2, 4))</pre><h3>Basic Operations</h3><p>NumPy simplifies mathematical operations on arrays:</p><pre># Element-wise addition<br>result = arr_1d + 10</pre><pre># Matrix multiplication<br>matrix_product = np.dot(arr_2d, np.transpose(arr_2d))</pre><h3>Advanced NumPy Techniques</h3><p>NumPy offers advanced features for more sophisticated numerical computing:</p><ol><li>Indexing and Slicing: Efficiently access and manipulate elements within arrays.</li><li>Aggregation and Reduction: Calculate statistics such as mean, sum, and standard deviation along specified axes.</li><li>Broadcasting in Action: Understand how broadcasting simplifies operations on arrays of different shapes.</li><li>Advanced Linear Algebra: Explore more advanced linear algebra operations, including solving linear equations and computing matrix inverses.</li></ol><h3>Conclusion</h3><p>NumPy is the cornerstone of numerical computing in Python, providing a robust foundation for scientific and data-driven applications. Whether you’re crunching numbers for data analysis, implementing machine learning algorithms, or solving complex mathematical problems, NumPy’s efficiency and simplicity make it an essential tool.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=982f8498392d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking Data Power with Pandas: A Comprehensive Guide]]></title>
            <link>https://medium.com/@hk4897286/unlocking-data-power-with-pandas-a-comprehensive-guide-ce6ee31641b8?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce6ee31641b8</guid>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 12:56:38 GMT</pubDate>
            <atom:updated>2023-12-13T12:56:38.963Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of data science and analysis, efficient data manipulation is the key to unlocking valuable insights. One powerful tool that has become indispensable for working with structured data in Python is the pandas library. In this article, we’ll explore the basics of pandas and discover how it can transform the way you handle and analyze data.</p><h3>What is Pandas?</h3><p>Pandas is an open-source Python library that provides high-performance, easy-to-use data structures, and data analysis tools. It’s built on top of the NumPy library, making it suitable for handling structured data and performing a wide range of data manipulation tasks.</p><h3>Key Features of Pandas:</h3><ol><li>DataFrame: The core data structure in pandas is the DataFrame. It’s a two-dimensional table with labeled axes (rows and columns), similar to a spreadsheet. DataFrames make it easy to organize and analyze data.</li></ol><p>2. Data Cleaning and Preparation: Pandas excels in data cleaning tasks. It provides functions to handle missing data, duplicate values, and outliers, ensuring that your data is in a clean and usable state.</p><p>3. Data Selection and Indexing: Pandas allows for intuitive data selection and indexing. You can slice and dice your data based on conditions, filter rows and columns, and perform complex indexing operations effortlessly.</p><p>4. Grouping and Aggregation: Grouping data and performing aggregation operations is a breeze with pandas. Whether you need to calculate the mean, sum, or any custom aggregation, pandas simplifies the process.</p><p>5. Time Series Analysis: Pandas has robust support for time series data, making it an excellent choice for tasks involving temporal data. You can easily resample, interpolate, and perform other time-related operations.</p><h3>Getting Started with Pandas</h3><p>To begin using pandas, you first need to install it. If you haven’t installed it yet, you can do so using the following command:</p><pre>pip install pandas</pre><p>Once installed, you can import pandas into your Python script or Jupyter</p><pre>import pandas as pd</pre><h3>Loading Data</h3><p>Pandas supports various file formats, including CSV, Excel, JSON, and SQL databases. Loading data into a DataFrame is straightforward:</p><pre># Read a CSV file<br>df = pd.read_csv(&#39;your_data.csv&#39;)</pre><h3>Basic Operations</h3><p>Now that you have your data in a DataFrame, you can start exploring and manipulating it. Here are some basic operations:</p><pre># Display the first few rows of the DataFrame<br>print(df.head())</pre><pre># Get summary statistics<br>print(df.describe())</pre><pre># Filter data based on a condition<br>filtered_data = df[df[&#39;column_name&#39;] &gt; 10]</pre><pre># Group data and calculate the mean<br>grouped_data = df.groupby(&#39;category_column&#39;)[&#39;numeric_column&#39;].mean()</pre><h3>Advanced Pandas Techniques</h3><p>Pandas offers advanced features for more sophisticated data analysis:</p><ol><li>Merging and Joining: Combine data from multiple DataFrames using merge and join operations.</li></ol><p>2. Pivoting and Melting: Reshape your data using pivot and melt functions for better analysis.</p><p>3. Handling Dates and Times: Leverage the power of pandas to work seamlessly with date and time data.</p><p>4. Custom Functions: Apply custom functions to your data using the apply function.</p><h3>Conclusion</h3><p>Pandas is a game-changer for anyone dealing with data in Python. Its flexibility, ease of use, and powerful features make it an essential tool for data scientists, analysts, and engineers. Whether you’re cleaning messy data, performing complex analyses, or visualizing results, pandas has you covered.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce6ee31641b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pandas its function to perform on data]]></title>
            <link>https://medium.com/@hk4897286/pandas-its-function-to-perform-on-data-daecd656587e?source=rss-af2707393e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/daecd656587e</guid>
            <dc:creator><![CDATA[Haroon khan]]></dc:creator>
            <pubDate>Sat, 29 Oct 2022 05:12:20 GMT</pubDate>
            <atom:updated>2024-02-04T08:58:40.084Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*I5OPd3s9ucOZW8LTyAI1lg.jpeg" /></figure><h4>pandas</h4><p>Pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series. It is free software released under the three-clause BSD license.</p><p>Install pandas in Jupyter Notebook</p><p>We can easily install pandas on Anaconda using Anaconda prompt by the following commands.</p><p>{conda install pandas } OR {pip install pandas}</p><p>Now you can import pandas into your jupyter Notebook</p><p>Import pandas as pd</p><p>1. Read the CSV or Excel file</p><p>To read the data stored in excel or CSV file we can use the command</p><p>data = pd.read_csv(“path11.csv”)</p><p>Get the First five rows of the Dataset</p><p>This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it.</p><p>data.head( )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*lU5x5b4NsuFL1C7UMo1aoQ.png" /></figure><p>2. Get the information of the dataset</p><p>This function you can get all information about your dataset</p><p>Which there are how many rows or colunms in dataset</p><p>data.info( )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*EyNiPNjTlo9k6WzgA9OMzg.png" /></figure><p>3. To do statistic work on dataset</p><p>Here you can check mean medium average or some other statistical function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkrtsLc6HNk_m_EJYrJxBw.png" /></figure><p>4. To access columns on dataset</p><p>If we wanted to access a certain column in our DataFrame, for example the Grades column, we could simply use the loc function and specify the name of the column in order to retrieve it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*22eCzQQjr6CS7Q92hM2CUg.png" /></figure><p>5. To find Null value in a dataset</p><p>This function you can check that which columns contains null values so when you find null values then you can clean it</p><p>Data.is null( ).sum( )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*GfNU6ujRiamrwBvkjQCPJQ.png" /></figure><p>6. To display max numbers of Rows or Columns</p><p>This function you can find max rows or columns easily which get more information compare to min numbers of columns</p><p>Pd.set_option(“display.max_rows”,500)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*WcMMk23UeZxxuVbXyN3viQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daecd656587e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>