<?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 Harinder Singh Sudwal on Medium]]></title>
        <description><![CDATA[Stories by Harinder Singh Sudwal on Medium]]></description>
        <link>https://medium.com/@sudwalh?source=rss-b5f821a668a5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tkncuiKpGg7tN1gB</url>
            <title>Stories by Harinder Singh Sudwal on Medium</title>
            <link>https://medium.com/@sudwalh?source=rss-b5f821a668a5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 09:45:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sudwalh/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[End-to-End Sentiment Analysis Pipeline: From ML to FastAPI, Serverless, and Kubernetes]]></title>
            <link>https://medium.com/@sudwalh/end-to-end-sentiment-analysis-pipeline-from-ml-to-fastapi-serverless-and-kubernetes-18ce176183ad?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/18ce176183ad</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[scikit-learn]]></category>
            <category><![CDATA[mlzoomcamp]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 07:42:51 GMT</pubDate>
            <atom:updated>2026-01-05T07:42:51.356Z</atom:updated>
            <content:encoded><![CDATA[<p>Sentiment analysis is one of the most common NLP tasks. In this article, we’ll walk through building an end-to-end <strong>sentiment analysis pipeline</strong>, from <strong>data loading</strong>, <strong>model training</strong>, and <strong>evaluation</strong> to <strong>deployment using FastAPI</strong>, <strong>serverless architecture</strong>, and <strong>Kubernetes</strong> orchestration.</p><h4>Step 1: Loading and Preparing the Data</h4><p>Every ML project starts with data. For sentiment analysis.</p><h4>Step 2: Feature Engineering and Model Training</h4><p>For text data, <strong>TF-IDF vectorization</strong> is simple yet effective. We’ll train a <strong>Logistic Regression</strong> classifier for sentiment prediction.</p><h4>Step 3: Model Evaluation</h4><p>Instead accuracy, consider:</p><ul><li><strong>F1-score</strong>: Handles class imbalance better</li><li><strong>Confusion Matrix</strong>: Visualizes false positives/negatives</li><li><strong>Cross-Validation</strong>: Ensures robust performance</li></ul><h4>Step 4: Serving the Model with FastAPI</h4><p>FastAPI is perfect for building <strong>lightweight ML APIs</strong>.</p><h4>Step 5: Deploying as a Serverless Function</h4><p>Serverless deployment allows you to <strong>scale automatically</strong></p><h4><strong>Step 6: Containerization with Docker</strong></h4><p>Build and run locally:</p><pre>docker build -t app .<br>docker run -p 9696:9696 app</pre><h4>Step 7: Deploying on Kubernetes</h4><p>Kubernetes ensures <strong>scalability, reliability, and orchestration</strong>.</p><h4>Conclusion</h4><p>This end-to-end workflow covers:</p><ol><li>Loading and preprocessing sentiment data</li><li>Training and evaluating an ML model</li><li>Serving via FastAPI</li><li>Deploying serverless for cost-effective scaling</li><li>Containerization and Kubernetes orchestration</li></ol><p>By combining ML pipelines with <strong>modern deployment practices</strong>, you ensure your sentiment analysis project is <strong>production-ready, scalable, and maintainable</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18ce176183ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Kubernetes and Serving]]></title>
            <link>https://medium.com/@sudwalh/ml-kubernetes-and-serving-fcfbd2afe0e6?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcfbd2afe0e6</guid>
            <category><![CDATA[mlzoomcamp]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kind]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 20:44:54 GMT</pubDate>
            <atom:updated>2025-12-16T20:44:54.309Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Topics</em></p><ul><li>Understand Serving and Creating a pre-processing service</li><li>Running everything locally with Docker-compose</li><li>Introduction to Kubernetes</li><li>Deploying a service to Kubernetes</li><li>Deploying to Kubernetes with autoscaling (HPA)</li><li>Increasing load and observe autoscaling</li><li>HW and Summary</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcfbd2afe0e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML: Serverless]]></title>
            <link>https://medium.com/@sudwalh/ml-serverless-a14e48a91515?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a14e48a91515</guid>
            <category><![CDATA[mlzoomcamp]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 19:54:43 GMT</pubDate>
            <atom:updated>2025-12-03T19:55:08.834Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>Intro to Serverless</li></ol><p>2. AWS Lambda and Preparing the code for Lambda</p><ul><li>Creating the lambda function</li><li>API Gateway: exposing the lambda function</li><li>Deploying Scikit-Learn models with AWS Lambda, TensorFlow and PyTorch</li></ul><p>3. TensorFlow Lite</p><p>4. Preparing a Docker image</p><p>5. Homework and Summary</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a14e48a91515" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML: Neural Networks and Deep Learning]]></title>
            <link>https://medium.com/@sudwalh/ml-neural-networks-and-deep-learning-7305a28cedd3?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7305a28cedd3</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[mlzoomcamp]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 03:19:33 GMT</pubDate>
            <atom:updated>2025-12-01T03:19:33.154Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Fashion classification dataset</li><li>TensorFlow and Keras</li><li>Pre-trained convolutional neural networks</li><li>Convolutional neural networks</li><li>Transfer learning</li><li>Adjusting the learning rate</li><li>Adding more layers, regularization and dropout</li><li>Data augmentation, training a larger model and using the model</li><li>HW and Summary</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7305a28cedd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hospital Readmission Prediction for Diabetes Patients]]></title>
            <link>https://medium.com/@sudwalh/hospital-readmission-prediction-for-diabetes-patients-92aba0112ef2?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/92aba0112ef2</guid>
            <category><![CDATA[mlzoomcamp]]></category>
            <category><![CDATA[midterms]]></category>
            <category><![CDATA[hospital-readmissions]]></category>
            <category><![CDATA[capstone-project]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 22:46:11 GMT</pubDate>
            <atom:updated>2025-11-17T22:46:11.035Z</atom:updated>
            <content:encoded><![CDATA[<p>This project focuses on predicting hospital readmission for diabetes patients using machine learning. Early prediction of readmission risk helps hospitals improve patient care, reduce costs, and allocate resources more efficiently.</p><h4><strong>The steps I use:</strong></h4><ol><li><strong>Dataset is publicly available Diabetes US hospitals readmission.</strong></li><li><strong>Exploratory Data Analysis (EDA)</strong></li></ol><p>Inside the Jupyter Notebook, I performed an in-depth EDA:</p><ul><li>Understanding data shape and patient encounter structure</li><li>Studying readmission distribution (&lt;30, &gt;30, NO)</li><li>Identifying missing values, duplicates, outliers</li><li>Visualizing key relationships such as age vs. readmission, diagnoses vs. outcomes</li><li>Checking class imbalance and feature correlations</li></ul><p>This helped define the preprocessing pipeline and modeling strategy.</p><p><strong>3. Data Cleaning</strong></p><p>I applied multiple cleaning steps:</p><ul><li>Removing or fixing invalid/missing values</li><li>Handling categorical variables with consistent encoding</li><li>Converting readmission labels into a clean binary target</li><li>&lt;30 and &gt;30 → 1 (Readmitted)</li><li>NO → 0 (Not readmitted)</li><li>Dropping high-missing or irrelevant features</li><li>Normalizing numeric features where needed</li></ul><p><strong>4. Feature Engineering: Feature transformations included:</strong></p><ul><li>Encoding categorical features (Ordinal / Binary where needed)</li><li>Generating features from diagnosis codes</li><li>Creating interaction features (e.g., number_of_medications × time_in_hospital)</li><li>Bucketizing continuous features (age groups, number of visits, etc.)</li><li>Converting dates and durations into usable numeric values</li></ul><p><strong>5. Feature Selection</strong></p><p>To improve model performance:</p><ul><li>Removed low-variance or redundant features</li><li>Performed correlation and mutual information analysis</li><li>Evaluated feature importance from baseline models</li></ul><p>This reduced dimensionality and improved training efficiency.</p><p><strong>6. Model Training Workflow</strong></p><p>After EDA and preprocessing in Jupyter Notebook, I transitioned to standalone training scripts.</p><h4>Steps:</h4><ol><li>Split dataset into train/validation/test sets</li></ol><p>2. Train baseline models (Logistic Regression, Random Forest, XGBoost)</p><p>3. Apply hyperparameter tuning (GridSearchCV / RandomizedSearchCV)</p><p>4. Evaluate models using:</p><ul><li>ROC-AUC, Precision/Recall, F1-Score, Confusion Matrix</li></ul><p>Model Selection</p><p>The model with the highest ROC-AUC on the validation set was selected as the final .</p><p><strong>7. Saving the Best Model</strong></p><p>After choosing the best tuned model:</p><ul><li>Saved it as a serialized artifact (best_model.joblib)</li><li>Stored evaluation metrics in a JSON report</li><li>Organized outputs into an artifacts/ directory</li></ul><p><strong>8. Local Inference</strong></p><p>Before deployment, I tested local inference:</p><ul><li>Loaded the model inside a Python script</li><li>Ran predictions on a sample JSON test file</li><li>Verified output probability and classification logic</li></ul><p>This ensured the model was production-ready.</p><p><strong>9. Flask API for Model Serving</strong></p><p>I built a simple Flask API (app.py) that:</p><ul><li>Loads the saved model from artifacts/best_model.joblib</li><li>Accepts patient data in JSON format</li><li>Returns predicted readmission risk</li><li>Includes error handling and input validation</li></ul><p>I also created a test JSON file to simulate real requests.</p><p><strong>10. Docker Deployment</strong></p><p>To make the model portable and reproducible, I containerized the API using Docker.</p><p>Steps</p><ol><li>Created a Dockerfile including:</li></ol><ul><li>Python + required dependencies</li><li>The saved model artifact</li><li>The Flask API (app.py)</li></ul><p>2. Build and run</p><ul><li>docker build -t app.</li><li>docker run -p 9696:9696 app</li></ul><p>3. Used JSON test file to send requests and confirm the API worked:</p><p>python test.py</p><p>Everything ran successfully inside the container, confirming the API and model operated consistently across environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92aba0112ef2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML: Decision Trees & Ensemble Learning]]></title>
            <link>https://medium.com/@sudwalh/ml-decision-trees-ensemble-learning-a3b39e6756ca?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3b39e6756ca</guid>
            <category><![CDATA[mlzoomcamp]]></category>
            <category><![CDATA[ensemble-learning]]></category>
            <category><![CDATA[xgboost]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 22:49:18 GMT</pubDate>
            <atom:updated>2025-11-03T22:49:18.856Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn tree-based models and ensemble methods for better predictions.</p><p><strong>**Topics:**</strong></p><p>- Data cleaning and preparation</p><p>- Decision trees algorithm and parameter tuning</p><p>- Ensemble learning — Random Forest</p><p>- Gradient boosting (XGBoost) — parameter tuning</p><p>- Selecting the best model: Hyperparameter tuning</p><p>- Feature importance</p><p>- Summary</p><p>- Homework</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3b39e6756ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML: Module 5 Deployment]]></title>
            <link>https://medium.com/@sudwalh/ml-module-5-deployment-cb6ce7a2299f?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb6ce7a2299f</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[mlzoomcamp]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 27 Oct 2025 23:19:41 GMT</pubDate>
            <atom:updated>2025-10-27T23:21:29.091Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Model Pickle: saving and loading serialization</li><li>Web services: Serving Flask</li><li>Environment UV virtual</li><li>Docker containerization</li><li>Cloud deployment</li><li>Homework</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb6ce7a2299f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML: Evaluation Metrics for Classification]]></title>
            <link>https://medium.com/@sudwalh/ml-evaluation-metrics-for-classification-eae3a9665465?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/eae3a9665465</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[mlzoomcamp]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 01:34:44 GMT</pubDate>
            <atom:updated>2025-10-21T01:35:19.380Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Topics:</strong></p><ul><li>Accuracy, precision, recall, F1-score</li><li>ROC curves and AUC</li><li>Cross-validation</li><li>Confusion matrices</li><li>Class imbalance handling</li><li>HW</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eae3a9665465" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML for Classification]]></title>
            <link>https://medium.com/@sudwalh/ml-for-classification-4283498d48fb?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4283498d48fb</guid>
            <category><![CDATA[ml-classification]]></category>
            <category><![CDATA[churn-prediction]]></category>
            <category><![CDATA[mlzoomcamp]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 13 Oct 2025 18:33:02 GMT</pubDate>
            <atom:updated>2025-10-13T18:33:02.066Z</atom:updated>
            <content:encoded><![CDATA[<p>ML for Classification</p><p>Customer churn prediction system using logistic regression and learn about feature selection.</p><p>Topics:</p><ul><li>Data preparation, Setting up the validation test, EDA</li><li>Feature importance: Churn rate and risk ratio, Mutual information, Correlation</li><li>Categorical variable encoding</li><li>Training logistic regression with Scikit-Learn</li><li>Model interpretation</li><li>Predict using the model, output info</li><li>HW</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4283498d48fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML ZoomCamp: Regression]]></title>
            <link>https://medium.com/@sudwalh/ml-zoomcamp-regression-3a83c2f51933?source=rss-b5f821a668a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a83c2f51933</guid>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[mlzoomcamp]]></category>
            <category><![CDATA[regression]]></category>
            <dc:creator><![CDATA[Harinder Singh Sudwal]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 19:33:24 GMT</pubDate>
            <atom:updated>2025-10-06T19:33:24.820Z</atom:updated>
            <content:encoded><![CDATA[<h3>Title: 2. ML for Regression</h3><p>- Car price prediction project</p><p>- Data preparation</p><p>- Exploratory data analysis</p><p>- Linear regression</p><p>- Training linear regression: Normal equation</p><p>- Root mean squared error</p><p>- Using RMSE on validation data</p><p>- Feature engineering: Categorical</p><p>- Regularization</p><p>- Model: Baseline, Tuning and using the model for car price prediction</p><p>- Combine to output results</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a83c2f51933" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>