<?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 Areeba  Tahir on Medium]]></title>
        <description><![CDATA[Stories by Areeba  Tahir on Medium]]></description>
        <link>https://medium.com/@areeba18tahir?source=rss-2a4b50e25b94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e5RaUF6YqDSYanJ27hKCHA.png</url>
            <title>Stories by Areeba  Tahir on Medium</title>
            <link>https://medium.com/@areeba18tahir?source=rss-2a4b50e25b94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:54:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@areeba18tahir/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[The Billion-Dollar Framework: How to Choose the Right Machine Learning Model for Real-World…]]></title>
            <link>https://medium.com/@areeba18tahir/the-billion-dollar-framework-how-to-choose-the-right-machine-learning-model-for-real-world-05fb06ae0cff?source=rss-2a4b50e25b94------2</link>
            <guid isPermaLink="false">https://medium.com/p/05fb06ae0cff</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[business-models]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[model-selection]]></category>
            <dc:creator><![CDATA[Areeba  Tahir]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 17:32:51 GMT</pubDate>
            <atom:updated>2026-07-10T17:37:08.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Billion-Dollar Framework: How to Choose the Right Machine Learning Model for Real-World Business Problems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*izM1PA60qQutaPKH" /><figcaption>Photo by <a href="https://unsplash.com/@johanmouchet?utm_source=medium&amp;utm_medium=referral">Johan Mouchet</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Choosing the right machine learning model isn’t about memorizing algorithms , it’s about solving the right business problem.Many aspiring data scientists spend countless hours learning algorithms like Logistic Regression, Random Forest, XGBoost, and Neural Networks. But when faced with a real-world project or interview question, they often ask:</p><blockquote><strong><em>“Which machine learning model should I use?”</em></strong></blockquote><p>The truth is, there isn’t a universal answer.</p><p>The best model depends on <strong>the business objective, the available data, and the practical constraints of the project , </strong>not on which algorithm is currently the most popular.</p><p>In this article, you’ll learn a simple yet powerful framework that professionals use to select the right machine learning model for almost any business problem.</p><h3>Why Model Selection Starts with the Business Problem</h3><p>Many people think choosing a model is the first step in machine learning, but it isn’t.Imagine a company asks:</p><p>“<strong>Can you build a machine learning solution for us</strong>?”</p><p>A beginner might immediately respond:</p><p><strong><em>“</em>Let’s use XGBoost.”</strong></p><p>An experienced machine learning engineer responds differently.Instead of choosing an algorithm, they ask questions like:</p><ul><li>What business problem are we trying to solve?</li><li>What decision will this model improve?</li><li>How will success be measured?</li><li>What data is available?</li><li>How quickly must predictions be generated?</li><li>Does the solution need to be explainable?</li></ul><p>These questions define the problem before the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LgtQQ-TyT8DSsxan" /><figcaption>Photo by <a href="https://unsplash.com/@jo_coenen?utm_source=medium&amp;utm_medium=referral">Jo Coenen - Studio Dries 2.6</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The 7-Step Framework for Choosing the Right ML Model</h3><p>Think of model selection as a structured decision-making process rather than guessing which algorithm performs best.</p><h4>Step 1: Clearly Define the Business Objective</h4><p>Every successful machine learning project begins with understanding <strong>why</strong> the model is being built.</p><p>Whether you want to :</p><ul><li>Predict customer churn</li><li>Estimate house prices</li><li>Forecast future sales</li><li>Detect fraudulent transactions</li><li>Recommend products</li><li>Classify customer reviews</li></ul><p>Remember:</p><blockquote><strong><em>Machine learning models don’t solve algorithm problems , they solve business problems.</em></strong></blockquote><h4>Step 2: Identify the Problem Type</h4><p>Once the objective is clear, determine what type of learning problem you’re solving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*shwZZUvsEh8jo-M9igTMNw.png" /></figure><p>This single step eliminates many unsuitable algorithms before you even begin experimenting.</p><h4>Step 3: Understand Your Data</h4><p>Before selecting any algorithm, spend time understanding your dataset.</p><p>Ask yourself:</p><ul><li>How many observations do I have?</li><li>Is the data labeled?</li><li>Are there missing values?</li><li>Are the features numerical or categorical?</li><li>Is the data tabular, text, image, or audio?</li><li>Is the dataset balanced?</li></ul><p>The data often determines the model , not the other way around.We can say good bye to any fancy algorithum on the basis of just having good data .</p><h4>Step 4: Build a Simple Baseline First</h4><p>Many beginners skip this step and jump straight into complex models.</p><p><strong>Don’t…………</strong></p><p>A baseline model provides a benchmark against which every future improvement is measured.</p><h4>Good baseline models</h4><blockquote><strong><em>Classification</em></strong></blockquote><ul><li>Logistic Regression</li><li>Decision Tree</li></ul><blockquote><strong><em>Regression</em></strong></blockquote><ul><li>Linear Regression</li></ul><p>Simple models are easier to train, easier to interpret, and surprisingly competitive on many real-world datasets.</p><h4>Step 5: Improve with More Powerful Models</h4><p>If the baseline doesn’t meet business requirements, then consider moving towrds complex algorithms.</p><blockquote><strong><em>Classification</em></strong></blockquote><ul><li>Random Forest</li><li>XGBoost</li><li>LightGBM</li><li>CatBoost</li></ul><blockquote><strong><em>Regression</em></strong></blockquote><ul><li>Random Forest Regressor</li><li>XGBoost Regressor</li></ul><h4>Natural Language Processing</h4><ul><li>BERT</li><li>RoBERTa</li><li>GPT Embeddings</li></ul><h4>Computer Vision</h4><ul><li>CNN</li><li>ResNet</li><li>EfficientNet</li></ul><p>Keep in mind that higher complexity usually means:</p><ul><li>Longer training time</li><li>Higher computational cost</li><li>More difficult deployment</li><li>Reduced interpretability</li></ul><p>The most accurate model isn’t always the best business solution.</p><h4>Step 6: Evaluate What Actually Matters</h4><p>A common beginner mistake is optimizing only for <strong>Accuracy</strong>.Businesses care about outcomes , not just metrics.</p><h4>Classification Metrics</h4><ul><li>Accuracy</li><li>Precision</li><li>Recall</li><li>F1 Score</li><li>ROC-AUC</li></ul><h4>Regression Metrics</h4><ul><li>MAE</li><li>RMSE</li><li>R²</li></ul><h4>Clustering</h4><ul><li>Silhouette Score</li></ul><h4>Time Series</h4><ul><li>MAPE</li><li>RMSE</li></ul><p>For example, in fraud detection, missing fraudulent transactions is often far more costly than investigating a few extra legitimate ones. That’s why Recall may matter more than Accuracy.</p><h4>Step 7: Consider Business Constraints</h4><p>Even an excellent model may fail if it can’t be deployed effectively.</p><p>Ask yourself:</p><ul><li>Is explainability required?</li><li>How expensive is training?</li><li>How fast must predictions be generated?</li><li>Can the model scale?</li><li>Is maintenance practical?</li><li>Are there regulatory requirements?</li></ul><p>In industries like healthcare and finance, interpretable models are often preferred over highly accurate black-box models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZhPLoj8iy81dEXNu" /><figcaption>Photo by <a href="https://unsplash.com/@rutmiit?utm_source=medium&amp;utm_medium=referral">RUT MIIT</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Use-Case : Telecom Company trying to Predict Customer Churn</h3><p>Let’s apply the framework.</p><h4>Business Objective</h4><p>A telecom company wants to identify customers who are likely to cancel their subscriptions.</p><h4>Available Features</h4><ul><li>Customer age</li><li>Monthly bill</li><li>Contract type</li><li>Internet package</li><li>Customer tenure</li><li>Number of complaints</li><li>Payment method</li></ul><h4>Step 1 : Define the Goal</h4><p>Reduce customer churn through proactive retention campaigns.</p><h4>Step 2 : Identify the Task</h4><p>Target variable:</p><p><strong>Will the customer leave?</strong></p><p>This is a <strong>Binary Classification</strong> problem.</p><h4>Step 3 : Analyze the Data</h4><p>The dataset contains:</p><ul><li>Structured tabular data</li><li>Numerical features</li><li>Categorical features</li><li>Historical labels</li></ul><h4>Step 4 : Build a Baseline</h4><p>Start with <strong>Logistic Regression</strong> because it is:</p><ul><li>Fast</li><li>Interpretable</li><li>Easy to deploy</li><li>A strong benchmark</li></ul><h4>Step 5 : Improve Performance</h4><p>Experiment with:</p><ul><li>Random Forest</li><li>XGBoost</li></ul><p>These models capture nonlinear relationships and feature interactions that Logistic Regression cannot.</p><h4>Step 6 : Evaluate</h4><p>Rather than Accuracy alone, prioritize:</p><ul><li>Recall</li><li>F1 Score</li><li>ROC-AUC</li></ul><p>These metrics better reflect the business goal of identifying customers at risk of leaving.</p><h4>Step 7 : Deliver Business Value</h4><p>The marketing team can target high-risk customers with loyalty rewards or special offers, reducing churn and increasing customer lifetime value.</p><h3>Say ‘’NO’’ to these</h3><p>⚠️ Choosing an algorithm before understanding the business problem.</p><p>⚠️ Using deep learning for every task.</p><p>⚠️ Evaluating models with Accuracy alone.</p><p>⚠️ Ignoring explainability and deployment constraints.</p><p>⚠️ Skipping baseline models.</p><p>⚠️ Assuming the most complex model is always the best.</p><h3>The Billion-Dollar Lesson</h3><ol><li><em>Machine learning is a business decision-making tool, not just a technical skill.</em></li><li><em>The success of a machine learning project depends on solving the right business problem, not on using the most advanced algorithm.</em></li><li><em>A good model creates business value by helping organizations make smarter decisions, reduce costs, increase revenue, improve operational efficiency, and enhance customer experience.</em></li><li><em>Always understand the business objective before selecting a machine learning model, as the problem defines the solution.</em></li><li><em>Thinking from a business perspective is what transform a machine learning engineer into a trusted problem solver who delivers real-world impact.</em></li><li><em>Your ability to explain why a model is the right choice is often more valuable than simply knowing how to build it.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05fb06ae0cff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Felt Lost in Data Preprocessing… Until I Started Recognizing Data Patterns]]></title>
            <link>https://medium.com/@areeba18tahir/i-felt-lost-in-data-preprocessing-until-i-started-recognizing-data-patterns-3554aa0cf55d?source=rss-2a4b50e25b94------2</link>
            <guid isPermaLink="false">https://medium.com/p/3554aa0cf55d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Areeba  Tahir]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 06:47:00 GMT</pubDate>
            <atom:updated>2026-06-21T06:47:00.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KK3BiOH9VahkBfSo" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Data preprocessing gave me a <strong>tough time</strong> when I was diving into machine learning.</p><p>Not because I didn’t study it…</p><p>But because there are a lot of different datasets, different data types, and many preprocessing techniques.And I struggled a lot with one thing:</p><blockquote><strong><em>Which preprocessing technique should I apply on which dataset and when ?</em></strong></blockquote><p>At that time, everything felt confusing and mixed up in my mind.When things get messy.I quickly go to ChatGPT.It feels like a security guard in my life… like it will save me from every problem I come across.I started asking:</p><blockquote><strong><em>Here is my dataset… what preprocessing technique should I apply?</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*j4GL4LX3ZRjETildRyJlww.jpeg" /></figure><p>ChatGPT gave me steps, and I followed them.It worked.But something didn’t feel right.After repeating this process for some time, I noticed something uncomfortable.I was not thinking anymore.I was just:</p><ul><li><strong>Copying instructions</strong></li><li><strong>Running code</strong></li><li><strong>Getting output</strong></li></ul><p>And slowly, a question came to my mind:</p><blockquote><strong><em>If I always depend on ChatGPT, then where is my own thinking and problem-solving skill?</em></strong></blockquote><p>That hit me hard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hZYWXpef-MSZSdT_" /><figcaption>Photo by <a href="https://unsplash.com/@happysurd?utm_source=medium&amp;utm_medium=referral">Happysurd Photography</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One day, after struggling again with another dataset, something clicked in my mind.I realized data preprocessing is not just about applying different techniques , it is more about a decision making process.I need to decide it myself after looking at the dataset. <em>Which technique should I apply, and which will give the best outcome?</em> If I really want to become a good AI engineer, then answers to these questions should came into my mind within a couple of seconds after seeing a dataset.</p><p>So I stopped rushing into ChatGPT immediately.Instead, I started doing something different.Whenever I saw a new dataset, I paused for a moment.I asked myself simple questions as i hear from someone that questioning improves your understanding :</p><p><strong>1. What type of data is this?<br> 2. What problems does this data contain?<br> 3. What format does the model need?</strong></p><p>And these answers started telling me what preprocessing to apply and where.In this way, slowly, things started making more sense.At first, I was slow. I was not getting instant answers like ChatGPT gives.But I was building something more important , <strong>my thinking ability</strong>. Using ChatGPT was never the problem.The real problem was how I was using it.Earlier, I was using it as a replacement for thinking.Now, I started using it as a tool to confirm my thinking.</p><blockquote><strong><em>First I try on my own…<br> Then I check with ChatGPT.</em></strong></blockquote><p>And over time, something started changing in me.When I saw a dataset, I didn’t feel lost anymore.I started recognizing patterns:</p><ul><li>Oh, this is missing values problem</li><li>This column needs encoding</li><li>This feature needs scaling</li><li>This text needs cleaning</li></ul><p>It stopped feeling random. It started feeling logical.So let me share exactly what I learned , the same mental framework that made preprocessing click for me. So we can quickly figure out which technique to apply to a particular dataset.Let’s break it down by data type, because that’s where it all starts.</p><h3><strong>What is Data Preprocessing?</strong></h3><p>Data preprocessing is the process of converting raw, messy, real-world data into a clean format that machine learning models can understand.</p><p>Machine learning models cannot properly learn from messy data.So preprocessing helps us prepare the data before training.</p><h3><strong>Types of Data</strong></h3><p>Before doing any data preprocessing step, you first need to understand data types and what goal you are trying to achieve with that data.In the real world, there are many types of data you deal with, but some main types are mentioned here:</p><h4>• <strong>Tabular Data</strong></h4><h4>• <strong>Image Data</strong></h4><h4>• <strong>Text Data</strong></h4><h4>• <strong>Audio Data</strong></h4><h4>• <strong>Time-Series Data</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*QMrKUeyzXXaYGmfgz_QCtw.png" /></figure><p>So step by step i will deep dive into each data type .</p><h3>1. Tabular Data (CSV / Excel / Database)</h3><p>Tabular data is the most common type of dataset in machine learning.It is structured in the form of rows and columns, similar to spreadsheets.</p><h4>Examples:</h4><ul><li>House Price Prediction</li><li>Customer Churn Prediction</li><li>Adult Income Prediction</li><li>Loan Approval Systems</li></ul><h4>Dataset:</h4><pre>| Age | Salary | Gender | Purchased |<br><br>| 25 | 50000 | Male | Yes |<br>| 30 | 60000 | Female | No |<br>| 22 | 35000 | Male | Yes |<br>| 28 | 45000 | Female | No |<br>| 35 | 70000 | Male | Yes |</pre><p>Each row represents one record, and each column represents a feature.</p><h3>Common Preprocessing Steps For Tabular Data</h3><h4>i. Handling Missing Values</h4><p>Real-world datasets are never clean. Missing values are very common.We first check them using:</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>df.isnull().sum()</pre><p>Then we handle them using:</p><ul><li>Mean (for numerical data)</li><li>Median (for skewed data)</li><li>Mode (for categorical data)</li></ul><h4>ii. Encoding Categorical Variables</h4><p>Machine learning models cannot understand text directly like:</p><ul><li>Male</li><li>Female</li><li>Yes</li><li>No</li></ul><p>So we convert them into numbers.Common methods:</p><ul><li>Label Encoding</li><li>One-Hot Encoding</li></ul><p>This converts categories into binary columns.Example:</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>pd.get_dummies(df)</pre><h4>iii. Feature Scaling</h4><p>Different features often have different ranges.</p><p>Example:</p><ul><li>Salary → 50000</li><li>Age → 25</li></ul><p>This can confuse many ML algorithms.So we scale them using:</p><ul><li>Standardization (mean = 0, std = 1)</li><li>Normalization (0 to 1 range)</li></ul><h4>iV . Removing Duplicates</h4><p>Duplicate rows can be confusing.So removibg them is alos essential.Here is the statement for removing it .</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>df.drop_duplicates()</pre><h3>2 . Image Data</h3><p>Image data is completely different from tabular data.Here, a computer does not see “images” , it sees pixel values.Examples:</p><ul><li>Cat vs Dog classification</li><li>Face recognition</li><li>Medical imaging</li></ul><h3>Common Preprocessing Steps for Images</h3><h4>i . Resizing Images</h4><p>Most models require fixed-size input images.</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>image = cv2.resize(image, (224, 224))</pre><h4>ii. Normalization</h4><p>Pixel values range from 0 to 255. We scale them.This helps neural networks learn faster and more efficiently.</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>image = image / 255.0</pre><h4>iii. Data Augmentation</h4><p>To improve model generalization, we artificially increase dataset size by transforming images:</p><ul><li>rotation</li><li>flipping</li><li>zooming</li><li>cropping</li></ul><p>This helps the model learn better patterns instead of memorizing data.</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from torchvision import transforms<br>transform = transforms.Compose([<br> transforms.RandomRotation(30), # rotation<br> transforms.RandomHorizontalFlip(), # flipping<br> transforms.RandomResizedCrop(224), # cropping + zoom<br> transforms.RandomAffine(degrees=0, scale=(0.8, 1.2)) # zoom<br>])</pre><h3>3. Text Data</h3><p>Text data cannot be used directly by ML models. We must convert it into a numerical format.</p><p>Examples:</p><ul><li>Sentiment Analysis</li><li>Spam Detection</li><li>Chatbots</li></ul><h3>Common Preprocessing Steps For Text Data</h3><h4><strong>i. Lowercasing</strong></h4><p>This reduces redundancy and overall text sounds similar .</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>text = text.lower()</pre><h4>ii . Tokenization</h4><p>Splitting sentences into words:</p><p><strong>Sentence -&gt; [ “This movie was amazing”]</strong></p><p><strong>Words -&gt; [“This”, “movie”, “was”, “amazing”]</strong></p><h4>iii . Removing Stopwords</h4><p>Common words like:</p><ul><li>the</li><li>is</li><li>and</li></ul><p>They do not add much meaning.</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from nltk.corpus import stopwords<br>from nltk.tokenize import word_tokenize<br>text = &quot;This is an example of removing stopwords from text data&quot;<br>stop_words = set(stopwords.words(&#39;english&#39;))<br>tokens = word_tokenize(text)<br>filtered_text = [word for word in tokens if word.lower() not in stop_words]<br>print(filtered_text)</pre><h4>iv . Stemming</h4><p>Stemming is a <strong>rule-based process</strong> that cuts off word endings to get a root form.</p><ul><li>It is fast but rough</li><li>The result may not be a real word</li><li>Not context aware .</li></ul><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from nltk.stem import PorterStemmer<br>stemmer = PorterStemmer()<br>words = [&quot;studies&quot;, &quot;running&quot;, &quot;playing&quot;, &quot;dancing&quot;]<br>for word in words:<br> print(word, &quot;→&quot;, stemmer.stem(word))</pre><h4>Examples:</h4><p>studies → studi</p><h4>v . Lemmatization</h4><p>Lemmatization reduces words to their <strong>dictionary form (lemma)</strong> using vocabulary + grammar rules.</p><ul><li>It is <strong>slower but accurate</strong></li><li>Output is always a real word</li><li>Context Aware</li></ul><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from nltk.stem import WordNetLemmatizer<br>lemmatizer = WordNetLemmatizer()<br>words = [&quot;studies&quot;, &quot;running&quot;, &quot;better&quot;, &quot;cars&quot;]<br>for word in words:<br> print(word, &quot;→&quot;, lemmatizer.lemmatize(word))</pre><h4>Example:</h4><ul><li>“studies” → “study”</li></ul><h4>vi . Text Vectorization</h4><p>Since models need numbers, we convert text using:</p><ul><li>Bag of Words</li><li>TF-IDF</li></ul><h4><strong>. Bag of Words</strong></h4><p>Bag of Words (BoW) converts text into numbers by counting how many times words appear in the text.</p><h4><strong>Example:</strong></h4><p>Sentence 1: “I love machine learning”</p><p>Sentence 2: “Machine learning is amazing”</p><p>First, we create a vocabulary of all unique words:</p><pre>[I, love, machine, learning, is, amazing]</pre><p>Then we count how many times each word appears in each sentence</p><pre>| Sentence                    | I | love | machine | learning | is | amazing |<br><br>| I love machine learning     | 1 | 1    | 1       | 1        | 0  | 0       |<br>| Machine learning is amazing | 0 | 0    | 1       | 1        | 1  | 1       |</pre><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from sklearn.feature_extraction.text import CountVectorizer<br>docs = [&quot;I love machine learning&quot;, &quot;Machine learning is amazing&quot;]<br>vectorizer = CountVectorizer()<br>X = vectorizer.fit_transform(docs)<br>print(X.toarray())<br>print(vectorizer.get_feature_names_out())</pre><h4><strong>. TF-IDF</strong></h4><p>TF-IDF is a technique used to show how important a word is in a document compared to all other documents.It gives high value to important words and low value to common words.</p><ul><li><strong>TF (Term Frequency)</strong> → how often a word appears in a document</li><li><strong>IDF (Inverse Document Frequency)</strong> → how rare that word is in all documents</li><li><strong>TF-IDF</strong> → combines both to find important words</li></ul><p>Sentence 1:<br> “I love machine learning”</p><p>Sentence 2:<br> “Machine learning is amazing”</p><p>Words like <strong>“machine”</strong> and <strong>“learning”</strong> appear in both sentences → less important<br> Words like <strong>“love”</strong> or <strong>“amazing”</strong> → more unique → more important</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from sklearn.feature_extraction.text import TfidfVectorizer<br>docs = [&quot;I love machine learning&quot;, &quot;Machine learning is amazing&quot;]<br>tfidf = TfidfVectorizer()<br>X = tfidf.fit_transform(docs)<br>print(X.toarray())</pre><h3>4. Audio Data</h3><p>Audio data is waveform-based and requires specialized preprocessing.</p><p><strong>Examples:</strong></p><ul><li>Speech recognition</li><li>Voice assistants</li><li>Emotion detection</li></ul><h3>Common Preprocessing Steps For Audio Data</h3><ul><li>Noise reduction</li><li>Resampling</li><li>MFCC feature extraction</li><li>Trimming silence</li></ul><p><strong>Libraries used:</strong></p><ul><li>librosa</li><li>torchaudio</li></ul><h4><strong>i. Noise reduction</strong></h4><p>Removing unwanted background sounds from audio</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>import librosa<br>import noisereduce as nr<br># Load audio file<br>audio, sr = librosa.load(&quot;audio.wav&quot;, sr=None)<br># Apply noise reduction<br>reduced_noise = nr.reduce_noise(y=audio, sr=sr)</pre><h4><strong>ii. Trimming silence</strong></h4><p>Removing quiet or empty parts from the beginning and end of audio</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>import librosa<br>import librosa.display<br>audio, sr = librosa.load(&quot;audio.wav&quot;, sr=22050)<br># Trim silence<br>audio, _ = librosa.effects.trim(audio)</pre><h4><strong>iii. MFCC feature extraction</strong></h4><p>Converting audio into useful numerical features so a model can understand sound patterns</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre># MFCC features<br>mfcc = librosa.feature.mfcc(y=audio, sr=sr, n_mfcc=13)<br>print(mfcc.shape)</pre><h4><strong>iv. Resampling</strong></h4><p>Changing the audio sampling rate (making it higher or lower)</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>audio, sr = librosa.load(&quot;audio.wav&quot;, sr=44100)<br>audio_resampled = librosa.resample(audio, orig_sr=sr, target_sr=22050)</pre><h3>5. Time-Series Data</h3><p>Time-series data depends on order and time.</p><p><strong>Examples:</strong></p><ul><li>Stock market prediction</li><li>Weather forecasting</li><li>Sensor data</li></ul><h3>Common Preprocessing Steps For Time-Series Data</h3><ul><li>datetime conversion</li><li>handling missing timestamps</li><li>rolling windows</li><li>trend analysis</li><li>seasonality handling</li></ul><h4><strong>i. Datetime conversion</strong></h4><p>Converting date strings into proper date format so Python can understand time.</p><p><strong>Example :</strong><br> “2024–01–01” → real datetime object</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>import pandas as pd<br>df[&#39;date&#39;] = pd.to_datetime(df[&#39;date&#39;])</pre><h4>ii. Handling missing timestamps</h4><p>Filling or fixing missing dates in a time sequence</p><p><strong>Example :</strong><br> If data has dates and date jan2 is missing then we will fix it :</p><ul><li>Jan 1</li><li>Jan 2 (fix)</li><li>Jan 3</li></ul><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>df = df.set_index(&#39;date&#39;)<br>df = df.asfreq(&#39;D&#39;) # daily frequency</pre><h4>iii. Rolling window</h4><p>Calculating values over a moving time window.</p><p><strong>Example :</strong><br> Average of last 3 days, updated every day.</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>df[&#39;rolling_mean&#39;] = df[&#39;value&#39;].rolling(window=3).mean()</pre><h4><strong>iv. Trend analysis</strong></h4><p>Finding whether data is going up or down over time.</p><p><strong>Example :</strong><br> Stock price increasing → upward trend<br> Temperature decreasing → downward trend</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>df[&#39;trend&#39;] = df[&#39;value&#39;].diff()</pre><h4><strong>v. Seasonality</strong></h4><p>Detecting repeating patterns over time.</p><p><strong>Example :</strong></p><p>Higher sales of clothing, shoes, cosmetics, and jewelry at event of Eid al-Fitr and Eid al-Adha Season</p><blockquote><strong><em>Code Snippet</em></strong></blockquote><pre>from statsmodels.tsa.seasonal import seasonal_decompose<br>result = seasonal_decompose(df[&#39;value&#39;], model=&#39;additive&#39;, period=12)<br>result.plot()</pre><p>So these are the data preprocessing techniques for all types of data. From all this, we can clearly understand that data preprocessing is not about memorizing techniques ,it is about understanding data. Every dataset tells a different story.</p><p>Some datasets are incomplete.<br> Some are noisy.<br> Some contain inconsistent patterns.<br> Some need cleaning.<br> Some need transformation.</p><p>And as AI engineers, our job is to understand what the data actually needs before applying anything blindly.So if you are also struggling with preprocessing right now, You don’t need to worry .Almost every beginner goes through this phase.</p><p><strong>&gt; Take your time <br> &gt; Make your hand dirty with different datasets<br> &gt; Ask questions.<br> &gt; Try preprocessing on your own first.</strong></p><p>Because over time, your brain starts recognizing patterns automatically.And one day, preprocessing will stop feeling confusing…and start feeling logical.So don’t rush the process.<br>Keep exploring and keep building !!</p><p>👉 <strong>Follow me on Medium for more stories about AI , women in tech, and student life.</strong></p><p>👉 <strong>Leave a comment , </strong>I’d love to hear your story too.</p><p>👉 <strong>Give this story a few claps</strong> to help it reach more people who might need this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3554aa0cf55d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Full End-to-End Machine Learning Pipeline]]></title>
            <link>https://medium.com/@areeba18tahir/how-to-build-a-full-end-to-end-machine-learning-pipeline-5a7ad1321a8f?source=rss-2a4b50e25b94------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a7ad1321a8f</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[ml-model-deployment]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <dc:creator><![CDATA[Areeba  Tahir]]></dc:creator>
            <pubDate>Sun, 17 May 2026 07:55:14 GMT</pubDate>
            <atom:updated>2026-05-17T07:57:05.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*Ni5M2qwdtm6F4UpKE0x99g.png" /></figure><p>When I was new to machine learning, I remember my professor giving us a project. At that time, I had already learned the basic concepts regression, classification, and model training. Everything made sense in theory. But when I actually tried to build a full machine learning system, I struggled.</p><p>This was different from my previous projects. I used to build projects with my friends, but this was my first solo project , an Adult Income Prediction System. And I was completely on my own.</p><p>I could understand the algorithms, but I didn’t understand how everything connects in a real project. That night, sitting in front of my laptop with a confused mind, I felt completely stuck, thinking:</p><blockquote><strong><em>How do I actually build a full ML system? What should I do first? What comes at the end?</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*AYn4tfasnOmf-ifoyu4RJw.jpeg" /></figure><p>I didn’t have a clear answer. I even spent 2 hours just trying to give the correct path to the dataset.It was 1 AM. Tomorrow was the viva of my project. And till now, I had only managed to give the dataset path ,nothing else. I kept checking the time on my phone repeatedly, and it was passing so quickly. I was thinking: I don’t know if I’ll be able to complete this project by morning.”</p><p>I started searching blindly on the internet. For a few hours, I kept jumping from one source to another. One site explained data preprocessing, another talked about deployment, and another mentioned algorithms, but nothing felt complete.</p><blockquote>It was all scattered.</blockquote><p>Still, I picked small pieces of knowledge from different places and slowly started connecting them together. After that struggle, I finally built my first complete machine learning project.</p><p>But now I am here on Medium, going to make your journey of building a practical ML system a little bit easier…. My focus is on practical ML systems that can create real-world impact in production.</p><p>Okay, so now when we look into the real world, we see a lot of problems arising, and in the era of technology, we can solve them using machine learning systems. Let’s take a deep dive into the pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*Hqctq3XuqlPyPJGR.jpg" /></figure><h3>What is an End-to-End ML Pipeline?</h3><p>A complete workflow by which we can turn our raw data into a machine learning model that will solve a real-world problem and create an impact for its users.</p><p>So here I am going to mention some key steps involved in a full machine learning pipeline:</p><p>● <strong>Collection of Data</strong><br> ● <strong>Preprocessing of Data<br> ● Feature Engineering<br> ● Model Training<br> ● Evaluation of Model<br> ● Deployment<br> ● Monitoring and Retraining</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukOYd5gdoX5G0HDwgW-Qqw.png" /><figcaption><strong>Machine Learning Pipeline</strong></figcaption></figure><h3>1. Understanding the Problem</h3><p>Before building any machine learning model, we must understand the problem we are going to solve. It’s the foundation of your whole project. It gives you a clear idea of what you want to achieve.</p><p>For this, you must clearly define:</p><h4>What is the goal?</h4><p>Predict something? (price, spam, pass/fail)<br>Classify something? (image, text, sentiment)<br>Recommend something? (products, videos)</p><h4>Who is the user?</h4><p>Mobile app users?<br>Website users?<br>Chatbot users?</p><h4>What is the output?</h4><p>Number? (regression)<br>Category? (classification)<br>Text response? (LLMs/chatbots)</p><h4>Success criteria</h4><p>Accuracy?<br>Speed?<br>Real-time response?</p><p>After knowing all this, we can better understand and build effective machine learning systems for real users.</p><h3>2. Collection of Data</h3><p>Data is the foundation of AI models. First, we have to deal with data because AI is nothing without it. There are many ways to get data, such as databases, APIs, Kaggle, UCI Machine Learning Repository, and web pages.</p><p>While collecting data, you should keep some important things in mind in order to build a good ML model. I am listing them here:</p><h4>• Relevant Data</h4><p>Your data must be relevant to the problem you are trying to solve.</p><h4>• Quality of Data</h4><p>Data should be clean, correct, and as error-free as possible.</p><h4>• Quantity of Data</h4><p>Take enough data so that your model can learn patterns effectively. Too little data leads to memorization instead of learning patterns.</p><h4>• Diversity</h4><p>Edge cases and different scenarios should be covered in your dataset so that the model can generalize well.</p><p><strong>Real-World Example: </strong>Suppose we are building a<strong> recommendation system </strong>for a platform like <strong>YouTube </strong>or <strong>Netflix</strong>.We use user data such as watch history, likes, watch time, and search behavior to predict what a user is likely to watch next.In general, users tend to follow consistent patterns , for example, someone who watches tech videos will likely continue watching similar content.But there are always edge cases. Sometimes a user suddenly explores completely different genres or starts watching trending content that doesn’t match their usual behavior.These variations are important because they help the model become more flexible and realistic, instead of just learning rigid patterns. In the end, they improve personalization and make the system work better in real-world scenarios.</p><h4>• <strong>Bias and Fairness</strong></h4><p>Data should be bias-free. No single group of any feature should be given unfair importance. Everything should be balanced.</p><h4>• Privacy and Ethics</h4><p>While collecting data, we should avoid collecting sensitive personal information without consent. We must respect legal and ethical rules.</p><h4>• Consistency and Timing</h4><p>Make sure data is in a consistent format. If the problem depends on current conditions, you should use up-to-date data.</p><h4>• Proper Labeling</h4><p>The dataset should be properly labeled with correct formatting so that you do not face issues during preprocessing.</p><h3>3. Preprocessing of Data</h3><p>In the real world, you can never get perfectly clean data. If you think you can, then you might live in the fantasy world.</p><p>We clean the dataset by handling missing values, removing duplicates, encoding categorical variables, and much more. This makes the data suitable for machine learning models.</p><h3>4. Feature Engineering</h3><p>Want to build a model that performs better in the real world? Then feature engineering is one of the most important steps.</p><p>Feature engineering is the process of using domain knowledge to select, transform, and create useful features from raw data so that machine learning models can learn patterns more effectively.</p><p>In this step, domain understanding really matters.</p><h3>5. Model Training</h3><p>After dealing with data, we move to model training, which involves applying different machine learning algorithms. Here are some commonly used algorithms:</p><h4>• Linear Regression<br>• Random Forest<br>• XGBoost<br>• LightGBM<br>• SVM<br>• KNN<br>• Naive Bayes</h4><p>We must choose an algorithm according to our problem and train the model using that algorithm.</p><h3>6. Evaluation of Model</h3><p>Once we are done with model training, we check how well our machine learning model performs in the real world. For this, we use evaluation metrics such as Accuracy, Precision, Recall, F1 Score, RMSE, and ROC-AUC.</p><p>Our main goal is to test whether the model performs well on unseen data. If your model performs well only on training data and not on test data, it means it will fail in real-world scenarios.</p><p>Then you can save your model using pickle or joblib.</p><h3>7. Deployment &amp; CI/CD</h3><p>After putting in a lot of effort from data collection to evaluation, we must deploy our model in a real-world production system so that it can be used by users across the world.</p><p>This is the point where your model becomes real and available as a live service on the internet.</p><p>To deploy our model, we use <strong>FastAPI,</strong> one of the most preferred tools among developers. It allows the model to accept user requests and acts as a bridge between users and the ML model.</p><p>After building an API for your ML model, we containerize the entire system using <strong>Docker</strong>. We use Docker because otherwise the system may work on one machine but fail on others. Docker ensures consistency across environments.</p><p>Next comes cloud platforms such as <strong>Amazon Web Services, Google Cloud, </strong>and <strong>Microsoft Azure</strong>. We use them to host our model online.</p><p>These platforms help us:</p><ul><li>Run APIs 24/7</li><li>Handle large traffic</li><li>Provide storage and scalability</li></ul><p>So in this way, your entire ML system becomes available to the public.</p><h3>8. Monitoring and Retraining</h3><p>Deployment is not the end of the machine learning pipeline. We still need to monitor how the system performs in the real world.</p><ul><li>Keep an eye on model performance over time</li><li>Detect changes in input data patterns</li><li>Retrain the model when needed</li></ul><p>This ensures the model stays useful in real-world scenarios.</p><h3>Keep Learning, Keep Building</h3><p>Training a model is easy. Building a working system is the real skill. That’s what separates beginners from real AI engineers.Real impact in machine learning comes when your model survives real-world data, scales with users, and keeps improving over time. That is where true engineering begins.</p><p>And the best way to truly understand this is not just by reading ,but by building your own machine learning projects, experimenting with data, making mistakes, and improving step by step.</p><p><strong>So don’t just learn ML… start building with it.</strong></p><p>If there is any concept from this pipeline that you didn’t fully understand, drop it in the comments. I’ll break it down and explain it in a simple way so you can understand it better.</p><p><strong>→ Stay updated with me on Medium for more stories about machine learning, Nlp, and advanced AI technologies.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a7ad1321a8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>