<?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 Balwant Gorad on Medium]]></title>
        <description><![CDATA[Stories by Balwant Gorad on Medium]]></description>
        <link>https://medium.com/@goradbj?source=rss-46e6469194ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FbNCFij9vcwbR05q</url>
            <title>Stories by Balwant Gorad on Medium</title>
            <link>https://medium.com/@goradbj?source=rss-46e6469194ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:27:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@goradbj/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[Different ways to categorize the data | Types of Data]]></title>
            <link>https://medium.com/@goradbj/different-ways-to-categorize-the-data-types-of-data-3f32be3137e1?source=rss-46e6469194ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f32be3137e1</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[dataset]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Balwant Gorad]]></dc:creator>
            <pubDate>Sun, 05 Nov 2023 10:43:21 GMT</pubDate>
            <atom:updated>2023-11-05T10:43:21.235Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Data can be categorized in various ways based on different criteria and characteristics.</strong></h4><h3>Here are different ways to categorize data:</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8Qvv2XNKi8k%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8Qvv2XNKi8k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8Qvv2XNKi8k%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5051fd20193bef892b5bd4c334f390ef/href">https://medium.com/media/5051fd20193bef892b5bd4c334f390ef/href</a></iframe><p>1. <strong>By Data Type:</strong><br> <strong>— Numerical Data:</strong> Data that consists of numbers and can be further categorized into interval and ratio data. Examples include: Temperature measurements (e.g., 25.5°C), Annual income ($50,000)<br> <strong>— Categorical Data:</strong> Data that represents categories or labels, such as nominal and ordinal data.<br> <strong>— Binary Data: </strong>A specific type of categorical data with two categories (e.g., yes/no, true/false).</p><p>2. <strong>By Structure:</strong><br> <strong>— Structured Data:</strong> Data that is organized into a predefined format, often tabular or relational, such as data in a spreadsheet or a database.<br> <strong>— Unstructured Data</strong>: Data that lacks a predefined structure and is typically text-heavy, such as emails, social media posts, or images.<br> <strong>— Semi-Structured Data:</strong> Data that falls between structured and unstructured data, having some structure but not as rigid as fully structured data, like XML, JSON files.</p><p>3. <strong>By Origin:</strong><br> <strong>— Primary Data:</strong> Data collected directly from original sources or firsthand observations.<br> <strong>— Secondary Data:</strong> Data obtained from existing sources, such as databases, reports, or publications.</p><p>4. <strong>By Temporality:</strong><br> <strong>— Cross-Sectional Data:</strong> Data collected at a single point in time, providing a snapshot of a population or phenomenon.<br> <strong>— Time Series Data:</strong> Data collected over successive time points, allowing the analysis of trends and changes over time.</p><p>5. <strong>By Granularity:</strong><br> <strong>— Fine-Grained Data:</strong> Data with a high level of detail or granularity, often containing individual-level observations.<br> <strong>— Coarse-Grained Data:</strong> Data with a lower level of detail or granularity, typically aggregated or summarized data.</p><p>6. <strong>By Domain or Context:</strong><br> <strong>— Domain-Specific Data:</strong> Data that is specific to a particular field or industry, such as medical data in healthcare or financial data in finance.<br> <strong>— General Data: </strong>Data that is not tied to a specific domain and can be applied broadly.</p><p>7. <strong>By Nature:</strong><br> <strong>— Continuous Data:</strong> Data that can take an infinite number of values within a range, such as height, weight, and temperature.<br> <strong>— Discrete Data:</strong> Data that can only take specific, distinct values, often in the form of whole numbers, such as counts or scores.</p><p>8. <strong>By Modality:</strong><br> <strong>— Unimodal Data:</strong> Data with a single peak or mode in its distribution.<br> <strong>— Bimodal Data:</strong> Data with two distinct peaks or modes in its distribution.<br> <strong>— Multimodal Data:</strong> Data with more than two distinct peaks or modes in its distribution.</p><p>9. <strong>By Sensitivity:</strong><br> <strong>— Sensitive Data:</strong> Data that is private or confidential and requires special protection, such as personal identification information or financial data.<br> <strong>— Non-Sensitive Data</strong>: Data that is not confidential or doesn’t require the same level of protection.</p><p>10. <strong>By Dimensionality:</strong><br> <strong>— Univariate Data:</strong> Data that involves a single variable or dimension.</p><p><strong>— Bivariate Data:</strong> Data that involves a two variables or dimensions.<br> <strong>— Multivariate Data:</strong> Data that involves multiple variables or dimensions.</p><p>11. <strong>By Spatial Characteristics:</strong><br> <strong>— Spatial Data:</strong> Data that is associated with geographic or spatial locations.<br> <strong>— Non-Spatial Data:</strong> Data that lacks a spatial component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJf3d4Q4OlYH5cDXvZm_VA.png" /></figure><p>Categorizing data based on these criteria helps in understanding its nature, characteristics, and how best to analyze and manage it. The choice of categorization depends on the context of data analysis and the objectives of the analysis.</p><p>Thanks for Reading this article !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f32be3137e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Debug Python Project or Python Scripts Line by Line]]></title>
            <link>https://medium.com/@goradbj/how-to-debug-python-project-or-python-scripts-line-by-line-28be8fe9b4ad?source=rss-46e6469194ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/28be8fe9b4ad</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Balwant Gorad]]></dc:creator>
            <pubDate>Sat, 23 Sep 2023 05:55:58 GMT</pubDate>
            <atom:updated>2023-10-04T17:13:59.509Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Hello Guys, I am working as Sr. Lead in AI and Machine Learning domain. In this blog I am going to make you aware and understand about how we can debug the python projects or scripts line by line.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPv3Y3ShErctOHRjPIep4A.png" /></figure><p><em>Debugging is a fundamental skill for programmers. It not only helps you produce better code but also fosters problem-solving abilities, efficiency, and confidence in your programming journey.</em></p><p><em>Whether you’re a beginner or an experienced developer, honing your debugging skills is essential for success in the world of software development</em></p><p><strong><em>Learning debugging is important for several reasons-</em></strong></p><ol><li><strong><em>Error Identification</em></strong><em>: Debugging allows you to identify and fix errors or bugs in your code. Errors can range from simple syntax mistakes to more complex logical issues.</em></li><li><strong><em>Code Quality: </em></strong><em>Debugging helps improve the overall quality of your code. By thoroughly testing and debugging your code, you can ensure that it works as intended, reducing the likelihood of errors in production.</em></li><li><strong><em>Efficiency</em></strong><em>: Debugging helps you become a more efficient programmer. When you encounter an issue, knowing how to quickly pinpoint the problem and fix it saves you time and frustration.</em></li><li><strong><em>Enhanced Problem-Solving Skills:</em></strong><em> Debugging is essentially problem-solving. It requires you to analyze the situation, identify the root cause of an issue, and develop a solution.</em></li><li><strong><em>Learning and Growth:</em></strong><em> Debugging often leads to a deeper understanding of programming languages and concepts. When you dig into the details of why something isn’t working as expected, you gain insights into how the language operates and how to use it effectively.</em></li><li><strong><em>Critical Thinking</em></strong><em>: Debugging requires critical thinking and attention to detail. These skills are transferable and can benefit you in various domains.</em></li><li><strong><em>Confidence</em></strong><em>: As you become proficient in debugging, you gain confidence in your ability to tackle complex problems.</em></li><li><strong><em>Collaboration:</em></strong><em> In team projects, debugging is crucial for collaboration. It allows you to understand and resolve issues that may arise in code written by others or shared codebases.</em></li><li><strong><em>Maintenance</em></strong><em>: Debugging is an ongoing process. As software evolves, new issues may arise. Learning debugging ensures that you can maintain and update your code over time, keeping it relevant and functional.</em></li><li><strong><em>Career Advancement:</em></strong><em> Debugging skills are highly valued in the software development industry. Employers often seek developers who can troubleshoot and maintain existing codebases, making these skills essential for career growth and opportunities.</em></li></ol><p><strong><em>I have created video tutorial regarding how to debug the python projects end to end, i recommend go through the same.</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fnsv78KzXMF0%3Fstart%3D5%26feature%3Doembed%26start%3D5&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dnsv78KzXMF0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fnsv78KzXMF0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fed9cddae91c41ba6508f840bcf70f2/href">https://medium.com/media/2fed9cddae91c41ba6508f840bcf70f2/href</a></iframe><p><strong><em>If you liked this video, do subscribe my channel and if you have queries please post it in comment box !!!</em></strong></p><p><strong><em>Thanks for reading and watching !!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28be8fe9b4ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tackling the Hurdles: A Guide to Challenges in ML Model Development and Deployment, with Better…]]></title>
            <link>https://medium.com/@goradbj/tackling-the-hurdles-a-guide-to-challenges-in-ml-model-development-and-deployment-with-better-78c949e6507a?source=rss-46e6469194ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/78c949e6507a</guid>
            <dc:creator><![CDATA[Balwant Gorad]]></dc:creator>
            <pubDate>Thu, 11 May 2023 08:27:04 GMT</pubDate>
            <atom:updated>2023-05-11T08:37:59.077Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tackling the Hurdles: A Guide to Challenges in ML Model Development and Deployment, with Better Strategies and Solutions</h3><p><em>Hello everyone, thank you for reading and appreciating my previous article and I apologize for the delay in writing the next article. As a Sr. Lead AIML software development/IT architect, I am writing my observation in last couple of years. Hope it will benefit you.</em></p><p><em>After developing many AI/ML models in last couple of years, I came across the common challenges in model building and deployment. Also, I am going to share the probable ways to overcome those challenges with you.</em></p><p><em>I am not going to explain ML model development here in this article but in brief you can understand it by going through following diagram which explains ML model development and deployment process.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*9xgKsf77YNO-mrsABjnY6g.png" /></figure><p><strong><em>The main intention of this article is to discuss the common challenges in ML Model Development and Deployment, with Better Strategies and Solutions to overcome it.</em></strong></p><p><em>During the development and deployment of machine learning (ML) models, several challenges may arise. Here are some common challenges to be aware of:</em></p><ol><li><strong>Data Availability and Quality:</strong> Obtaining high-quality and relevant data can be challenging. Limited data, missing values, inconsistent formats, or biased samples can impact the performance and generalizability of the model. Data collection, cleaning, and preprocessing are crucial steps to address these challenges.</li><li><strong>Overfitting and Underfitting: </strong>Overfitting occurs when a model performs well on the training data but fails to generalize to new, unseen data. Underfitting, on the other hand, happens when the model is too simple to capture the patterns in the data. Balancing model complexity, regularization techniques, and hyperparameter tuning can help mitigate these issues.</li><li><strong>Feature Engineering and Selection:</strong> Identifying the right set of features that capture relevant information from the data is crucial. Feature engineering requires domain knowledge and creativity. Additionally, selecting the optimal subset of features can be challenging, as irrelevant or redundant features can hinder model performance.</li><li><strong>Model Interpretability:</strong> Complex ML models, such as deep neural networks, often lack interpretability, making it difficult to understand and explain their decision-making process. Interpretability is particularly important in sensitive domains where trust, transparency, and regulatory compliance are critical. Exploratory techniques and model-agnostic interpretability methods can help address this challenge.</li><li><strong>Scalability and Efficiency:</strong> Scaling ML models to handle large datasets or high traffic can be challenging. The computational resources required for training and inference can be significant. Optimizing code, utilizing distributed computing, or leveraging cloud services can help address scalability and efficiency challenges.</li><li><strong>Model Deployment and Integration:</strong> Deploying ML models into production systems and integrating them with existing infrastructure can be complex. Model deployment involves considerations such as choosing the right deployment platform, ensuring real-time or batch processing, maintaining model version control, and monitoring performance in production.</li><li><strong>Ethical and Legal Considerations: </strong>ML models can inadvertently encode biases present in the training data, leading to biased predictions and potential ethical and legal implications. Ensuring fairness, avoiding discrimination, and addressing privacy concerns are essential. Adhering to ethical guidelines, regulations, and conducting rigorous testing and validation are crucial steps in addressing these challenges.</li><li><strong><em>Continuous Monitoring and Maintenance:</em></strong><em> ML models are not static; they require continuous monitoring and maintenance. Models may degrade in performance over time due to changing data distributions or shifts in the problem domain. Regular model evaluation, retraining, and updates are necessary to ensure accuracy, reliability, and relevance.</em></li></ol><p><em>Addressing these challenges requires a combination of technical expertise, domain knowledge, iterative experimentation, and collaboration among data scientists, domain experts, and stakeholders.</em></p><p><strong><em>By being aware of these challenges, you can proactively plan and implement strategies to overcome them during ML model development and deployment.</em></strong></p><p><em>When developing a machine learning (ML) model, there are several strategies that can help ensure success and improve the model’s performance. Here are some best practices to consider:</em></p><ol><li><strong>Define the Problem and Set Clear Goals:</strong> Clearly define the problem you are trying to solve and establish specific goals for your ML model. This will guide your development process and help you make informed decisions at each stage.</li><li><strong>Gather and Prepare Quality Data:</strong> Data is the foundation of any ML model. Collect relevant, high-quality data that represents the problem you’re solving. Clean and preprocess the data, handle missing values, address outliers, and perform feature engineering to extract meaningful information.</li><li><strong>Select the Right Algorithm:</strong> Choose the appropriate ML algorithm that aligns with your problem and data characteristics. Consider factors such as the type of problem (classification, regression, clustering, etc.), data size, linearity, and interpretability requirements. Experiment with different algorithms and compare their performance to select the most suitable one.</li><li><strong>Split Data for Training and Evaluation:</strong> Split your data into training and evaluation sets. The training set is used to train the model, while the evaluation set helps assess its performance and generalization. Cross-validation techniques like k-fold cross-validation can provide a more robust evaluation.</li><li><strong>Perform Feature Selection: </strong>Identify the most relevant features that contribute significantly to the model’s performance. Feature selection techniques such as statistical tests, feature importance rankings, or dimensionality reduction methods can help improve efficiency and reduce overfitting.</li><li><strong>Regularize and Optimize:</strong> Implement regularization techniques like L1 or L2 regularization, dropout, or early stopping to prevent overfitting. Fine-tune hyperparameters through techniques like grid search or random search to optimize model performance.</li><li><strong>Evaluate Performance Metrics: </strong>Select appropriate performance metrics based on the nature of your problem. Accuracy, precision, recall, F1-score, mean squared error, or area under the curve (AUC) are some commonly used metrics. Evaluate your model’s performance using these metrics and consider the business context to assess its practical value.</li><li><strong>Address Class Imbalance:</strong> In scenarios with imbalanced classes, apply techniques like oversampling, undersampling, or generating synthetic samples to balance the class distribution. This can help the model achieve better performance and avoid biased predictions.</li><li><strong>Regularly Monitor and Update the Model:</strong> Machine learning models may need periodic updates as new data becomes available or the problem evolves. Continuously monitor model performance in production, collect feedback, and retrain the model with fresh data to keep it accurate and up-to-date.</li><li><strong>Interpret and Communicate Results:</strong> Understand and interpret the predictions made by your ML model. Use techniques like feature importance, partial dependence plots, or SHAP values to gain insights into the model’s decision-making process. Communicate the results effectively to stakeholders, ensuring transparency and building trust in the model’s outcomes.</li></ol><p><em>Remember, developing an ML model is an iterative process. Be prepared to experiment, iterate, and fine-tune your approach based on the feedback and results you obtain. Continuous learning and improvement are key to building successful ML models.</em></p><p><em>I congratulate and thank you all for reading the article!! I know there might be some additional challenges and strategies that we can use while developing and deployment of model.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78c949e6507a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of AI and ML Careers: Thriving in the Next 5–10 Years]]></title>
            <link>https://medium.com/@goradbj/the-future-of-ai-and-ml-careers-thriving-in-the-next-5-10-years-2d24c17f327e?source=rss-46e6469194ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d24c17f327e</guid>
            <category><![CDATA[students]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Balwant Gorad]]></dc:creator>
            <pubDate>Thu, 11 May 2023 07:48:04 GMT</pubDate>
            <atom:updated>2023-05-11T08:49:17.068Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Artificial Intelligence (AI) and Machine Learning (ML) are set to reshape industries and careers in the coming years.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOLKNisZw-Gq04TY10TJWQ.jpeg" /></figure><p><em>In this article i am going to explores the potential scenarios for AI and ML, also it offers guidance on effectively pursuing a career in this dynamic field.</em></p><ol><li>Increasing Demand: The demand for AI and ML professionals will continue to skyrocket. To excel in this field:</li></ol><ul><li>Acquire a strong educational foundation in AI, ML, computer science, mathematics, and programming.</li><li>Specialize in a subfield such as natural language processing or computer vision.</li><li>Stay updated through continuous learning, attending conferences, and joining online communities.</li></ul><p>2. Industry Integration: AI and ML will infiltrate various sectors, creating ample career opportunities:</p><ul><li>Healthcare: Enhancing diagnostics, personalized medicine, and healthcare management systems.</li><li>Finance: Powering fraud detection, algorithmic trading, risk assessment, and customer service.</li><li>Transportation: Developing autonomous vehicles and optimizing traffic flow.</li><li>Retail and E-commerce: Driving personalized experiences, demand forecasting, and customer behavior analysis.</li></ul><p>3. Ethical Responsibility: Ethics and responsible AI practices will gain prominence:</p><ul><li>Develop a strong understanding of ethical frameworks and guidelines.</li><li>Emphasize responsible use of data and ensure privacy and security.</li></ul><p>4. Interdisciplinary Collaboration: Collaborations between AI/ML and other disciplines will foster innovation:</p><ul><li>Engage with professionals from robotics, neuroscience, healthcare, and social sciences.</li><li>Seek collaborative projects and research initiatives.</li></ul><p><em>So finally, we can say that the future of AI and ML is bright, offering abundant career prospects. By focusing on skills, specialization, ethics, and interdisciplinary collaboration, individuals can thrive in the dynamic AI and ML landscape of the next 5–10 years.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d24c17f327e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build complete end-to-end ML model, Backend RestAPI using FastAPI and front-end UI using…]]></title>
            <link>https://medium.com/@goradbj/how-to-build-complete-end-to-end-ml-model-backend-restapi-using-fastapi-and-front-end-ui-using-22f64bf04476?source=rss-46e6469194ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/22f64bf04476</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[projects]]></category>
            <dc:creator><![CDATA[Balwant Gorad]]></dc:creator>
            <pubDate>Fri, 14 Oct 2022 16:43:13 GMT</pubDate>
            <atom:updated>2023-07-05T03:29:12.951Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to build complete end-to-end ML model, Backend RestAPI using FastAPI and front-end UI using Streamlit</h3><p>Hey Guys….!!!!! Welcome all</p><p>My Name is Balwant Gorad working as Sr. Lead AI/ML IT architect.</p><p>In this tutorial I am going to explain you, how we can build complete end-to-end Regression ML model, Backend RestAPI to serve this model and front end UI so end user can interact and use it through web browser. Complete implementation is done Python language.</p><p><strong>This can be small end-to-end project for Data Science, AI ML beginners who want to know</strong></p><ol><li>What is the process of ML model building (in our case it is Regression), but the process is quite similar to classification and other ML technique also.</li><li>How backend RestAPI can can be developed to serve the model</li><li>How front-end UI can be designed using Streamlit</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FcJQX2zzna7-rdEocH3jYw.png" /></figure><p><strong>Normally Independent end-to-end ML applications can be developed in 3 steps</strong></p><ol><li><em>Build ML Model (In our case we are going for regression model, car price prediction. You may choose other ml technics like classification, clustering etc.)</em></li><li><em>Develop REST API as Backend (we are going to use FastAPI framework in python for our case, you may choose other frameworks like Django, Flask etc.)</em></li><li><em>Develop Front End UI (we are going to use Streamlit but you can use other technologies to design frontend like HTML, CSS, etc.)</em></li></ol><p>There are couple of IDE’s using which entire application can be developed but here we are going to use VS Code as an IDE, why we preferred VS code because we have to write RestAPI and frond-end UI also, but you can choose as per your choice.</p><p>Before going to discuss each step in detail, we can make our project structure look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*duerwqKO9GVI8ZePIgKS_A.png" /></figure><p>Create CARPRICEPREDICTOR directory anywhere in your machine, we have created on Desktop. Inside this directory create 3 folders namely</p><ol><li><em>api — which will contain RestAPI code</em></li><li><em>model — will contain dataset, model building jupyter notebook file(.ipynb) and generated model (.pkl file) which is to be served in backend API</em></li><li><em>ui — will contains frond-end UI files written using Streamlit</em></li></ol><h3><strong>Now, we will discuss and go through each step in details now..</strong></h3><h3><strong>Build ML Model</strong></h3><p>For this tutorial we are going to build car selling price prediction system based on various other car features like car manufacturing year, km_driven, new price, fuel_type, transmission and other some features.</p><p>The dataset we are going to use for this tutorial can be found <a href="https://raw.githubusercontent.com/goradbj/MachineLearning/main/Regression/CarPrice/model/car.csv">at this link</a>.</p><p>We personally recommend to you guys to create new virtual environment so it will not mess up the existing python packages in your base system. As you might be aware that there are various ways to create new virtual environments using venv, virtualenv, conda etc.</p><p>We are going to create virtual environment using conda, so for this just open anaconda prompt and run following command</p><blockquote>conda create -n test_env</blockquote><p>I already have an test_env, so i have not created environment again, but you can create</p><p>To activate env run following command</p><blockquote>conda activate test_env</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*wCawl5GCnfyVLvHP9FrHDQ.png" /></figure><p>We need few python packages for model building, API and UI building. To install packages into this activated environment you can run following commands</p><blockquote>conda install pip</blockquote><blockquote>pip install numpy pandas matplotlib seaborn sklearn lightgbm xgboost catboost</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sx6wYWAwSLVkIkor-E0Bng.png" /></figure><p>Now go inside earlier created carpricepredictor directory using following command</p><blockquote>cd Desktop\carpricepredictor</blockquote><p>and open VS Code in same directory using following command</p><blockquote>code .</blockquote><p>Now create 3 folders as mentioned earlier inside carpricepredictor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*9a8pqb-v1IN6wvuXgJTpvg.png" /></figure><p>We will discuss API and UI part later in this tutorial, First we will build model first. To create model we will need a dataset so download the cars.csv file from above given URL and place it under model directory. Now create car_price_predictor.ipynb file under model folder. When you will create this file it will prompt to install ipykernel package just click on install button to install it. If it is not going to prompt it then you can install it using same process of installing pip packages</p><blockquote>conda install ipykernel or pip install ipykernel</blockquote><p>Now start the model building process</p><p><strong>Step1: Import the packages</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DnfopAyAKaIXX8aaAIdsBw.png" /></figure><p><strong>Step2: Read the dataset using pandas</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*KeFtc6TdMYxXjHg4WsXWZQ.png" /></figure><p><strong>Step3: Do the Basic EDA</strong></p><p>we have total 301 cars data and 9 features that are car name, year, present price, kms driven, fuel type, seller type, transmission, owner , selling price</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*5O7xA0pYf9WOhTJ9RZ926Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*PSr9meCNiQqv5PXjL_7vWw.png" /></figure><p>This dataset is very cleaned and it is purposely taken because we don’t want to focus more on data preprocessing rather we want to see end to end process of ML project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*KLHz0Cy7VspsQdrZ-AP6zw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*cmkrrEp24TjIjj6qUjiiAw.png" /></figure><p>Let is check the correlation between variables using data.corr() method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*vqnka6QWAWte6pkd8nTZsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7Fkkx2K1YXnjjddkNre4A.png" /></figure><p>so from above heatmap, it is clear that selling price is more depends on present price, year etc</p><p><strong>Step4 : do the basic preprocessing</strong></p><p>Here few columns (Fuel type and transmission) are having text data so we will do label encoding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*LvS6wifD_PW3SqEIBu_UuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*DH8qp4JhHjATlT9JfvENHw.png" /></figure><p>For our case Selling price is target feature and all other features are input features</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Slxpq-SpihDolja4k4_ugw.png" /></figure><p>Lets divide the data into train and test, We have kept 80% training and 20% testing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*xZkLWyIfRfRwzHKaCAQ5HQ.png" /></figure><p><strong>Step 5: Do the model building</strong></p><p>Here we are going to build 7 different regression models for this tutorial. We can also add few more models also that&#39;s up to us. Here we are going to build 7 models and we will check which one is going to perform well. Also we can hyper tune these models but currently we are not going to do it. The models which we are going to use are Linear Regression, Decision Tree Regression, Random Forest Regression, Gradient Boosting Machine Regression, Light Gradient Boosting Machine Regression, Xtreme Gradient Boosting Machine Regression, Cat Boost Regression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*D6IGv0eJf5omFEbNqusreg.png" /></figure><p><strong>Step 6: Evaluate Models</strong></p><p>Now its time to evaluate these models.</p><p>For evaluating various metrics can be used, here we are going to use MAE, MSE, RMSE, R2 Score, MAPE etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*WeK1Bnjs5hB3npgUiTpMLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*ubsgPbcLMEpD8QYGQJlCeg.png" /></figure><p>This will print the following result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*kwHX4pAYRqc0L6h_Ufh_uA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*1s-MozMv57R5G8SIFqy87w.png" /></figure><p><strong>Step7 : Prediction</strong></p><p>Lets do the prediction for test data and new input data and check the results. From above result, as MAE and r2 is comparatively high in <strong>Cat Boost Model</strong> so lets use this model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*WYhPRG6BoPyU_rxJwfqz-A.png" /></figure><p><strong>Step8: Save Model</strong></p><p>Finally save the model using pickle package. You can use the <a href="https://docs.python.org/2/library/pickle.html">pickle</a> operation to serialize your machine learning algorithms and save the serialized format to a file.</p><p>Later you can load this file to deserialize your model and use it to make new predictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*SmykupfXJ9BIcEnBVC7Qpw.png" /></figure><p>So at the end of this car_price_predictor_model.pkl file will be created inside model folder which we are going to load in backend rest api.</p><h3><strong>Develop RestAPI using FastAPI</strong></h3><p>Now lets develop Rest API using FastAPI which will load model created in previous step.</p><p>FastAPI is a Web framework for developing RESTful APIs in Python. FastAPI is based on Pydantic and type hints to validate, serialize, and deserialize data, and automatically auto-generate OpenAPI documents</p><p>Lets create new python file named main.py under api folder. We need few packages that should be installed into activated environment. Install these packages with following command</p><blockquote>pip install fastapi uvicorn pydantic</blockquote><p>step1: lets import required packages</p><p>Uvicorn is an ASGI web server implementation for Python. Pydantic allows custom data types to be defined or you can extend validation with methods on a model decorated with the validator decorator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*y5hiA9cnFhsfOZ79t5Eh4Q.png" /></figure><p>step2: Load the model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*eYvnnJr5JFFGXcIx88JTVw.png" /></figure><p>step3: Create the FastAPI Instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/145/1*kC2xbFl3GvtxdkdqOc7f-w.png" /></figure><p>Here the app variable will be an “<strong>instance</strong>” of the class <strong>FastAPI</strong> . This will be the main point of interaction to create all your API</p><p>step4: create the input schema using pydantic basemodel</p><p>Pydantic models are structures that ingest the data, parse it and make sure it conforms to the fields’ constraints defined in it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*19Yd8FuV5Wm4W4Bjn4GFug.png" /></figure><p>step 5: create routes</p><p>Here we will create <strong>home route(/) </strong>which will just return “Car Price Predictor” message and <strong>predict route(/predict)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*SYssZHjNw-PmdjFGz79r9g.png" /></figure><p>Also finally we will run uvicorn server using</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*vtXBMNcn2pUAWcsM2bHYHw.png" /></figure><p>That’s it … this is API file which we can run using following command</p><blockquote>python api\main.py</blockquote><p>After running this you will see the following output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*h18sptMLyVeQ8gHgZwmxnw.png" /></figure><p>now uvicorn web server has started and swagger UI can be accessed in web browser using <a href="http://127.0.0.1:8000/docs">http://127.0.0.1:8000/docs</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P-TdLOvV_k4m5F-OWtCrvg.png" /></figure><p>If we expand predict route and give input data shown in following image and click on execute, we will get the prediction</p><p>Example — here we have received price as 8.23 Lakhs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u74Qo8TmfkqYkxH8VcUQvg.png" /></figure><p>Hoorays !!!!!!!!!!</p><p>Up to here we have done the 2 steps i.e. building ML model and integrating ML model into RestAPI. But you tell me is there any app exist without UI?? No right… If yes how end users are going to interact with it.</p><p>So lets come to last step where we will develop Simple UI using streamlit package.</p><h3><strong>Develop Front-end UI using Streamlit</strong></h3><p>Streamlit is <strong>an open source app framework in Python language</strong>. It helps us create web apps for data science and machine learning in a short time. It is compatible with major Python libraries such as scikit-learn, Keras, PyTorch, SymPy(latex), NumPy, pandas, Matplotlib etc</p><p>End users always interacts with UI. They will enter their car details here and click on predict button. When this button is clicked data entered in various UI components will be collected and passed to the API. To call API here we will requests module, Also for data parsing we will use json module. If these modules are not installed install using following command</p><blockquote>pip install streamlit requests</blockquote><p>So now create new file under <em>ui</em> folder named <em>car_price.py</em></p><p><strong>Step1: import packages</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*hdTXtQLuGyquu6cH9DNxeg.png" /></figure><p>The requests module allows <strong>you to send HTTP requests using Python</strong>. The HTTP request returns a Response Object with all the response data.</p><p><strong>Step2 : create dedicated function</strong></p><p>Set title to app and use number_input components to accept year, km_driven, present_price. Use select box for fuel_type, transmission and owner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*l-zY82RRCg42GXkhV1972g.png" /></figure><p>now create the dictionary for all those values which we have to pass to API</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*BFXLGY-hnRlVtOSQYxSNPg.png" /></figure><p>Now call the API with request module with post method, URL we have got in previous step and input data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*r6Oyvn50kl0SzpSkBjiRxw.png" /></figure><p>Now, finally call main method using</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*2icVzrrJigfvXw6B7nCEkQ.png" /></figure><p><strong>Step 3: Run Streamlit App</strong></p><p>Save the file, open the new terminal and run the file using following command. Also ensure your FastAPI is running in another terminal.</p><blockquote>streamlit run ui\car_price.py</blockquote><p>Once you run this command, you will notice that streamlit has started with following URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*f3kq6o8yd2bEbx3jeKUhTw.png" /></figure><p>Now Go to Browser and give the input and test the entire app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*609RTmMefvcLOd5gyoEz7g.png" /></figure><p>This was basic end to end complete ML app with API and UI. In next tutorials I will come with few more interested end to end ML Projects.</p><p>For Complete code, dataset please <a href="https://github.com/goradbj/MachineLearning/tree/main/Regression/CarPrice">click on this link.</a> If you liked star me on github</p><p>That’s it guys… Thank you reading this tutorial !!!! If you liked follow me on medium, YouTube and linked In.</p><p>I know this tutorial was very long and big but i hope you have understood the entire process of “How to build complete end-to-end ML model, Backend API using FastAPI and front-end UI using Streamlit”</p><p>Thank you all…!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22f64bf04476" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>