<?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 Muhammad Ibrahim Qasmi on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Ibrahim Qasmi on Medium]]></description>
        <link>https://medium.com/@ibrahim313?source=rss-5e9969986d55------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ukxpwTFhkUUnagrU0PrgyA.png</url>
            <title>Stories by Muhammad Ibrahim Qasmi on Medium</title>
            <link>https://medium.com/@ibrahim313?source=rss-5e9969986d55------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:26:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ibrahim313/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[Automate Your ML Deployments with GitHub Actions: CI/CD for Dockerized APIs]]></title>
            <link>https://medium.com/@ibrahim313/automate-your-ml-deployments-with-github-actions-ci-cd-for-dockerized-apis-614e9ef28947?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/614e9ef28947</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Sun, 03 May 2026 03:05:22 GMT</pubDate>
            <atom:updated>2026-05-03T03:05:22.744Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lXeDggvahVSaMT6I1h48VA.png" /></figure><h3><strong>Push your code. Watch it deploy. Never manually build again.</strong></h3><p>This is <strong>Part 4</strong> of my ML deployment series.</p><p>In the previous articles, we deployed ML models using <strong>FastAPI</strong>, <strong>Hugging Face Spaces</strong>, and <strong>Docker</strong>. Each time, there was a <strong>manual step</strong>: run docker build, run docker push, go to Render and click deploy.</p><p>→ Part 1: <a href="https://claude.ai/chat/LINK_TO_PART_1">Deploy Your First Machine Learning Model as a Public API</a></p><p>→ Part 2: <a href="https://claude.ai/chat/LINK_TO_PART_2">Deploy Your First Deep Learning Model on Hugging Face</a></p><p>→ Part 3: <a href="https://claude.ai/chat/LINK_TO_PART_3">The Only Docker Tutorial Data Scientists Actually Need</a></p><p><em>It works. But imagine doing this every time you fix a bug or update your model. Or worse, imagine a teammate deploys the wrong version because they forgot a step.</em></p><p>What if pushing your code to <a href="https://github.com/">GitHub</a> automatically built your Docker image, pushed it to Docker Hub, and deployed it to Render? You push code, go get coffee, come back to a live updated API.</p><p>That is <strong>CI/CD</strong>. <strong>Continuous Integration, Continuous Deployment.</strong> It sounds fancy but it is just automation. And GitHub Actions makes it surprisingly simple to set up.</p><p>This guide will create a complete automation pipeline. By the end, you will never manually deploy again.</p><p><em>No DevOps background needed. Takes about 20 minutes to set up.</em></p><h3>What We Will Build</h3><p>We will take the Dockerized ML API from Article 3 and add GitHub Actions to automate everything.</p><p><strong>The workflow after setup:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4sDHflEiQPp16oDggGWNQ.png" /><figcaption>workflow</figcaption></figure><p>All of this happens in about 3-4 minutes. You do not touch any buttons.</p><h3>Prerequisites</h3><p><strong>Before starting, make sure you have:</strong></p><ul><li>The Dockerized ML project from Article 3 (or any Docker project with a working Dockerfile)</li><li>A GitHub account with a repository for your project</li><li>A Docker Hub account (free)</li><li>A Render account with your service already deployed</li><li>Git installed on your computer</li></ul><p>If you skipped Article 3, you need a project with these files at a minimum:</p><ul><li>app.py (your FastAPI application)</li><li>model.pkl (your trained model)</li><li>requirements.txt (Python dependencies)</li><li>Dockerfile (container configuration)</li></ul><blockquote>Note: If you have not followed the previous article, you can still continue from here. The <a href="https://github.com/muhammadibrahim313/docker-for-data-scientists">GitHub repository</a> contains the complete project setup, including the Dockerized API from <a href="https://medium.com/@ibrahim313/the-only-docker-tutorial-data-scientists-actually-need-19e0a41a6c22">Article 3</a> and the CI/CD workflow for this article. Simply clone the repository, add your own Docker Hub and Render secrets, and you will be ready to run the pipeline.</blockquote><h3>Why CI/CD Matters for Data Scientists</h3><p>You might think: “I can just run the commands myself. Why automate?”</p><p><strong>Here is what happens without CI/CD:</strong></p><p><strong>The “I forgot” problem.</strong> You fix a bug, commit it, push to GitHub, feel accomplished… and forget to rebuild and push the Docker image. Your production API still has the bug.</p><p><strong>The “which version” problem.</strong> You have three versions of the model. You deployed one of them last week. Which one is live right now? You are not sure.</p><p><strong>The “works on my machine” problem.</strong> Your teammate pulls your code, builds the image on their laptop, and pushes it. But they have different Python packages installed. The container works for them, but it crashes in production.</p><p><strong>The “2 AM deployment” problem.</strong> Something breaks at 2 AM. You need to deploy a fix. Half asleep :( , you mistype a command. Now you have two problems.</p><p><strong>CI/CD solves all of this:</strong></p><ul><li><strong>Consistency.</strong> Every build happens the same way, on the same machine (GitHub’s servers), with the same steps.</li><li><strong>Traceability.</strong> Every deployment is linked to a specific commit. You always know what is running.</li><li><strong>Speed.</strong> Push and walk away. The pipeline handles everything.</li><li><strong>Reliability.</strong> No typos, no forgotten steps, no “oops I pushed to the wrong registry.”</li></ul><p>Every serious ML team uses CI/CD. Learning it now prepares you for real jobs.</p><h3>Step 1: Make Sure Your Project is on GitHub</h3><p>If your Docker project is not on GitHub yet, let us fix that.</p><p>Navigate to your project folder:</p><pre>cd docker-for-data-scientists</pre><p>Initialize git if you have not already:</p><pre>git init</pre><p>Create a .gitignore file to exclude unnecessary files:</p><pre>venv/<br>__pycache__/<br>*.pyc<br>.env<br>.DS_Store</pre><p>Add and commit your files:</p><pre>git add .<br>git commit -m &quot;Initial commit: Dockerized ML API&quot;</pre><p><strong>Create a new repository on GitHub:</strong></p><ol><li>Go to github.com</li><li>Click the “+” icon → “New repository”</li><li>Name it docker-for-data-scientists (or whatever you prefer)</li><li>Keep it public (or private, your choice)</li><li>Do NOT initialize with README (we already have files)</li><li>Click “Create repository”</li></ol><p>Connect your local repo to GitHub:</p><pre>git remote add origin https://github.com/YOUR_USERNAME/docker-for-data-scientists.git<br>git branch -M main<br>git push -u origin main</pre><p>Refresh GitHub. Your files should be there</p><p>Your repository should have at least these files:</p><pre>docker-for-data-scientists/<br>├── app.py<br>├── Dockerfile<br>├── model.pkl<br>├── requirements.txt<br>├── train_model.py<br>├── .gitignore<br>└── README.md</pre><h3>Step 2: Create a Docker Hub Access Token</h3><p>GitHub Actions needs permission to push images to your Docker Hub account. We will use an access token instead of your password because:</p><ul><li>Tokens can be revoked without changing your password</li><li>Tokens can have limited permissions</li><li>It is more secure</li></ul><p><strong>Go to Docker Hub:</strong></p><ol><li>Log in to hub.docker.com</li><li>Click your profile picture (top right)</li><li>Click “Account Settings”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnWEkqtgJKZpJLgyZ--fpw.png" /></figure><p>4. Click “Security” in the left sidebar</p><p>5. Click “New Access Token”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAQ7ShOiuxe8s6VA-ouI7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lpgq2Eb6MptnL1prRynC3A.png" /></figure><p>Configure the token:</p><ul><li><strong>Description:</strong> github-actions (so you remember what it is for)</li><li><strong>Access permissions:</strong> Select “Read &amp; Write” (we need to push images)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klIRw_7m4tY03Lu7-2-uDg.png" /></figure><p>Click “Generate.”</p><p><strong>Important:</strong> Copy the token immediately. You will not see it again. If you lose it, you will need to create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bdvoeZrIx4xJGQVSQcNEg.png" /></figure><p>Save this token somewhere safe temporarily (like a text file). We will add it to GitHub in the next step.</p><h3>Step 3: Add Secrets to GitHub</h3><p>Now we need to give GitHub Actions access to your Docker Hub credentials. GitHub has a secure way to store secrets that your workflows can use.</p><p><strong>Go to your GitHub repository:</strong></p><ol><li>Click “Settings” (tab at the top)</li><li>In the left sidebar, click “Secrets and variables”</li><li>Click “Actions”</li><li>Click “New repository secret”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtaZMLuZfgYH__ZQQluaTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbFnG-NyMqQz4_RuOfNRaw.png" /></figure><p>Add your Docker Hub username:</p><ul><li><strong>Name:</strong> DOCKERHUB_USERNAME</li><li><strong>Secret:</strong> Your Docker Hub username (e.g., ibrahim313)</li><li>Click “Add secret”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3y5q0GXyOvigmfGzrScDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CW0p93YaO8npMuwbXjUYIg.png" /></figure><p>Secondly, here add your Docker Hub token:</p><ul><li>Click “New repository secret” again</li><li><strong>Name:</strong> DOCKERHUB_TOKEN</li><li><strong>Secret:</strong> The access token you copied from Docker Hub</li><li>Click “Add secret”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9mX54NHJi1JF3iiL3tvGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntg_RxEzST843Q2xOQmNKw.png" /></figure><p>These secrets are encrypted. Even you cannot see them after saving. Your workflow will be able to use them, but they will not appear in logs.</p><h3>Step 4: Get Your Render Deploy Hook</h3><p>Render can automatically redeploy your service when triggered by a webhook. This is how GitHub Actions will tell Render, “hey, there is a new Docker image, redeploy.”</p><p><strong>Go to your Render dashboard:</strong></p><ol><li>Log in to render.com</li><li>Click on your web service (the one running your ML API)</li><li>Click “Settings” in the left sidebar</li><li>Scroll down to find “Deploy Hook”</li><li>Click “Create Deploy Hook”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbjI27eCvQNzRDFA8_O-Ww.png" /></figure><p>Render will generate a URL that looks something like:</p><pre>https://api.render.com/deploy/srv-abc123xyz?key=your-secret-key</pre><p>Copy this URL.</p><p>Now add it as a GitHub secret:</p><ol><li>Go back to your GitHub repository</li><li>Settings → Secrets and variables → Actions</li><li>Click “New repository secret”</li><li><strong>Name:</strong> RENDER_DEPLOY_HOOK</li><li><strong>Secret:</strong> The deploy hook URL you just copied</li><li>Click “Add secret”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6DaCjVzVZr1ieLSNfg2Bg.png" /></figure><p>You should now have three secrets:</p><ul><li>DOCKERHUB_USERNAME</li><li>DOCKERHUB_TOKEN</li><li>RENDER_DEPLOY_HOOK</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjBm0499cAEgA4HcqKyiqA.png" /></figure><h3>Step 5: Create the GitHub Actions Workflow</h3><p>Now the main part. We will create a workflow file that tells GitHub Actions exactly what to do when you push code.</p><p>GitHub Actions workflows live in a special folder: .github/workflows/</p><p>Create the directory structure:</p><pre>mkdir -p .github/workflows</pre><p>Create a file called .github/workflows/deploy.yml:</p><pre>name: Build and Deploy ML API</pre><pre># When to run this workflow<br>on:<br>  push:<br>    branches:<br>      - master  # Only run when pushing to master branch</pre><pre># The jobs to run<br>jobs:<br>  build-and-deploy:<br>    runs-on: ubuntu-latest  # Use Ubuntu as the build machine<br>    <br>    steps:<br>      # Step 1: Get the code<br>      - name: Checkout repository<br>        uses: actions/checkout@v4<br>      <br>      # Step 2: Set up Docker build tools<br>      - name: Set up Docker Buildx<br>        uses: docker/setup-buildx-action@v3<br>      <br>      # Step 3: Log in to Docker Hub<br>      - name: Login to Docker Hub<br>        uses: docker/login-action@v3<br>        with:<br>          username: ${{ secrets.DOCKERHUB_USERNAME }}<br>          password: ${{ secrets.DOCKERHUB_TOKEN }}<br>      <br>      # Step 4: Build and push the Docker image<br>      - name: Build and push Docker image<br>        uses: docker/build-push-action@v5<br>        with:<br>          context: .<br>          push: true<br>          tags: ${{ secrets.DOCKERHUB_USERNAME }}/iris-classifier:latest<br>          cache-from: type=gha<br>          cache-to: type=gha,mode=max<br>      <br>      # Step 5: Tell Render to redeploy<br>      - name: Trigger Render deployment<br>        run: |<br>          curl -X POST &quot;${{ secrets.RENDER_DEPLOY_HOOK }}&quot;<br>          echo &quot;Deployment triggered!&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Fibd5uyaf8UtsSKP1IW7g.png" /></figure><p>Let me explain what each part does:</p><p><strong>name:</strong> — A human-readable name for the workflow. Shows up in the GitHub UI.</p><p><strong>on: push: branches: master</strong> — Run this workflow when someone pushes to the master branch. You could also add pull_request to run on PRs.</p><p><strong>jobs:</strong> — The actual work to do. We have one job called build-and-deploy.</p><p><strong>runs-on: ubuntu-latest</strong> — Use a fresh Ubuntu machine provided by GitHub. It is free for public repositories.</p><p><strong>steps:</strong> — The individual steps of the job:</p><ol><li><strong>Checkout</strong> — Download your code from GitHub to the build machine</li><li><strong>Setup Buildx</strong> — Install Docker build tools</li><li><strong>Login</strong> — Authenticate with Docker Hub using your secrets</li><li><strong>Build and push</strong> — Build the Docker image and push it to Docker Hub</li><li><strong>Trigger Render</strong> — Call the webhook to tell Render to redeploy</li></ol><p><strong>cache-from and </strong><strong>cache-to</strong> — These cache Docker layers between runs, making subsequent builds faster.</p><p><strong>Important:</strong> Update the image name iris-classifier to match whatever you named your image in Article 3.(If it&#39;s the same, than u dont need to do anything)</p><h3>Step 6: Commit and Push the Workflow</h3><p>Add and commit the workflow file:</p><pre>git add .github/workflows/deploy.yml<br>git commit -m &quot;Add CI/CD pipeline with GitHub Actions&quot;<br>git push origin main</pre><p>The moment you push, GitHub Actions starts running.</p><h3>Step 7: Watch the Magic Happen</h3><p>Go to your GitHub repository and click the “Actions” tab.</p><p>You will see your workflow running. Click on it to see the details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YMfnkIWjQsNCkQybwbwwOA.png" /></figure><p><strong>Each step shows its status:</strong></p><ul><li>✓ Green checkmark = completed successfully</li><li>🔄 Spinning circle = in progress</li><li>✗ Red X = failed</li></ul><p><strong>Watch as each step completes:</strong></p><ol><li>Checkout repository ✓</li><li>Set up Docker Buildx ✓</li><li>Login to Docker Hub ✓</li><li>Build and push Docker image ✓</li><li>Trigger Render deployment ✓</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_lP_0SqBNhIRVpmHDq_Fw.png" /></figure><p>The whole process takes 2–4 minutes. Most of that time is building the Docker image.</p><p>Once it is done:</p><ul><li>Your new Docker image is on Docker Hub</li><li>Render is redeploying your service</li></ul><p>Wait another minute or two for Render to finish deploying, then check your live API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdP8Sg9rpElBUniqXNb-uA.png" /></figure><h4>Step 8: Test the Full Pipeline</h4><p>Let us make a change and watch the entire pipeline work.</p><p>Open app.py and update the home endpoint message:</p><pre>@app.get(&quot;/&quot;)<br>def home():<br>    return {&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;Iris Classifier API v2 - Deployed automatically!&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LyGE8HtpxKYoUKOkIgk8bA.png" /></figure><p>Commit and push:</p><pre>git add app.py<br>git commit -m &quot;Update API message to v2&quot;<br>git push origin main</pre><p>Now go to GitHub Actions. You will see a new workflow run triggered by your push.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-Cp_DbzA3KQypEDz8yfyA.png" /></figure><p>Wait for it to complete (should be faster this time because Docker caches layers).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75xd4SjWaWeoe54Uv1xzUg.png" /></figure><p>Now open your Render URL in a browser:</p><pre>https://your-app-name.onrender.com</pre><p>You should see:</p><pre>{&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;Iris Classifier API v2 - Deployed automatically!&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FuX0enoRrRbLiQg0H-JCiw.png" /></figure><p>You just deployed by pushing code. No manual Docker commands. No clicking deploy buttons. No logging into anything.</p><h3>What Happens Under the Hood</h3><p>When you push to main:</p><ol><li><strong>GitHub detects the push</strong> and checks for workflow files in .github/workflows/</li><li><strong>A fresh Ubuntu VM starts</strong> on GitHub’s servers</li><li><strong>Your code is downloaded</strong> to that VM</li><li><strong>Docker builds your image</strong> using your Dockerfile</li><li><strong>The image is pushed</strong> to Docker Hub with the latest tag</li><li><strong>A webhook is called</strong> that tells Render to pull the new image</li><li><strong>Render pulls the new image</strong> from Docker Hub</li><li><strong>Render restarts your service</strong> with the new container</li><li><strong>The VM is destroyed</strong> (GitHub cleans up after itself)</li></ol><p>All of this happens automatically, every single time you push to main.</p><h3>Common Issues and Fixes</h3><p><strong>Workflow does not start</strong></p><p>Make sure:</p><ul><li>The workflow file is in .github/workflows/ (exact spelling, with the &#39;s&#39;)</li><li>The file is a valid YAML file (check for syntax errors)</li><li>You pushed to the master branch (or whatever branch you specified)</li></ul><p><strong>Docker login fails</strong></p><p>Error: Error: Username and password required</p><p>Your secrets are not set correctly. Go to Settings → Secrets and check:</p><ul><li>DOCKERHUB_USERNAME exists and has your username</li><li>DOCKERHUB_TOKEN exists and has your access token</li><li>No extra spaces or newlines in the values</li></ul><p><strong>Build fails with “file not found”</strong></p><p>Error: COPY failed: file not found in build context</p><p>Your Dockerfile references a file that is not in the repository. Common issues:</p><ul><li>model.pkl is in .gitignore and was not committed</li><li>File name has a typo</li></ul><p>Check that all files in your Dockerfile exist in the repo.</p><p><strong>Render does not redeploy</strong></p><p>The webhook might have failed. Check:</p><ul><li>The RENDER_DEPLOY_HOOK secret is correct (copy it fresh from Render)</li><li>Your Render service is active and not paused</li><li>You can test the webhook manually: open the URL in a browser or use curl</li></ul><p><strong>Build takes too long</strong></p><p>First builds are slower (5–10 minutes) because there is no cache. Subsequent builds use cached layers and are faster (2–3 minutes).</p><p>If it is still slow, check:</p><ul><li>Your Docker image is not huge (minimize layers, use slim base images)</li><li>You are not downloading large files during build</li></ul><h3>What You Can Do Next</h3><p>Now that you have basic CI/CD working, consider these improvements:</p><p><strong>Run tests before deploying.</strong> Add a step that runs pytest. If tests fail, the deployment stops.</p><pre>- name: Run tests<br>  run: |<br>    pip install pytest<br>    pytest tests/</pre><p><strong>Build only when relevant files change.</strong> Skip the build if only the README changed.</p><pre>on:<br>  push:<br>    branches: [main]<br>    paths:<br>      - &#39;app.py&#39;<br>      - &#39;Dockerfile&#39;<br>      - &#39;requirements.txt&#39;<br>      - &#39;model.pkl&#39;</pre><p><strong>Deploy to multiple environments.</strong> Deploy to staging on every push, but only deploy to production when you create a release.</p><p><strong>Add notifications.</strong> Send a Slack message or email when deployments succeed or fail.</p><p><strong>Use environment-specific configurations.</strong> Different API keys or model versions for staging vs production.</p><h3>Summary</h3><p>CI/CD is not magic. It is just automation.</p><p><strong>The setup is:</strong></p><ol><li>Store your credentials as GitHub secrets</li><li>Write a workflow YAML file that describes the steps</li><li>Push code to trigger the pipeline</li></ol><p><strong>After setup:</strong></p><ul><li>Every push to main triggers a build</li><li>The Docker image is built on GitHub’s servers</li><li>The image is pushed to Docker Hub</li><li>Render automatically redeploys</li></ul><p>No more manual deployments. No more forgotten steps. No more “which version is live?”</p><p>This is how professional ML teams work. Now you know how to do it too.</p><p>In the next article, we will talk about what happens after deployment: monitoring your model and knowing when it is time to retrain.</p><h3>Resources</h3><p>All the code used in this tutorial is available on GitHub.</p><p>→ GitHub Repository: <a href="https://github.com/muhammadibrahim313/docker-for-data-scientists">https://github.com/muhammadibrahim313/docker-for-data-scientists</a></p><p>→ Live API Demo: <a href="https://iris-classifier-api-c2m7.onrender.com/">https://iris-classifier-api-c2m7.onrender.com/</a></p><h3>About the Author</h3><p><em>Muhammad Ibrahim Qasmi</em> is the youngest 3x Kaggle Grandmaster, specializing in computer vision and machine learning deployment. Follow his work on <a href="https://www.kaggle.com/ibrahimqasimi">Kaggle</a>, <a href="https://github.com/muhammadibrahim313">GitHub</a> and <a href="https://www.linkedin.com/in/muhammad-ibrahim-qasmi-9876a1297/">LinkedI</a>n for more tutorials and projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdeL8rfZcGqH9vyoJyw87A.png" /><figcaption>Ibrahim qasmi — youngest kaggle grandmaster</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=614e9ef28947" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Only Docker Tutorial Data Scientists Actually Need]]></title>
            <link>https://medium.com/@ibrahim313/the-only-docker-tutorial-data-scientists-actually-need-19e0a41a6c22?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e0a41a6c22</guid>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 20:48:41 GMT</pubDate>
            <atom:updated>2026-04-11T20:48:41.609Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A practical guide for data scientists who want to finally understand Docker and deploy anywhere.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X48zYChgA2h7AHusq6m38g.png" /></figure><blockquote><strong>This is Part 3 of my ML deployment series.</strong></blockquote><p>→ Part 1: <a href="https://python.plainenglish.io/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69?source=user_profile_page---------3-------------5e9969986d55----------------------">Deploy Your First Machine Learning Model as a Public API</a><br>→ Part 2: <a href="https://python.plainenglish.io/deploy-your-first-deep-learning-model-on-hugging-face-and-share-live-demo-gradio-d736052139d9?source=user_profile_page---------1-------------5e9969986d55----------------------">Deploy Your First Deep Learning Model on Hugging Face</a></p><p>In the previous articles, you trained models, built APIs, and deployed the on platforms like <a href="https://render.com/">Render </a>and <a href="https://huggingface.co/">Hugging Face </a>Spaces.</p><p>But every job posting says “Docker experience required.” Every senior data scientist talks about containers. And you have been avoiding it because it feels like a DevOps thing.</p><p><strong>Here is the truth:</strong> Docker is not complicated. It is just packaging your code so it runs the same way everywhere. Once you understand that, everything clicks.</p><p>This guide will take you from <em>“what even is Docker”</em> to having a containerized ML API deployed on the internet. We will use a simple model, build a Docker image, push it to <a href="https://hub.docker.com/">Docker Hub</a>, and deploy on <a href="https://render.com/">Render</a>.</p><p>No DevOps background needed. Takes about 30 minutes :)</p><h3>What We Will Build</h3><p>We will train a simple Iris classifier, wrap it in a FastAPI endpoint, containerize it with Docker, and deploy it publicly.</p><p>The workflow looks like this:</p><ol><li>Set up your environment and train a model</li><li>Write a FastAPI app</li><li>Create a Dockerfile</li><li>Build and test locally</li><li>Push to Docker Hub</li><li>Deploy on Render</li><li>Test your live API</li></ol><p>By the end, you will have a containerized ML API running on the internet. And you will actually understand what Docker does.</p><h3>Prerequisites</h3><p>Before starting, make sure you have:</p><ul><li>Python installed on your machine</li><li>Docker Desktop installed (<a href="https://www.docker.com/products/docker-desktop/">download from docker.com</a>)</li><li>A <a href="https://hub.docker.com/">Docker Hub</a> account (free)</li><li>A <a href="https://render.com/">Render</a> account (free tier works)</li><li>Basic familiarity with Python and command line</li></ul><p>If you do not have Docker installed, download Docker Desktop from docker.com. It works on Windows, Mac, and Linux.</p><h3>What is Docker? (The Simple Explanation)</h3><p>Imagine you built an ML model on your laptop. It works perfectly. Then you send it to your colleague, and it crashes. Different Python version. Missing libraries. Wrong operating system.</p><p>Docker solves this by creating a “container”, a box that contains everything your app needs to run:</p><ul><li>The operating system (a minimal version of Linux)</li><li>Python (the exact version you want)</li><li>All your libraries (scikit-learn, FastAPI, etc.)</li><li>Your code and model files</li></ul><p><strong>Think of it like shipping a product:</strong></p><p><strong>Without Docker:</strong> You ship the parts and hope the customer has the right tools to assemble it.</p><p><strong>With Docker:</strong> You ship the entire assembled product in a sealed box. Just open and use.</p><p><strong>Key terms you will hear:</strong></p><p><strong>Image:</strong> A blueprint/recipe. It describes what goes in the container. You build it once.<br><strong>Container:</strong> A running instance of an image. Like running a program from an installer.<br><strong>Dockerfile:</strong> A text file with instructions to build an image. Like a recipe.<br><strong>Docker Hub: </strong>A place to store and share images. Like GitHub but for Docker images.</p><p><strong>The workflow is simple:</strong></p><blockquote>Write Dockerfile → Build Image → Run Container → Push to Docker Hub → Deploy anywhere</blockquote><p>That is all Docker is. A way to package your app so it runs identically everywhere.</p><h3>Why Docker Matters for Data Scientists</h3><p><strong>You might be thinking: </strong>I already deployed on Render and Hugging Face without Docker. Why do I need this?</p><p><strong>Here is why Docker changes everything:</strong></p><p><strong>Works everywhere.</strong> Your container runs the same on your laptop, your colleague’s machine, <a href="https://aws.amazon.com/">AWS</a>, <a href="https://cloud.google.com/">Google Cloud</a>, or any server. No more “it works on my machine” problems.</p><p><strong>No dependency hell.</strong> Everything your app needs is inside the container. Python version, libraries, system packages. All locked in.</p><p><strong>Industry standard.</strong> Every ML platform supports Docker. Kubernetes, AWS ECS, Google Cloud Run, <a href="https://portal.azure.com/">Azure</a>. Learn Docker once, deploy anywhere.</p><p><strong>Reproducibility.</strong> Your model from 2024 will still run in 2030 because the container preserves the exact environment.</p><p>In the previous articles, we relied on platforms to set up our environment. With Docker, you control everything.</p><h3>Step 1: Set Up Your Project</h3><p>Open your terminal and create a project folder:</p><pre>mkdir docker-for-data-scientists<br>cd docker-for-data-scientists</pre><p>Check that Python and Docker are installed:</p><pre>python --version<br>docker --version<br>docker ps</pre><p>If docker ps shows an error, open Docker Desktop first. It needs to be running.</p><h3>Step 2: Create a Virtual Environment</h3><p>Always use a virtual environment. This keeps your project dependencies isolated.</p><pre>python -m venv venv</pre><p>Activate it:</p><p><strong>Windows:</strong></p><pre>venv\Scripts\activate</pre><p><strong>Mac/Linux:</strong></p><pre>source venv/bin/activate</pre><p>You should see (venv) at the start of your terminal line.</p><h3>Step 3: Install Dependencies</h3><p>Install the packages we need:</p><pre>pip install scikit-learn joblib fastapi uvicorn</pre><p>Check the versions (we need these for requirements.txt):</p><pre>python -c &quot;import sklearn; print(&#39;scikit-learn:&#39;, sklearn.__version__)&quot;<br>python -c &quot;import joblib; print(&#39;joblib:&#39;, joblib.__version__)&quot;<br>python -c &quot;import fastapi; print(&#39;fastapi:&#39;, fastapi.__version__)&quot;<br>python -c &quot;import uvicorn; print(&#39;uvicorn:&#39;, uvicorn.__version__)&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNRriOfQP9VCc4opBuqouw.png" /></figure><p>Write down these versions. You will use them in requirements.txt.</p><h3>Step 4: Train and Save the Model</h3><p>Create a file called train_model.py:</p><pre># train_model.py<br>import joblib<br>from sklearn.datasets import load_iris<br>from sklearn.ensemble import RandomForestClassifier<br>from sklearn.model_selection import train_test_split<br># Load data<br>iris = load_iris()<br>X, y = iris.data, iris.target<br># Split<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<br># Train<br>model = RandomForestClassifier(n_estimators=100, random_state=42)<br>model.fit(X_train, y_train)<br># Check accuracy<br>accuracy = model.score(X_test, y_test)<br>print(f&quot;Accuracy: {accuracy:.2%}&quot;)<br># Save<br>artifact = {<br>    &quot;model&quot;: model,<br>    &quot;feature_names&quot;: iris.feature_names,<br>    &quot;target_names&quot;: iris.target_names.tolist()<br>}<br>joblib.dump(artifact, &quot;model.pkl&quot;)<br>print(&quot;Saved: model.pkl&quot;)</pre><p>Run it:</p><pre>python train_model.py</pre><p>You should see something like:</p><pre>Accuracy: 100.00%<br>Saved: model.pkl</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8PZD_AsHeaC4bINIVNV6Q.png" /></figure><p>The Iris dataset is simple (example workflow), so we get high accuracy. In real projects, your model would be more complex, but the deployment steps stay exactly the same.</p><h3>Step 5: Create the FastAPI App</h3><p>Create a file called app.py:</p><pre># app.py<br>import joblib<br>from fastapi import FastAPI<br>from pydantic import BaseModel<br>app = FastAPI(title=&quot;Iris Classifier API&quot;)<br># Load model on startup<br>artifact = joblib.load(&quot;model.pkl&quot;)<br>model = artifact[&quot;model&quot;]<br>feature_names = artifact[&quot;feature_names&quot;]<br>target_names = artifact[&quot;target_names&quot;]<br>class IrisInput(BaseModel):<br>    sepal_length: float<br>    sepal_width: float<br>    petal_length: float<br>    petal_width: float<br>@app.get(&quot;/&quot;)<br>def home():<br>    return {&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;Iris Classifier API is running&quot;}<br>@app.get(&quot;/health&quot;)<br>def health():<br>    return {&quot;status&quot;: &quot;healthy&quot;, &quot;model_loaded&quot;: model is not None}<br>@app.post(&quot;/predict&quot;)<br>def predict(data: IrisInput):<br>    features = [[data.sepal_length, data.sepal_width, data.petal_length, data.petal_width]]<br>    prediction = model.predict(features)[0]<br>    probability = model.predict_proba(features)[0].max()<br>    <br>    return {<br>        &quot;prediction&quot;: int(prediction),<br>        &quot;species&quot;: target_names[prediction],<br>        &quot;confidence&quot;: round(float(probability), 4)<br>    }</pre><p>This is the same FastAPI pattern from the first article <a href="https://python.plainenglish.io/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69?source=user_profile_page---------3-------------5e9969986d55----------------------">Deploy Your First Machine Learning Model as a Public API</a>. Nothing new here.</p><h3>Step 6: Create requirements.txt</h3><p>Create a file called requirements.txt with your package versions:</p><pre>scikit-learn==1.8.0<br>joblib==1.5.3<br>fastapi==0.135.3<br>uvicorn==0.44.0</pre><p><strong>Important:</strong> Use the versions you got from Step 3. Version mismatches cause most deployment failures.</p><h3>Step 7: Test Locally (Before Docker)</h3><p>Before we containerize anything, make sure the app works:</p><pre>uvicorn app:app --reload</pre><p>Open your browser and go to <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000</a></p><p>You should see:</p><pre>{&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;Iris Classifier API is running&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_R53_HVPRw0j7OBqW8XS8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRIUUDqCshy3q0y8BzEAVA.png" /></figure><p>You can also test the docs at http://127.0.0.1:8000/docs where FastAPI gives you a nice interactive interface.</p><p>Stop the server with Ctrl+C.</p><h3>Step 8: Create the Dockerfile</h3><p>This is the Docker part. Create a file called Dockerfile (no extension, capital D):</p><pre>FROM python:3.11-slim<br>WORKDIR /app<br>COPY requirements.txt .<br>RUN pip install --no-cache-dir -r requirements.txt<br>COPY model.pkl .<br>COPY app.py .<br>EXPOSE 8000<br>CMD [&quot;uvicorn&quot;, &quot;app:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;8000&quot;]</pre><p>Let me explain each line:</p><ul><li>FROM python:3.11-slim Start with a minimal Python image</li><li>WORKDIR /appCreate and use /app as our working directory</li><li>COPY requirements.txt . Copy the requirements file into the container</li><li>RUN pip install... Install dependencies</li><li>COPY model.pkl . Copy your trained model</li><li>COPY app.py . Copy your API code</li><li>EXPOSE 8000 Tell Docker we use port 8000</li><li>CMD [...] The command to run when the container starts</li></ul><p>That is it. This file tells Docker exactly how to build an image of your app.</p><h3>Step 9: Build the Docker Image</h3><p>Now build the image:</p><pre>docker build -t iris-classifier .</pre><p>The -t iris-classifier gives your image a name. The . means &quot;use the Dockerfile in the current directory.&quot;</p><p>This takes a minute or two the first time. Docker downloads the Python base image and installs your packages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_rtCIIm6qVzTVpNCkEc9rA.png" /></figure><p>You should see “Successfully tagged iris-classifier:latest” at the end.</p><p>Check that your image exists:</p><pre>docker images</pre><p>You should see iris-classifier in the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2etneR155oX7fZW1EBwSRg.png" /></figure><h3>Step 10: Run the Docker Container Locally</h3><p>Now run your containerized app:</p><pre>docker run -p 8000:8000 iris-classifier</pre><p>The -p 8000:8000 maps port 8000 inside the container to port 8000 on your machine.</p><p>Open your browser and go to <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-nmNOzEzbEPd-tNZ53BgQ.png" /></figure><p>Same result as before, but now it is running inside a container. Your app is completely isolated from your system. It does not care what Python version you have installed or what other packages exist on your machine.</p><p>Test a prediction using curl:</p><pre>curl -X POST &quot;http://127.0.0.1:8000/predict&quot; -H &quot;Content-Type: application/json&quot; -d &quot;{\&quot;sepal_length\&quot;: 5.1, \&quot;sepal_width\&quot;: 3.5, \&quot;petal_length\&quot;: 1.4, \&quot;petal_width\&quot;: 0.2}&quot;</pre><p>You should get:</p><pre>{&quot;prediction&quot;: 0, &quot;species&quot;: &quot;setosa&quot;, &quot;confidence&quot;: 1.0}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9nqn9-mrw72VL1eEXTUQQ.png" /></figure><p>Stop the container with Ctrl+C.</p><h3>Step 11: Push to Docker Hub</h3><p>Now we push the image to Docker Hub so Render can pull it.</p><p>First, log in to Docker Hub:</p><pre>docker login</pre><p>Enter your Docker Hub username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9dCebOMH-07PBp6cHe4Vw.png" /></figure><p>Tag your image with your Docker Hub username:</p><pre>docker tag iris-classifier YOUR_DOCKERHUB_USERNAME/iris-classifier:latest</pre><p>Replace YOUR_DOCKERHUB_USERNAME with your actual username. For example:</p><pre>docker tag iris-classifier ibrahim313/iris-classifier:latest</pre><p>Push the image:</p><pre>docker push YOUR_DOCKERHUB_USERNAME/iris-classifier:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2REtIrI9xfXdDcMMtvY8vg.png" /></figure><p><strong>Note:</strong> If the command in the terminal does not work or you are unable to upload, open <strong>Docker Desktop</strong> and, as shown in the screenshot, click <strong>“Push to Docker Hub.”</strong> After a few minutes, it will be successfully pushed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQsO2K7KWqdKisv-ELSTIA.png" /></figure><p>This uploads your image to Docker Hub. Anyone (or any platform) can now pull and run your containerized app.</p><p>Go to hub.docker.com and check your repositories. You should see iris-classifier there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbgtMq4f8p7RdFK1DtLJYA.png" /></figure><h3>Step 12: Deploy on Render</h3><p>Now we deploy the Docker image on Render.</p><ol><li>Go to render.com and log in</li><li>Click <strong>New</strong> and select <strong>Web Service</strong></li><li>Select <strong>Deploy an existing image from a registry</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6c28-zKIYS048lGLiPfzHg.png" /></figure><p>4. Enter your Docker Hub image URL:</p><pre>docker.io/YOUR_DOCKERHUB_USERNAME/iris-classifier:latest</pre><p>For example: docker.io/ibrahim313/iris-classifier:latest</p><p>5. Configure the settings:</p><ul><li><strong>Name:</strong> iris-classifier-api (or any name you want)</li><li><strong>Region:</strong> Choose the closest to you</li><li><strong>Instance Type:</strong> Free</li></ul><p>6. Click <strong>Create Web Service</strong></p><p>Render will pull your Docker image and start the container. This takes a few minutes.</p><p>Once the status shows <strong>Live</strong>, your API is deployed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPm-9-ztnCoAj1b1c6I2vg.png" /></figure><p>Your URL will look like: <a href="https://iris-classifier-api.onrender.com/">https://iris-classifier-api.onrender.com</a></p><h3>Step 13: Test Your Deployed API</h3><p>Open your Render URL in a browser. You should see:</p><pre>{&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;Iris Classifier API is running&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgMB186byTT_7hnflq2lOQ.png" /></figure><p>Test a prediction with Postman or curl:</p><pre>curl -X POST &quot;https://YOUR_RENDER_URL/predict&quot; -H &quot;Content-Type: application/json&quot; -d &quot;{\&quot;sepal_length\&quot;: 6.3, \&quot;sepal_width\&quot;: 2.5, \&quot;petal_length\&quot;: 5.0, \&quot;petal_width\&quot;: 1.9}&quot;</pre><p>You should get:</p><pre>{&quot;prediction&quot;: 2, &quot;species&quot;: &quot;virginica&quot;, &quot;confidence&quot;: 0.98}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xO4rRGstimUc25ldn8EZ8g.png" /></figure><p>Your containerized ML API is now live on the internet.</p><h3>Step 14: Push Code to GitHub</h3><p>Finally, push your code to GitHub so others can see how you built it.</p><p>Create a .gitignore and README.md Files, and here is the code that I used in my article. Also, see the structure, and you can use the code as well.</p><p>→ <a href="https://github.com/muhammadibrahim313/docker-for-data-scientists">GitHub Repository</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DPtEBisWl7YLgTiaVZVihQ.png" /></figure><h3>Your Final Folder Structure</h3><pre>docker-for-data-scientists/<br>├── venv/<br>├── app.py<br>├── Dockerfile<br>├── model.pkl<br>├── requirements.txt<br>├── train_model.py<br>├── .gitignore<br>└── README.md</pre><h3>Common Issues and Fixes</h3><p><strong>“docker: command not found”</strong></p><p>Docker Desktop is not installed or not in your PATH. Download it from docker.com and restart your terminal.</p><p><strong>“Cannot connect to the Docker daemon”</strong></p><p>Docker Desktop is not running. Open the Docker Desktop application first.</p><p><strong>“denied: requested access to the resource is denied”</strong></p><p>You are not logged in to Docker Hub, or your image tag does not match your username. Run docker login and make sure the tag includes your username.</p><p><strong>Build fails with “pip not found”</strong></p><p>Your base image might be wrong. Make sure you use python:3.11-slim or similar official Python images.</p><p><strong>Container runs locally but fails on Render</strong></p><p>Check that your requirements.txt has all dependencies with correct versions. Also check the Render logs for specific errors.</p><p><strong>Render deploy is stuck</strong></p><p>Free tier can be slow. Wait a few minutes. If it fails, check the logs for errors.</p><h3>What You Can Do Next</h3><p>Now that you understand Docker, consider these improvements:</p><p><strong>Add environment variables.</strong> Use a .env file for configuration like model paths or API keys. Docker can load these at runtime.</p><p><strong>Multi-stage builds.</strong> For larger projects, use multi-stage Dockerfiles to keep the final image small.</p><p><strong>Docker Compose.</strong> When you have multiple services (API + database + cache), Docker Compose manages them together.</p><p><strong>CI/CD pipelines.</strong> Set up GitHub Actions to automatically build and push your Docker image when you commit code.</p><p><strong>Try other platforms.</strong> Your Docker image works on AWS ECS, Google Cloud Run, Azure Container Apps, and Kubernetes. Learn Docker once, deploy anywhere.</p><h3>Summary</h3><p>Docker is not a DevOps mystery. It is just packaging your code so it runs the same everywhere.</p><p>The core workflow is:</p><ol><li>Write your code (model + API)</li><li>Create a Dockerfile that describes your environment</li><li>Build an image</li><li>Push to Docker Hub</li><li>Deploy anywhere that supports containers</li></ol><p>Once you understand this, you can deploy on any cloud platform. AWS, GCP, Azure, Kubernetes. They all speak Docker.</p><p>This is Part 3 of my deployment series. <a href="https://python.plainenglish.io/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69?source=user_profile_page---------3-------------5e9969986d55----------------------">Part 1 covered deploying with FastAPI and Render</a>. <a href="https://python.plainenglish.io/deploy-your-first-deep-learning-model-on-hugging-face-and-share-live-demo-gradio-d736052139d9?source=user_profile_page---------1-------------5e9969986d55----------------------">Part 2 covered Hugging Face Spaces with Gradio</a>. Now you have the full toolkit: APIs, demos, and containers.</p><p>If you found this helpful, share it with someone who has been avoiding Docker.</p><h3>Resources</h3><p>All the code used in this tutorial is available on GitHub.</p><p>→ <a href="https://github.com/muhammadibrahim313/docker-for-data-scientists">GitHub Repository</a></p><p>→ <a href="https://hub.docker.com/r/ibrahim313/iris-classifier">Docker Hub Image</a></p><p>→ <a href="https://iris-classifier-api-c2m7.onrender.com/">Live API Demo</a></p><h3>About the Author</h3><p><strong>Muhammad Ibrahim Qasmi</strong> is the youngest 3x Kaggle Grandmaster, specializing in computer vision and machine learning deployment. Follow his work on <a href="https://www.kaggle.com/ibrahimqasimi">Kaggle</a>, <a href="https://github.com/muhammadibrahim313">GitHub</a>, <a href="https://www.linkedin.com/in/muhammad-ibrahim-qasmi-9876a1297/">LinkedIn</a>, and <a href="https://www.kaggle.com/ibrahimqasimi">ibrahimqasmi.com</a> for more tutorials and projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PbMIsrT5AtHUMMULWA9_OA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19e0a41a6c22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Submit to Kaggle Competitions Using MCP (VS Code)]]></title>
            <link>https://medium.com/@ibrahim313/how-to-submit-to-kaggle-competitions-using-mcp-vs-code-9003bbb5af63?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/9003bbb5af63</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[ibrahimqasmi]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[kaggle-competition]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 12:26:30 GMT</pubDate>
            <atom:updated>2026-04-01T14:27:47.290Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A practical guide for Kaggle users who want to go from MCP setup to real competition submissions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjGL96xowBmCjnVNx3WXEg.png" /></figure><p><a href="http://kaggle.com/">Kaggle</a> recently launched its offcial MCP server.</p><blockquote><strong><em>MCP stands for Model Context Protocol.</em></strong><em> It lets AI tools and editors connect to external third party platforms like Kaggle, your database read their available tools, and perform actions such as checking competitions, inspecting notebooks, and submitting entries.</em></blockquote><p>Most people will connect it and stop there. But the useful part starts after that. Can you actually submit to Kaggle competitions from VS Code using MCP?</p><p>Yes. I tested two real submission flows end-to-end, and this guide covers exactly that.</p><p>When I first started testing, my question was simple: can I actually submit to a Kaggle competition from my IDE using MCP? Not just connect the server. Actually submit. This article covers how I did it.</p><p>No DevOps background needed -:)</p><h3>Before You Start: Kaggle Has Two Submission Types</h3><p>Before doing anything else, understand this part clearly. Kaggle competitions do not all follow the same submission workflow. There are two common types.</p><p><strong>1. Simple file-upload competitions</strong></p><p>In these competitions, you create a file like submission.csv locally and submit it.</p><p><strong>Example</strong>: <a href="https://www.kaggle.com/competitions/titanic">Titanic - Machine Learning from Disaster</a>,<a href="https://www.kaggle.com/competitions/house-prices-advanced-regression-techniques">House Prices — Advanced Regression Techniques</a> or Playground Compeition like <a href="https://www.kaggle.com/competitions/playground-series-s6e4">Predicting Irrigation Need</a> and Community Hosted competitions too.</p><p><strong>2. Notebook-based competitions</strong></p><p>In these competitions, you do not just upload a local file from your machine. You need a Kaggle notebook that runs on Kaggle, creates the output file, saves that file in /kaggle/working/, and then submits that notebook version. Examples: <a href="https://www.kaggle.com/competitions/arc-prize-2026-arc-agi-2">ARC Prize 2026 - ARC-AGI-2</a>, <a href="https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3">AI Mathematical Olympiad</a> style code competitions.</p><p>This is the most important thing to understand before using Kaggle MCP for submissions. If you mix these up, your submission will fail.</p><h3>What We Will Cover</h3><p>In this guide, I will show:</p><ol><li>How to generate a Kaggle token</li><li>How to connect Kaggle MCP in VS Code</li><li>How to start the Kaggle MCP server</li><li>How to submit a simple competition file using Titanic</li><li>How to submit a notebook-based competition entry using ARC Prize 2026</li></ol><p>I used VS Code for this article because the workflow is simple and easy to explain. But Kaggle MCP also works with Gemini CLI, Claude Code, and Claude Desktop. I will cover that briefly at the end.</p><h3>Prerequisites</h3><p>Before starting, make sure you have:</p><ul><li>A Kaggle account</li><li>Access to the competitions you want to use</li><li>VS Code with MCP support</li><li>A Kaggle token from the same account you want to submit with</li></ul><h3>Step 1: Generate Your Kaggle Token</h3><p>Go to your Kaggle settings page.</p><p>Open the API section and click Generate New Token.</p><p>The token starts with: KGAT_50……..</p><p>Copy it and keep it safe. Do not paste it in your code or expose it in anywhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GYrMTQkKiJrC718HE-H92w.png" /><figcaption>Generating Kaggle Token</figcaption></figure><h3>Step 2: Add Kaggle MCP Configuration in VS Code</h3><p>Create this file inside your project:</p><pre>.vscode/mcp.json</pre><p>Use this configuration:</p><pre>{<br>  &quot;inputs&quot;: [<br>    {<br>      &quot;type&quot;: &quot;promptString&quot;,<br>      &quot;id&quot;: &quot;kaggle-token&quot;,<br>      &quot;description&quot;: &quot;Paste your Kaggle token when VS Code asks for it&quot;,<br>      &quot;password&quot;: true<br>    }<br>  ],<br>  &quot;servers&quot;: {<br>    &quot;kaggle&quot;: {<br>      &quot;type&quot;: &quot;http&quot;,<br>      &quot;url&quot;: &quot;https://www.kaggle.com/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer ${input:kaggle-token}&quot;<br>      }<br>    }<br>  }<br>}</pre><p>This is a clean setup because the token is not hardcoded anywhere. VS Code will prompt you securely when starting the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OYNKDzwBDwGR3ASmRK74Yg.png" /></figure><h3>Step 3: Start the Kaggle MCP Server in VS Code</h3><p>Now open VS Code and start the server:</p><ol><li>Press Ctrl + Shift + P</li><li>Type MCP: List Servers</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wt9PpZ49_XmhqSL9bvuVOw.jpeg" /><figcaption><em>MCP: List Servers in the VS Code command palette</em></figcaption></figure><p>3. Select kaggle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZyGtmhoSgba5kwfoAuly5A.jpeg" /><figcaption><em>Kaggle server selected from the MCP server list</em></figcaption></figure><p>4. Click Start Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13GeD9oyahxSOlEuqaoUog.jpeg" /><figcaption><em>Start Server action for Kaggle MCP</em></figcaption></figure><p>5. Paste your token when VS Code asks for it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ncy451KiS2QY1ZnPOsiGFA.jpeg" /><figcaption><em>Token prompt in VS Code</em></figcaption></figure><p>After that, open the output panel and confirm the Kaggle MCP server is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5E5DJYHrj21hU8Plwfz5Kg.jpeg" /><figcaption><em>Output panel showing Kaggle MCP server running successfully</em></figcaption></figure><h3>Step 4: Submit a Simple Competition File (Titanic)</h3><p>Now let us start with the easier case. The <a href="https://www.kaggle.com/competitions/titanic">Titanic competition</a> is perfect for this because it follows the simple file-upload submission flow.</p><p>First, join the competition and download the files. Place them in a local data folder:</p><ul><li>data/train.csv</li><li>data/test.csv</li></ul><p>Create a virtual environment and install packages:</p><pre>py -m venv .venv<br>.venv\Scripts\Activate.ps1<br>pip install pandas scikit-learn</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4R0IvZQfL8iXfNz6l2PoQ.jpeg" /><figcaption>virtual env setup</figcaption></figure><p>Now create a small submission script. Here is a simple example:</p><pre>import pandas as pd<br>from sklearn.ensemble import RandomForestClassifier<br>train = pd.read_csv(&quot;data/train.csv&quot;)<br>test = pd.read_csv(&quot;data/test.csv&quot;)<br>features = [&quot;Pclass&quot;, &quot;Sex&quot;, &quot;Age&quot;, &quot;SibSp&quot;, &quot;Parch&quot;, &quot;Fare&quot;, &quot;Embarked&quot;]<br>train = train[[&quot;PassengerId&quot;, &quot;Survived&quot;] + features].copy()<br>test = test[[&quot;PassengerId&quot;] + features].copy()<br>fill_values = {<br>    &quot;Age&quot;: train[&quot;Age&quot;].median(),<br>    &quot;Fare&quot;: train[&quot;Fare&quot;].median(),<br>    &quot;Embarked&quot;: train[&quot;Embarked&quot;].mode()[0]<br>}<br>X = pd.get_dummies(train[features].fillna(fill_values))<br>X_test = pd.get_dummies(test[features].fillna(fill_values)).reindex(columns=X.columns, fill_value=0)<br>model = RandomForestClassifier(n_estimators=200, random_state=42)<br>model.fit(X, train[&quot;Survived&quot;])<br>predictions = model.predict(X_test)<br>submission = pd.DataFrame({<br>    &quot;PassengerId&quot;: test[&quot;PassengerId&quot;],<br>    &quot;Survived&quot;: predictions<br>})<br>submission.to_csv(&quot;submission.csv&quot;, index=False)<br>print(&quot;submission.csv created&quot;)</pre><p>Run it:</p><pre>python titanic_submission.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HKHK2kb9xFH5XVqx5I09Q.jpeg" /><figcaption><em>Terminal output showing </em><em>submission.csv created</em></figcaption></figure><p>Now here is the key part. Open GitHub Copilot Chat or the VS Code chat panel and use this prompt:</p><pre>Use Kaggle MCP to upload and submit my local file submission.csv<br>to the titanic competition with the description<br>&quot;Titanic MCP baseline from VS Code&quot;, then show me the submission status.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TsxjeX84paRPeQFbcGJjZQ.jpeg" /><figcaption>chat</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n7PTTTOnwuPgK27U-x9HVA.jpeg" /><figcaption>submitted</figcaption></figure><p>If you want to do this manually through individual tool calls, it would be more work. But the chat handles all the MCP steps for you in a few seconds. It has the tools available and knows how to call them automatically.</p><p>In my run, this submission completed successfully and returned a public score of 0.76555.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flXmjdkgvphlQHJSZSO9CA.jpeg" /></figure><p>That is it for simple competitions. Local file, one chat prompt, done.</p><h3>Step 5: Submit a Notebook-Based Competition Entry (ARC)</h3><p>Now let us move to the <strong>second type</strong>. The <a href="https://www.kaggle.com/competitions/arc-prize-2026-arc-agi-2">ARC Prize 2026 — ARC-AGI-2 competition</a> is a notebook-based competition. The flow is different here.</p><p>You cannot submit a local submission.json from your laptop. Instead, you need a Kaggle notebook that runs on Kaggle, creates submission.json, and saves it inside /kaggle/working/. Then you submit that notebook version through MCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5izn5hgHcQy6Qgb1oHwbQ.png" /><figcaption>ARC competition page</figcaption></figure><p>For this part, I used my own ARC notebook. You can find it here:</p><p>→ <a href="https://www.kaggle.com/code/ibrahimqasimi/mcp-arc-prize-agi-2-2026-starter/">My ARC Notebook</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RL_nJw0E4qD10g8Xr1FnsQ.jpeg" /></figure><p>The important part here is not the exact model code. The important part is that your notebook finishes correctly and creates:</p><pre>/kaggle/working/submission.json</pre><p>After your notebook is ready:</p><ol><li>Save the notebook version</li><li>Run it completely on Kaggle</li><li>Wait until the run finishes successfully</li><li>Note the notebook version number</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHFzhInIKgWmKPAB4t4OxA.jpeg" /></figure><p>Now open the VS Code chat panel and use this prompt:</p><pre>Use Kaggle MCP create_code_competition_submission for competition<br>&quot;arc-prize-2026-arc-agi-2&quot;. Submit notebook owner &quot;YOUR_KAGGLE_USERNAME&quot;,<br>slug &quot;YOUR_NOTEBOOK_SLUG&quot;, version YOUR_VERSION_NUMBER,<br>file &quot;submission.json&quot;, description &quot;ARC MCP baseline from VS Code&quot;.<br>Do not use the file-upload submission flow.</pre><p>Replace YOUR_KAGGLE_USERNAME, YOUR_NOTEBOOK_SLUG, and YOUR_VERSION_NUMBER with your actual values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rQTnliXINzAyGi9e0oyMfA.jpeg" /></figure><p>This detail matters a lot. For ARC and similar competitions, you are submitting a Kaggle notebook version, not uploading a local file. That is why I explained the two competition types at the start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WyL2mqZcy2M_uz9lijnKHg.png" /><figcaption>submitted output with mcp</figcaption></figure><h3>You Can Also Use Gemini CLI or Claude</h3><p>I used VS Code in this article because the workflow is simple. But Kaggle MCP is not limited to VS Code. You can also use it with Gemini CLI, Claude Code, or Claude Desktop.</p><p><strong>Gemini CLI setup:</strong></p><pre>gemini mcp add --transport http --header &quot;Authorization: Bearer YOUR_KGAT_TOKEN&quot; kaggle https://www.kaggle.com/mcp</pre><p>Or in ~/.gemini/settings.json:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;kaggle&quot;: {<br>      &quot;httpUrl&quot;: &quot;https://www.kaggle.com/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer YOUR_KGAT_TOKEN&quot;<br>      }<br>    }<br>  }<br>}</pre><p><strong>Claude web connector:</strong></p><p>You can add Kaggle MCP as a custom connector in Claude. Set the name to Kaggle MCP and the URL to https://www.kaggle.com/mcp. Leave OAuth fields blank. Then call the authorize tool in chat.</p><p>One note from my testing: VS Code worked smoothly for the full submission flow. Claude web could see the connector and tools, but some private endpoints returned authentication issues. So for direct practical use right now, VS Code or Gemini CLI with the token header is the cleanest path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xdot-_6G8p4lnWxIQZ5CIQ.png" /><figcaption>Claude connector and kaggle</figcaption></figure><h3>What MCP Unlocks for Kaggle Work</h3><p>Once Kaggle MCP is connected, you are not limited to just sending one submission. You can also use it to:</p><ul><li>Inspect competition metadata</li><li>Check notebook information</li><li>Inspect notebook sessions</li><li>List notebook outputs</li><li>Check submission status</li></ul><p>This is the useful part. It is not just setup. It gives you a better way to work with Kaggle from your editor. And in the future, I think there is a lot more room for automation and agents around Kaggle competitions using MCP.</p><p>Kaggle MCP currently exposes <strong>57 tools</strong> across competitions, notebooks, datasets, models, benchmarks, forums, and writeups. Submissions are only one part of it. Here is a quick summary of what else you can do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ovx-S9_pBL3iUCzAGNmFeQ.png" /><figcaption>summary table</figcaption></figure><h3>Terminal Fallback</h3><p>If you prefer using the terminal instead of VS Code chat, you can also submit directly using the Kaggle CLI:</p><pre>kaggle competitions submit -c titanic -f submission.csv -m &quot;Titanic baseline&quot;</pre><p>For notebook-based competitions:</p><pre>kaggle kernels push -p ./your-notebook-folder</pre><p>All the helper files and scripts are available in the GitHub repository:</p><p>→ <a href="https://github.com/muhammadibrahim313/Kaggle-Competitions-mcp">GitHub Repository</a></p><p>You can clone the repo and use any IDE you prefer. I used VS Code, but the MCP setup works the same way in any editor that supports it.</p><h3>Common Issues to Avoid</h3><p><strong>Exposing your token in screenshots.</strong> Never do that. Blur it or keep it out of the image completely.</p><p><strong>Using the wrong Kaggle account token.</strong> The token account is the account MCP will act as. Double check which account you generated it from.</p><p><strong>Mixing up competition types.</strong> This is the big one. If it is a simple competition, you can submit a local file. If it is a notebook-based competition, you need the notebook version flow. If you use the wrong flow, it will fail.</p><p><strong>Forgetting to save and run the notebook.</strong> For notebook-based competitions, the saved output is what gets submitted. If your notebook did not finish running, there is nothing to submit.</p><h3>Resources</h3><ul><li><a href="https://www.kaggle.com/docs/mcp">Kaggle MCP Documentation</a></li><li><a href="https://www.kaggle.com/competitions/titanic">Titanic Competition</a></li><li><a href="https://www.kaggle.com/competitions/arc-prize-2026-arc-agi-2">ARC Prize 2026 — ARC-AGI-2</a></li><li><a href="https://www.kaggle.com/code/ibrahimqasimi/mcp-arc-prize-agi-2-2026-starter/">My ARC Notebook</a></li><li><a href="https://github.com/muhammadibrahim313/Kaggle-Competitions-mcp">GitHub Repository</a></li></ul><h3>Final Thoughts</h3><p>Most people will stop at connecting the server. But the useful part starts after setup. Kaggle MCP already lets you do real competition work from your editor.</p><p>The practical way to think about it:</p><ul><li>Simple competitions → local file submission</li><li>Notebook competitions → notebook version submission</li></ul><p>That is phase one. Later, I think there will be a lot more we can do with Kaggle MCP for automation, agents, and competition workflows.</p><p>But if you want to start with the practical side right now, these two flows are enough.</p><p><em>If you found this helpful, share it with someone who is still submitting manually on the Kaggle website.</em></p><p>Follow my work on <a href="https://www.kaggle.com/ibrahimqasimi">Kaggle</a>, <a href="https://github.com/muhammadibrahim313">GitHub</a></p><p><strong>Author:</strong> Muhammad Ibrahim Qasmi (Youngest 3x Kaggle Grandmaster)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*LLghKFzlnrXKzVZoeid5lw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9003bbb5af63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Your First Deep Learning Model on Hugging Face and Share Live Demo (Gradio)]]></title>
            <link>https://python.plainenglish.io/deploy-your-first-deep-learning-model-on-hugging-face-and-share-live-demo-gradio-d736052139d9?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/d736052139d9</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[gradio]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 05:33:39 GMT</pubDate>
            <atom:updated>2026-02-03T06:53:02.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vfLLnwerHBUNJbYii0daYA.png" /><figcaption>header</figcaption></figure><h3><strong>A step-by-step guide for data science students who want to give their models a real web interface</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rt0dY6DenNOLIDLu7Y3HJA.png" /><figcaption>Demo(HF Space with Gradio)</figcaption></figure><p>You trained a deep learning model. The accuracy looks great. You can classify images in your notebook. Now what?</p><p>In the <a href="https://medium.com/python-in-plain-english/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69">last article</a>, we deployed a machine learning model as a raw API using FastAPI and Render. That works well for backend services. But if you send that API link to someone who is not a developer, they will stare at it and have no idea what to do.</p><blockquote>What if your model had an actual interface? A page where someone could upload an image, click Predict, and see the result instantly?</blockquote><p><strong>That is what we are building today.</strong> We will take a trained deep learning model and deploy it on <a href="https://huggingface.co/spaces">Hugging Face Spaces</a> with a <a href="https://www.gradio.app/">Gradio</a> frontend. The result is a public web app anyone can use from their browser. No API knowledge needed, no Postman, no JSON.</p><p>No prior deployment experience required. If you followed the last article, this will feel even easier :)</p><h3>What We Will Build</h3><p>We will take a tomato <a href="https://www.kaggle.com/datasets/kaustubhb999/tomatoleaf">leaf disease classifier</a> (MobileNetV2, trained on 10,000 images, 93.8% validation accuracy) and turn it into a live web application on Hugging Face Spaces.</p><p>The finished app lets users upload a leaf image (or use their webcam), hit Predict, and instantly see which disease the model detected along with confidence scores.</p><p><strong>Live demo:</strong> <a href="https://huggingface.co/spaces/ibrahim313/tomato-leaf-mobilenetv2">huggingface.co/spaces/ibrahim313/tomato-leaf-mobilenetv2</a></p><p>If you want to see the complete deep learning training workflow, here is my full notebook on Kaggle: <a href="https://claude.ai/chat/KAGGLE_NOTEBOOK_LINK">Tomato Leaf Disease | MobileNetV2 | 93.8%</a></p><p><strong>The workflow looks like this:</strong></p><ol><li>Train your model and save it</li><li>Set up your Hugging Face token and push the model to HF Hub</li><li>Write a Gradio app (one Python file)</li><li>Create a Hugging Face Space</li><li>Push your files and your app is live</li></ol><p><strong>The whole thing takes about 20 minutes once your model is trained.</strong></p><h3>Prerequisites</h3><p>Before starting, make sure you have:</p><ul><li>A trained deep learning model (TensorFlow/Keras or PyTorch)</li><li>A Hugging Face account (free)</li><li>Basic familiarity with Python</li></ul><p>The steps work on Kaggle, Google Colab, or your local machine. I trained my model on Kaggle, so I will show that workflow. But I will also cover the Colab equivalent at each step.</p><h3>Why Hugging Face Spaces?</h3><p>In the last article we used Render. It is great for APIs. But Hugging Face Spaces is better for models that need a visual interface, especially image and NLP models. Here is why:</p><p><strong>Free CPU (and optional GPU).</strong> Spaces runs on free CPU by default. MobileNetV2 runs perfectly fine on it. You can upgrade to GPU if needed, but for most models, CPU is enough.</p><p><strong>Built-in UI with Gradio.</strong> No need to write HTML, CSS, or JavaScript. Gradio gives you a polished interface with a few lines of Python.</p><p><strong>ML-native platform.</strong> Hugging Face is built for machine learning. Version control for models, automatic API generation, community features. It just makes sense for ML projects.</p><p><strong>No cold starts.</strong> Unlike Render’s free tier where the server sleeps after 15 minutes, Spaces stays warm longer and loads faster.</p><h3>Step 1: Set Up Your Hugging Face Token</h3><p>Before we do anything with code, you need a Hugging Face access token. This lets you push your model and files directly from your notebook.</p><ol><li>Go to <a href="https://huggingface.co/">huggingface.co</a> and create an account if you do not have one</li><li>Click on your profile picture, then go to <strong>Settings → Access Tokens</strong></li><li>Click <strong>New token</strong></li><li>Give it a name like hf_token</li><li><strong>Important:</strong> Select <strong>Write</strong> permissions. Read-only will not work because we need to upload files.</li><li>Click <strong>Generate</strong>, then copy the token</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpC67yTzWQkBBQVyXS1Orw.png" /><figcaption>Creating Hugging Token</figcaption></figure><p>Keep this token safe.(maybe paste into any new txt file)You will use it in the next step.</p><p>Also note your Hugging Face username. Mine is ibrahim313. You will see it in the code examples below. Replace it with yours.</p><h3>Step 2: Store Your Token as a Secret</h3><p>You should never paste your token directly in code. Both Kaggle and Colab have a Secrets feature for this.</p><h3>If you are using Kaggle:</h3><ol><li>Open your notebook</li><li>Click <strong>Add-ons</strong> in the top menu</li><li>Select <strong>Secrets</strong></li><li>Click <strong>Add a new secret</strong></li><li>Set the Label to HF_TOKEN and paste your token as the Value</li><li>Save it</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGm5Dq6XiM8ZzboLzZX75Q.jpeg" /><figcaption>Adding Secrets on Kaggle</figcaption></figure><p>When you click the “Add Secret” button, you will see a screen like the one shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0XGHcH_sLArJfZj_xI0Ig.jpeg" /><figcaption>Saving Secrets in Kaggle</figcaption></figure><p>and just click on save button and you are good to go :)</p><p>To use the token in your code:</p><pre>from kaggle_secrets import UserSecretsClient<br>user_secrets = UserSecretsClient()<br>secret_value_0 = user_secrets.get_secret(&quot;HF_TOKEN&quot;)</pre><h3>If you are using Google Colab:</h3><ol><li>Click the <strong>key icon</strong> in the left sidebar (Secrets)</li><li>Click <strong>Add new secret</strong></li><li>Set the Name to HF_TOKEN and paste your token as the Value</li><li>Toggle the access switch on</li></ol><p>To use the token in your code:</p><pre>from google.colab import userdata<br>hf_token = userdata.get(&#39;HF_TOKEN&#39;)</pre><h3>If you are using your local machine:</h3><p>Set it as an environment variable:</p><pre>import os<br>hf_token = os.environ.get(&quot;HF_TOKEN&quot;)</pre><p>Or just assign it directly for quick testing (but do not commit it to Git):</p><pre>hf_token = &quot;hf_your_token_here&quot;</pre><h3>Step 3: Train and Save Your Model</h3><p>This is the deep learning part. Train your model however you normally would. For my example, I trained a MobileNetV2 model on the <a href="https://www.kaggle.com/datasets/kaustubhb999/tomatoleaf">Tomato Leaf Disease dataset (10,000 training images, 10 classes)</a> using transfer learning with fine-tuning. It achieved 93.8% validation accuracy.</p><p>I am not going to walk through the full training code here. If you want to see the complete deep learning workflow from data loading to training to evaluation, here is my full notebook on Kaggle:</p><p><strong>Full training notebook:</strong> <a href="https://claude.ai/chat/KAGGLE_NOTEBOOK_LINK">Tomato Leaf Disease | MobileNetV2 | 93.8%</a></p><p>Once your model is trained, save it:</p><pre># Save the model in Keras format<br>model.save(&quot;tomato_model.keras&quot;)</pre><p>If you are using an older version of TensorFlow, use the H5 format:</p><pre>model.save(&quot;tomato_model.h5&quot;)</pre><p><strong>Important:</strong> Save the entire model, not just the weights. The .keras or .h5 file includes the architecture, weights, and optimizer state. This means you can load it on a completely different machine without redefining the model structure.</p><p>Also save your class names. You will need them later:</p><pre>class_names = train_ds.class_names<br>print(class_names)</pre><p>For our tomato dataset, the classes are:</p><pre>[&#39;Tomato___Bacterial_spot&#39;, &#39;Tomato___Early_blight&#39;, &#39;Tomato___Late_blight&#39;,<br> &#39;Tomato___Leaf_Mold&#39;, &#39;Tomato___Septoria_leaf_spot&#39;,<br> &#39;Tomato___Spider_mites Two-spotted_spider_mite&#39;, &#39;Tomato___Target_Spot&#39;,<br> &#39;Tomato___Tomato_Yellow_Leaf_Curl_Virus&#39;, &#39;Tomato___Tomato_mosaic_virus&#39;,<br> &#39;Tomato___healthy&#39;]</pre><blockquote>Here’s my quick Kaggle notebook that includes training and pushing the model to Hugging Face. You can save it to read later. For now, continue with the next steps:<br><strong> </strong><a href="https://www.kaggle.com/code/ibrahimqasimi/deploy-your-1st-deep-learning-model-on-huggingface/notebook"><strong><em>→ </em>Notebook Link</strong></a></blockquote><h3>Step 4: Push Your Model to Hugging Face Hub</h3><p>Instead of downloading your model file and uploading it manually, you can push it directly to Hugging Face Hub from your notebook. This is cleaner and works the same whether you are on Kaggle, Colab, or local.</p><p>First, install the Hugging Face Hub library if you do not have it:</p><pre>!pip install huggingface_hub -q</pre><p>Now define your output directory and push the model:</p><pre>from huggingface_hub import HfApi<br>api = HfApi()<br># On Kaggle, your output directory is /kaggle/working<br># On Colab, it is /content<br># On local, it is wherever you saved the file<br>output_dir = &quot;/kaggle/working&quot;  # change this for Colab: &quot;/content&quot;<br># Save model to output directory<br>model.save(f&quot;{output_dir}/tomato_model.keras&quot;)<br># Create a new repository on Hugging Face Hub (only needed once)<br>api.create_repo(<br>    repo_id=&quot;YOUR_USERNAME/tomato-disease-model&quot;,  # e.g. ibrahim313/tomato-disease-model<br>    repo_type=&quot;model&quot;,<br>    exist_ok=True,<br>    token=hf_token<br>)<br># Upload the model file<br>api.upload_file(<br>    path_or_fileobj=f&quot;{output_dir}/tomato_model.keras&quot;,<br>    path_in_repo=&quot;tomato_model.keras&quot;,<br>    repo_id=&quot;YOUR_USERNAME/tomato-disease-model&quot;,  # e.g. ibrahim313/tomato-disease-model<br>    token=hf_token<br>)<br>print(&quot;Model uploaded to Hugging Face Hub!&quot;)</pre><p>Replace YOUR_USERNAME with your Hugging Face username. Mine is ibrahim313, so my repo_id is ibrahim313/tomato-disease-model.</p><p>After running this, your model is stored in a versioned Hugging Face repository. You can see it on your profile page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4jrzpPj1qjpw6QfSWN6P5g.jpeg" /><figcaption>Deployed DL model on HF Repo</figcaption></figure><p>This is the key step. Your model is now on the cloud, and your Gradio app can download it directly from Hugging Face without needing to upload the model file to the Space itself.</p><p>Here is Link to my Deployed Model : <a href="https://huggingface.co/ibrahim313/tomato-leaf-mobilenetv2">https://huggingface.co/ibrahim313/tomato-leaf-mobilenetv2</a></p><h3>Step 5: Write the Gradio App</h3><p>This is the core file. Create a file called app.py:</p><pre>import gradio as gr<br>import tensorflow as tf<br>import numpy as np<br>from PIL import Image<br>from huggingface_hub import hf_hub_download</pre><pre># Download model from Hugging Face Hub<br>model_path = hf_hub_download(<br>    repo_id=&quot;ibrahim313/tomato-disease-model&quot;,  # replace with your repo<br>    filename=&quot;tomato_model.keras&quot;<br>)<br>model = tf.keras.models.load_model(model_path)</pre><pre># Class names (same order as training)<br>CLASS_NAMES = [<br>    &quot;Tomato___Bacterial_spot&quot;,<br>    &quot;Tomato___Early_blight&quot;,<br>    &quot;Tomato___Late_blight&quot;,<br>    &quot;Tomato___Leaf_Mold&quot;,<br>    &quot;Tomato___Septoria_leaf_spot&quot;,<br>    &quot;Tomato___Spider_mites Two-spotted_spider_mite&quot;,<br>    &quot;Tomato___Target_Spot&quot;,<br>    &quot;Tomato___Tomato_Yellow_Leaf_Curl_Virus&quot;,<br>    &quot;Tomato___Tomato_mosaic_virus&quot;,<br>    &quot;Tomato___healthy&quot;,<br>]</pre><pre>IMG_SIZE = 224  # must match your training input size<br></pre><pre>def predict(image, top_k=3):<br>    &quot;&quot;&quot;Takes a PIL image, returns top-k predictions.&quot;&quot;&quot;<br>    import time<br>    start = time.time()</pre><pre>    # Resize and preprocess<br>    image = image.resize((IMG_SIZE, IMG_SIZE))<br>    img_array = np.array(image) / 255.0  # scale to 0-1 like training<br>    img_array = np.expand_dims(img_array, axis=0)  # add batch dimension</pre><pre>    # Run inference<br>    predictions = model.predict(img_array, verbose=0)<br>    probs = predictions[0]</pre><pre>    elapsed = (time.time() - start) * 1000  # ms</pre><pre>    # Get top-k results<br>    top_indices = probs.argsort()[-top_k:][::-1]<br>    results = {CLASS_NAMES[i]: float(probs[i]) for i in top_indices}</pre><pre>    # Build run info string<br>    top_class = CLASS_NAMES[top_indices[0]]<br>    confidence = probs[top_indices[0]]<br>    info = f&quot;Prediction: {top_class} | confidence: {confidence:.4f} | device: cpu | time: {elapsed:.1f} ms&quot;</pre><pre>    return results, info<br></pre><pre># Build the Gradio interface<br>demo = gr.Interface(<br>    fn=predict,<br>    inputs=[<br>        gr.Image(type=&quot;pil&quot;, label=&quot;Input Image&quot;),<br>        gr.Slider(1, 10, value=3, step=1, label=&quot;Top-K predictions&quot;),<br>    ],<br>    outputs=[<br>        gr.Label(label=&quot;Predictions&quot;),<br>        gr.Textbox(label=&quot;Run info&quot;),<br>    ],<br>    title=&quot;Tomato Leaf Disease Classifier&quot;,<br>    description=&quot;MobileNetV2 • 10 classes • Image size 224\n\nUpload a tomato leaf image (or use the webcam). The demo runs inference and shows the top predictions.&quot;,<br>    allow_flagging=&quot;never&quot;,<br>)</pre><pre>demo.launch()</pre><p><strong>What this does:</strong></p><p>The app downloads your model directly from Hugging Face Hub on startup using hf_hub_download. No need to upload the model file to the Space separately. It is fetched automatically.</p><p>The predict function takes an uploaded image, resizes it to match what the model expects, normalizes pixel values to the 0 to 1 range (same as training), and runs inference. It returns the top-K class predictions with their confidence scores, plus timing information.</p><p>The gr.Interface block creates the entire web UI. Gradio handles the image upload widget, the predict button, the output display, and even webcam support. All from this single file.</p><p><strong>Customize for your model:</strong> Change repo_id to your Hugging Face model repository. If you trained with a different image size, change IMG_SIZE. If your model uses different preprocessing (like ImageNet normalization), adjust the preprocessing in the predict function. The class names must be in the exact same order as your training data.</p><h3>Step 6: Create a Hugging Face Space</h3><h3>Create a new Space</h3><ol><li>Go to <a href="https://huggingface.co/">huggingface.co</a></li><li>Click your profile picture, then click <strong>Create New Space</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*scgT0_NIRBGSOnZ6b-IOjg.jpeg" /></figure><p>3. Fill in the details:</p><p><strong>Space name:</strong> Something descriptive like tomato-leaf-mobilenetv2</p><p><strong>License:</strong> Apache 2.0 (or whatever you prefer)</p><p><strong>SDK:</strong> Select <strong>Gradio</strong></p><p><strong>Hardware:</strong> Start with <strong>CPU Basic (Free)</strong>. This is enough for MobileNetV2 inference.</p><p>4. Click <strong>Create Space</strong></p><p>You will see an empty repository with a README.</p><h3>Step 7: Push Your Files</h3><p>Your Space only needs two files (since the model is loaded from HF Hub):</p><h3>File 1: requirements.txt</h3><pre>tensorflow<br>gradio<br>numpy<br>Pillow<br>huggingface_hub</pre><h3>File 2: app.py</h3><p>This is the Gradio app we wrote in Step 5. Copy it as-is, with your repo_id updated.</p><h3>How to upload</h3><p><strong>Option A: Web upload (easiest)</strong></p><p>Click <strong>Files</strong> in your Space, then <strong>Add file → Upload files</strong>. Drag and drop both files. Commit the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eU9lA8pHeIYRygYpcWyxKg.jpeg" /></figure><p><strong>Option B: Git</strong></p><pre># Clone your space<br>git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME<br>cd YOUR_SPACE_NAME</pre><pre># Copy your files into this folder (app.py, requirements.txt)</pre><pre># Add and push<br>git add .<br>git commit -m &quot;Add Gradio app&quot;<br>git push</pre><p>Notice something? You do not need to upload the model file to the Space. The app downloads it from your Hugging Face model repository automatically. This keeps your Space lightweight and your model versioned separately.</p><h3>Step 8: Watch It Build</h3><p>After pushing your files, Hugging Face automatically builds and deploys your Space. You can watch the build logs in the <strong>Logs</strong> tab.</p><p>The first build takes a few minutes because it installs TensorFlow (which is a large package). Subsequent builds are faster thanks to caching.</p><p>Once the status changes from <strong>Building</strong> to <strong>Running</strong>, your app is live.</p><p>Your URL will be:</p><pre>https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME<br>#eg-&gt;https://huggingface.co/spaces/ibrahim313/tomato-leaf-mobilenetv2</pre><p>Open it in your browser. You should see your Gradio interface with the image upload area and predict button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PhUD8D6ZCosXj8rBIbt-qw.png" /></figure><p>Test my Space here: <a href="https://huggingface.co/spaces/ibrahim313/tomato-leaf-mobilenetv2">https://huggingface.co/spaces/ibrahim313/tomato-leaf-mobilenetv2</a><br>You can open the <strong>Files</strong> tab and copy the app.py code to see the full implementation in more detail.</p><h3>Step 9: Test It</h3><p>Upload any tomato leaf image.If you do not have one handy, go to your Kaggle dataset and download a sample from the validation set.</p><p>Click <strong>Predict</strong>. You should see the model’s top predictions with confidence scores.</p><p>Here is an example from my live demo. I uploaded a Late Blight validation image, and the model predicted:</p><ul><li><strong>Tomato___Late_blight: 100%</strong></li><li>Tomato___Early_blight: 0%</li><li>Tomato___Tomato_Yellow_Leaf_Curl_Virus: 0%</li></ul><p>Run info: Prediction: Tomato___Late_blight | confidence: 0.9999 | device: cpu | time: 27.7 ms</p><p>The model correctly identified the disease with near-perfect confidence, running on a free CPU in under 30 milliseconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D8IXnL450qqwFKDsAIM0UA.png" /><figcaption>Space Testing</figcaption></figure><p>The app also supports webcam input. If you have a tomato plant nearby, you can point your camera at a leaf and classify it in real time.</p><h3>Bonus: Auto-generated API</h3><p>Gradio automatically creates an API for your app. Scroll to the bottom of your Space and click <strong>Use via API</strong>. You get a full API endpoint without writing any backend code.</p><p>This means your Hugging Face Space gives you both a web interface and an API. Two deployments in one.</p><h3>How This Compares to the FastAPI + Render Approach</h3><p>In the last article, we built a raw API. This time we built a full web app. Here is how they compare:</p><p><strong>Use FastAPI + Render when:</strong></p><ul><li>You need a clean REST API for other applications to call</li><li>Your consumers are developers or backend services</li><li>You want full control over the request/response format</li><li>You are deploying tabular or structured data models</li></ul><p><strong>Use Hugging Face Spaces + Gradio when:</strong></p><ul><li>You want a visual demo anyone can try</li><li>Your model handles images, audio, or text</li><li>You want both a UI and an API with zero extra work</li><li>You want to share your work with the ML community</li></ul><p>Both approaches are valid. Many production systems use both: a Gradio Space for demos and testing, and a FastAPI service for the actual production pipeline.</p><h3>Common Issues and Fixes</h3><h3>Build fails with “out of memory”</h3><p>TensorFlow is large. If your Space fails during the pip install step, your model file plus dependencies might exceed the free tier&#39;s memory limit. Try switching to TensorFlow Lite or use a smaller model format.</p><h3>Model loads but predictions are wrong</h3><p>This almost always means your preprocessing does not match training. Check three things: image size (must match training), pixel scaling (did you divide by 255?), and class name order (must match the directory order from training).</p><h3>“No module named tensorflow” after build succeeds</h3><p>Make sure tensorflow is in your requirements.txt. If you used tensorflow-cpu during local development, use just tensorflow in requirements.txt. Hugging Face handles the CPU/GPU selection.</p><h3>Space shows “Runtime error”</h3><p>Check the Logs tab for the actual error message. The most common cause is a file path issue. If you are loading the model from HF Hub, make sure your repo_id and filename are correct.</p><h3>HF token errors when pushing model</h3><p>Make sure your token has <strong>Write</strong> permissions. Read tokens will not let you upload files. Also check that your secret name matches exactly what you use in code (HF_TOKEN).</p><h3>What You Can Do Next</h3><p>Now that you have a working web app, consider these improvements:</p><p><strong>Add a model card.</strong> Write a README for your model repository explaining what it does, what data it was trained on, and its limitations.</p><p><strong>Try different models.</strong> This same workflow works for any transfer learning model. ResNet, EfficientNet, Vision Transformers. The deployment steps stay the same. Just save your model, push to Hub, and update your app.py.</p><h3>Summary</h3><p>Deploying a deep learning model with a visual interface is easier than it sounds. The core steps are:</p><ol><li>Get your Hugging Face token and store it as a secret in Kaggle/Colab</li><li>Train your model and save it</li><li>Push the model to Hugging Face Hub directly from your notebook</li><li>Write a Gradio app that loads the model and runs predictions</li><li>Create a Hugging Face Space, upload your app.py and requirements.txt</li><li>Your web app is live</li></ol><p>The entire process is free and takes about 20 minutes. Once deployed, anyone in the world can open your link and test your model from their browser. It works for any deep learning model, any transfer learning architecture, all on a free CPU.</p><p>In the first article we learned how to serve a model as an API. Now we know how to give it a proper face. Next up, we will talk about what happens after deployment: monitoring your model and knowing when it is time to retrain.</p><p><em>This is Part 2 of a series on taking ML models from notebooks to production.</em><a href="https://medium.com/python-in-plain-english/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69"><em> part 1</em></a><em>covers deploying as an API with FastAPI and Render.</em></p><p><strong>About the Author</strong></p><p>Muhammad Ibrahim Qasmi is the youngest 3x Kaggle Grandmaster, specializing in computer vision and deep learning deployment. Follow his work on <a href="https://www.kaggle.com/ibrahimqasimi">Kaggle</a>, <a href="https://github.com/muhammadibrahim313">GitHub</a>, and <a href="https://ibrahimqasmi.com/">ibrahimqasmi.com</a> for more tutorials and projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Q_-_3FYDf7npm2RVstAvA.png" /><figcaption>Relax</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d736052139d9" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/deploy-your-first-deep-learning-model-on-hugging-face-and-share-live-demo-gradio-d736052139d9">Deploy Your First Deep Learning Model on Hugging Face and Share Live Demo (Gradio)</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSIRO Image2Biomass Prediction: 33rd Place Silver Medal Solution]]></title>
            <link>https://medium.com/@ibrahim313/csiro-image2biomass-prediction-33rd-place-silver-medal-solution-b34f6c349e06?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/b34f6c349e06</guid>
            <category><![CDATA[kaggle-competition]]></category>
            <category><![CDATA[biomass]]></category>
            <category><![CDATA[csiro]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Sat, 31 Jan 2026 02:25:54 GMT</pubDate>
            <atom:updated>2026-02-03T07:17:26.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*dMe9dKS_HjzyPw0jTqGtQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cdTmjF_-iCrcbmbH01Fm0w.jpeg" /><figcaption>Header</figcaption></figure><h3>Fine-tuning DINO v3 Huge (1.1B params) and combining it with SigLIP for pasture biomass prediction</h3><p>I am ibrahim :) , the youngest 3x Kaggle Grandmaster from Pakistan. Recently I competed in the CSIRO Image2Biomass Prediction competition and secured 33rd place out of 805+ teams, earning a silver medal and reaching Competition Expert rank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFXI2OBEBrNQ3_rRmGiyQA.png" /></figure><p>In this article, I will walk through my complete solution — the architecture, training strategy, what worked, and what did not.</p><h3>The Problem</h3><p><a href="https://www.csiro.au/en/">CSIRO (Commonwealth Scientific and Industrial Research Organisation)</a> hosted this competition to predict pasture biomass from images. The dataset contains images of Australian pastures collected across 19 sites from 2014–2017.</p><p>The task: predict 5 biomass components from a single pasture image:</p><ul><li>Dry_Green_g (10% weight)</li><li>Dry_Dead_g (10% weight)</li><li>Dry_Clover_g (10% weight)</li><li>GDM_g (20% weight)</li><li>Dry_Total_g (50% weight)</li></ul><p>These targets have physical relationships: GDM = Green + Clover, and Total = GDM + Dead. This constraint became important in my solution.</p><h3>The Approach</h3><p>Most public solutions used frozen DINO or SigLIP embeddings fed into gradient boosting models. They worked well, getting scores around 0.72–0.73.</p><blockquote><strong>My key insight:</strong> what if I fine-tune the entire DINO backbone instead of freezing it?</blockquote><p>This was risky. The training set has only 357 images. Fine-tuning a 1.1 billion parameter model on such small data usually leads to massive overfitting. But with proper regularization, it worked.</p><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ROd5vazLag__zk3uELy8w.png" /></figure><h3>Local Mamba Block</h3><p>This is a lightweight attention-like mechanism for feature fusion:</p><pre>class LocalMambaBlock(nn.Module):<br>    def __init__(self, dim, kernel_size=5, dropout=0.1):<br>        super().__init__()<br>        self.norm = nn.LayerNorm(dim)<br>        self.dwconv = nn.Conv1d(dim, dim, kernel_size, <br>                                 padding=kernel_size//2, groups=dim)<br>        self.gate = nn.Linear(dim, dim)<br>        self.proj = nn.Linear(dim, dim)<br>        self.drop = nn.Dropout(dropout)</pre><pre>    def forward(self, x):<br>        shortcut = x<br>        x = self.norm(x)<br>        g = torch.sigmoid(self.gate(x))<br>        x = x * g<br>        x = self.dwconv(x.transpose(1, 2)).transpose(1, 2)<br>        x = self.proj(x)<br>        return shortcut + self.drop(x)</pre><p>The depthwise convolution captures local patterns. The gating mechanism controls information flow. Residual connection maintains gradient flow.</p><h3>Training Configuration</h3><p>Parameter Value Model vit_huge_plus_patch16_dinov3.lvd1689m Image Size 512x512 Batch Size 6 Folds 4 (StratifiedGroupKFold) LR Backbone 1e-5 LR Head 5e-4 Weight Decay 1e-2 Dropout 0.2 Early Stopping 15 epochs Max Epochs 210 Scheduler Cosine annealing with 2 epoch warmup Precision Mixed (fp16)</p><h3>Data Augmentation</h3><p>Kept it simple. Heavy augmentation hurt performance on this small dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4x0Xs6s0o9P_WUcIZ2TD4w.png" /></figure><h3>Loss Function</h3><p>Weighted Huber loss in log space to handle the wide range of biomass values:</p><pre>weights = [0.1, 0.1, 0.1, 0.2, 0.5]  # Green, Dead, Clover, GDM, Total<br>loss = weighted_mean(HuberLoss(log1p(pred), log1p(target)))</pre><h3>The Ensemble</h3><p>DINO alone scored around 0.72–0.73. To push further, I combined it with SigLIP.</p><p>SigLIP is a vision-language model. I extracted embeddings and computed similarity scores against agricultural text concepts:</p><ul><li>“bare soil”, “exposed earth”</li><li>“dense pasture”, “thick grass”</li><li>“dead grass”, “yellow straw”</li><li>“white clover”, “broadleaf legume”</li></ul><p>These semantic features were fed into a GBDT ensemble (HistGradientBoosting, GradientBoosting, CatBoost, LightGBM averaged).</p><p>Final ensemble: <strong>75% DINO + 25% SigLIP</strong></p><p>For Clover specifically, I used 100% DINO because SigLIP struggled with it.</p><h3>Post-Processing</h3><p>Small calibrations based on prediction ranges:</p><pre># Clover tends to overpredict<br>Dry_Clover_g = Dry_Clover_g * 0.8</pre><pre># Dead material adjustments<br>if Dry_Dead_g &gt; 20:<br>    Dry_Dead_g = Dry_Dead_g * 1.1<br>elif Dry_Dead_g &lt; 10:<br>    Dry_Dead_g = Dry_Dead_g * 0.9</pre><pre># Enforce physical relationships<br>GDM_g = Dry_Green_g + Dry_Clover_g<br>Dry_Total_g = GDM_g + Dry_Dead_g</pre><h3>Results</h3><h3>Cross-Validation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6h_iUtpZGzEMfjlkI28cw.png" /></figure><h3>Leaderboard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_FboQs7-5bnbVH6K1QCofw.png" /></figure><p>The shakeup was significant. Trusting CV over public LB paid off.</p><h3>What Worked</h3><ol><li><strong>Fine-tuning the full backbone</strong> — Biggest gain came from retraining DINO instead of using frozen embeddings</li><li><strong>Respecting target relationships</strong> — GDM and Total are derived quantities, predictions should maintain this</li><li><strong>Simple augmentation</strong> — Basic flips and rotations outperformed heavy transforms</li><li><strong>Strong regularization</strong> — Dropout, weight decay, and early stopping prevented overfitting</li><li><strong>Ensemble diversity</strong> — DINO (visual patterns) + SigLIP (semantic concepts) captured different aspects</li></ol><h3>What Did Not Work</h3><ul><li>Heavy augmentation (cutout, mixup, aggressive color transforms)</li><li>Test time augmentation (minimal gain, not worth the complexity)</li><li>Training beyond early stopping</li><li>Complex loss functions</li></ul><h3>Code and Resources Below</h3><blockquote>→ <a href="https://www.kaggle.com/competitions/csiro-biomass/writeups/33rd-place-silver-medal-solution"><strong>Kaggle Writeup (detailed discussion):</strong></a></blockquote><blockquote>→ <a href="https://github.com/muhammadibrahim313/CSIRO-Image2Biomass-33rd-Place-Silver-Kaggle-Comp"><strong>GitHub Repository</strong></a></blockquote><blockquote>→ <a href="https://www.kaggle.com/code/ibrahimqasimi/csiro-biomass-33rd-rank-training-0-74-0-63"><strong>Training Notebook</strong></a></blockquote><blockquote>→ <a href="https://www.kaggle.com/code/ibrahimqasimi/csiro-biomass-33rd-rank-inference-0-74-0-63"><strong>Inference Notebook</strong></a></blockquote><blockquote>→ <a href="https://www.kaggle.com/datasets/ibrahimqasimi/dino-huge-retrain-checkpoints-zul"><strong>Model Checkpoints</strong></a></blockquote><p><a href="https://www.kaggle.com/ibrahimqasimi"><em>Muhammad Ibrahim Qasmi | Youngest 3x Kaggle Grandmaster from Pakistan</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b34f6c349e06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Your First Machine Learning Model as a Public API]]></title>
            <link>https://python.plainenglish.io/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/f992ac422f69</guid>
            <category><![CDATA[ml-model-deployment]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[render]]></category>
            <category><![CDATA[fastapi]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Sun, 25 Jan 2026 06:47:19 GMT</pubDate>
            <atom:updated>2026-02-01T11:40:17.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H1Cy8URglGT_2AXx0D5VdA.png" /></figure><p><strong>A step-by-step guide for data science students who want to take their models from notebooks to production</strong></p><p>You trained a model. It works. The accuracy looks good. Now what?</p><p>Most data science tutorials stop at model evaluation. They show you how to split data, tune hyperparameters, and print accuracy scores. But nobody talks about what happens next. How do you actually use this model outside of a Jupyter notebook? How do you let other people or applications send data and get predictions back?</p><p>This guide answers that question. By the end, you will have a live API endpoint that accepts JSON input and returns predictions. Anyone with the URL can use it.</p><p><em>No prior deployment experience required :)</em></p><h3>What We Will Build</h3><p>We will take a trained machine learning model and turn it into a web API. The API will accept customer data and return a churn prediction. The entire setup uses free tools and takes about 30 minutes.</p><p><strong>The workflow looks like this:</strong></p><ol><li>Save your trained model as a pickle file</li><li>Write a simple API using FastAPI</li><li>Push your code to GitHub</li><li>Deploy to Render (free tier)</li><li>Test with Postman</li></ol><h3>Prerequisites</h3><p>Before starting, make sure you have:</p><ul><li>A trained machine learning model (any model works)</li><li>A GitHub account</li><li>Basic familiarity with Python</li></ul><p>You do not need to know anything about web development, APIs, or cloud platforms. We will cover everything.</p><h3>Step 1: Save Your Trained Model</h3><p>Whether you trained your model on <a href="https://www.kaggle.com/">Kaggle,</a> <a href="https://colab.research.google.com/">Google Colab</a>, or your local machine, the process is the same. You need to save the model object to a file.</p><p>Add this code after your training is complete:</p><pre>import joblib<br>import osp<br># Save your trained model<br>artifact = {<br>    &quot;model&quot;: best_model,  # your trained model or pipeline<br>    &quot;feature_columns&quot;: X.columns.tolist(),  # columns your model expects<br>    &quot;label_map&quot;: {0: &quot;No&quot;, 1: &quot;Yes&quot;}  # optional: maps predictions to labels<br>}<br>save_path = &quot;model.pkl&quot;<br>joblib.dump(artifact, save_path)<br>print(&quot;Saved:&quot;, save_path)<br>print(&quot;File size (MB):&quot;, round(os.path.getsize(save_path) / (1024 * 1024), 3))</pre><p><strong>What this does:</strong></p><ul><li>joblib.dump saves your model to a file</li><li>We wrap the model in a dictionary so we can include extra information like feature names</li><li>The file extension .pkl stands for pickle, Python&#39;s serialization format</li></ul><p><strong>Important:</strong> If your model includes preprocessing steps like scaling or encoding, save the entire pipeline, not just the classifier. This ensures your API can accept raw input without needing separate preprocessing code.</p><p><em>Download the pickle file to your computer. You will upload it to GitHub in the next step.</em></p><h3>Step 2: Create a GitHub Repository</h3><p>Go to GitHub and create a new repository. Name it something like ml-model-api or churn-prediction-api.</p><p>Your repository needs three files:</p><h4>File 1: requirements.txt</h4><p>This tells the server which Python packages to install.</p><pre>scikit-learn==1.6.1<br>joblib==1.5.3<br>numpy==2.0.2<br>pandas==2.2.2<br>fastapi==0.115.0<br>uvicorn==0.30.6</pre><p><strong>Note:</strong> Match the scikit-learn version to whatever version you used during training. Version mismatches are the most common cause of deployment failures.</p><p>To check your version, run:</p><pre>import sklearn<br>print(sklearn.__version__)</pre><h4>File 2: app.py</h4><p>This is your API code. Copy and paste this entire file:</p><pre>import os<br>import joblib<br>import pandas as pd<br>from fastapi import FastAPI, HTTPException<br>from pydantic import BaseModel</pre><pre>MODEL_PATH = os.getenv(&quot;MODEL_PATH&quot;, &quot;model.pkl&quot;)<br>app = FastAPI(title=&quot;ML Model API&quot;, version=&quot;1.0&quot;)<br>model = None<br>feature_columns = None<br>label_map = None<br>class PredictionRequest(BaseModel):<br>    # Define your input fields here<br>    # This example uses customer churn data<br>    gender: str<br>    SeniorCitizen: int<br>    Partner: str<br>    Dependents: str<br>    tenure: int<br>    PhoneService: str<br>    MultipleLines: str<br>    InternetService: str<br>    OnlineSecurity: str<br>    OnlineBackup: str<br>    DeviceProtection: str<br>    TechSupport: str<br>    StreamingTV: str<br>    StreamingMovies: str<br>    Contract: str<br>    PaperlessBilling: str<br>    PaymentMethod: str<br>    MonthlyCharges: float<br>    TotalCharges: float<br>@app.on_event(&quot;startup&quot;)<br>def load_model():<br>    global model, feature_columns, label_map<br>    if not os.path.exists(MODEL_PATH):<br>        raise RuntimeError(f&quot;Model file not found: {MODEL_PATH}&quot;)<br>    artifact = joblib.load(MODEL_PATH)<br>    if isinstance(artifact, dict) and &quot;model&quot; in artifact:<br>        model = artifact[&quot;model&quot;]<br>        feature_columns = artifact.get(&quot;feature_columns&quot;, None)<br>        label_map = artifact.get(&quot;label_map&quot;, {0: &quot;No&quot;, 1: &quot;Yes&quot;})<br>    else:<br>        model = artifact<br>        feature_columns = None<br>        label_map = {0: &quot;No&quot;, 1: &quot;Yes&quot;}<br>@app.get(&quot;/&quot;)<br>def home():<br>    return {&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;ML Model API is running&quot;}<br>@app.get(&quot;/health&quot;)<br>def health():<br>    return {&quot;status&quot;: &quot;ok&quot;, &quot;model_loaded&quot;: model is not None}<br>@app.post(&quot;/predict&quot;)<br>def predict(req: PredictionRequest):<br>    if model is None:<br>        raise HTTPException(status_code=500, detail=&quot;Model not loaded&quot;)<br>    record = req.model_dump()<br>    df = pd.DataFrame([record])<br>    try:<br>        if feature_columns is not None:<br>            df_enc = pd.get_dummies(df)<br>            df_enc = df_enc.reindex(columns=feature_columns, fill_value=0)<br>            X = df_enc<br>        else:<br>            X = df<br>        if hasattr(model, &quot;predict_proba&quot;):<br>            prob = float(model.predict_proba(X)[0][1])<br>        else:<br>            pred = int(model.predict(X)[0])<br>            prob = float(pred)<br>        pred_int = 1 if prob &gt;= 0.5 else 0<br>        pred_label = label_map.get(pred_int, str(pred_int))<br>        return {<br>            &quot;prediction&quot;: pred_int,<br>            &quot;label&quot;: pred_label,<br>            &quot;probability&quot;: round(prob, 4)<br>        }<br>    except Exception as e:<br>        raise HTTPException(status_code=500, detail=str(e))</pre><h4>File 3: Procfile</h4><p>Create a file named exactly Procfile (no extension, capital P).</p><pre>web: uvicorn app:app --host 0.0.0.0 --port $PORT</pre><p>This tells Render how to start your server.</p><h4>File 4: Your pickle file</h4><p>Upload your model.pkl file to the repository.</p><p>Your repository should now have these files:</p><ul><li>app.py</li><li>requirements.txt</li><li>Procfile</li><li>model.pkl</li></ul><blockquote>Check Example Repo : <a href="https://github.com/muhammadibrahim313/ml-model-deployment-Telco-Customer-Churn">ml-model-deployment-Telco-Customer-Churn</a></blockquote><h3>Step 3: Deploy to Render</h3><p><a href="https://render.com/">Render</a> is a cloud platform that hosts web applications. Their free tier is enough for testing and personal projects.</p><h4>Create an account</h4><p>Go to <a href="https://render.com/">render.com</a> and sign up. You will need to add a payment method. They may charge a small verification amount (usually $1) but the free tier itself has no monthly cost.</p><h4>Create a new Web Service</h4><ol><li>Click <strong>New</strong> and select <strong>Web Service</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vW_sFbdYY0QOE8-eyVQDyw.jpeg" /></figure><p>2. Connect your GitHub account</p><p>3. Select your repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPbEbpes3xMu3ybb8BqJXg.jpeg" /></figure><p>4. Configure the settings:</p><p><strong>Name:</strong> Choose any name (this becomes part of your URL)</p><p><strong>Environment:</strong> Python 3</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNV6wYKWRmo2N1PzDmyl4Q.jpeg" /></figure><p><strong>Build Command:</strong></p><pre>pip install -r requirements.txt</pre><p><strong>Start Command:</strong></p><pre>uvicorn app:app --host 0.0.0.0 --port $PORT</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtPCURG6kiRHVEcdGeCMoQ.jpeg" /></figure><p>5. Select the <strong>Free</strong> instance type</p><p>6. Click <strong>Create Web Service</strong></p><p>Render will now build and deploy your application. This takes a few minutes on the first deploy.</p><h3>Important note about free tier</h3><blockquote>Free instances spin down after 15 minutes of inactivity. The first request after sleep can take 30 to 50 seconds while the server wakes up. This is normal for free tier. After the first request, responses are fast.</blockquote><h3>Step 4: Test Your API</h3><p>Once Render shows your service as “Live”, you have a working API.</p><p>Your URL will look like:</p><pre>https://your-app-name.onrender.com <br><br>#eg:https://ml-model-deployment-telco-customer-churn.onrender.com/</pre><h4>Quick test in browser</h4><p>Open your URL in a browser. You should see:</p><pre>{&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;ML Model API is running&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*nSiDyQ_aCfqR-91_JXda2g.png" /></figure><p>If you see this, your API is working.</p><h3>Step5: Test predictions with Postman</h3><p><a href="https://www.postman.com/">Postman </a>is a tool for testing APIs. Download Postman Desktop (the web version has timeout issues with free tier services).</p><ol><li>Create a new request</li><li>Set method to <strong>POST</strong></li><li>Enter your URL with /predict at the end:</li></ol><pre>https://your-app-name.onrender.com/predict<br><br>#eg: https://ml-model-deployment-telco-customer-churn.onrender.com/predict</pre><p>4. Go to <strong>Headers</strong> tab and add:</p><pre>Key: Content-Type<br>Value: application/json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9B9-u5J68oA7KxHT7g2nqg.png" /></figure><p>5. Go to <strong>Body</strong> tab, select <strong>raw</strong> and <strong>JSON</strong></p><p>Paste your test data(input features) :</p><pre>{<br>  &quot;gender&quot;: &quot;Female&quot;,<br>  &quot;SeniorCitizen&quot;: 0,<br>  &quot;Partner&quot;: &quot;Yes&quot;,<br>  &quot;Dependents&quot;: &quot;No&quot;,<br>  &quot;tenure&quot;: 12,<br>  &quot;PhoneService&quot;: &quot;Yes&quot;,<br>  &quot;MultipleLines&quot;: &quot;No&quot;,<br>  &quot;InternetService&quot;: &quot;Fiber optic&quot;,<br>  &quot;OnlineSecurity&quot;: &quot;No&quot;,<br>  &quot;OnlineBackup&quot;: &quot;Yes&quot;,<br>  &quot;DeviceProtection&quot;: &quot;No&quot;,<br>  &quot;TechSupport&quot;: &quot;No&quot;,<br>  &quot;StreamingTV&quot;: &quot;Yes&quot;,<br>  &quot;StreamingMovies&quot;: &quot;Yes&quot;,<br>  &quot;Contract&quot;: &quot;Month-to-month&quot;,<br>  &quot;PaperlessBilling&quot;: &quot;Yes&quot;,<br>  &quot;PaymentMethod&quot;: &quot;Electronic check&quot;,<br>  &quot;MonthlyCharges&quot;: 89.1,<br>  &quot;TotalCharges&quot;: 1069.2<br>}</pre><p>Click <strong>Send</strong></p><p>You should receive a response like:</p><pre>{<br>  &quot;prediction&quot;: 1,<br>  &quot;label&quot;: &quot;Yes&quot;,<br>  &quot;probability&quot;: 0.8234<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ezXImcWuBq6ehILXfoj2Q.png" /></figure><p>Your model is now accessible to anyone with the URL.(see, 200 OK (Status) means our URL is working)</p><h3>Links that u might wanna visit:-</h3><p>All the code and files used in this tutorial are available on GitHub. If you want to see the complete training notebook with model evaluation, check out the Kaggle project.</p><p><em>→ </em><a href="https://github.com/muhammadibrahim313/ml-model-deployment-Telco-Customer-Churn"><em>GitHub Repository</em></a></p><p><em>→ </em><a href="https://www.kaggle.com/code/danishmubashar/telco-customer-churn-97-accuracy"><em>Kaggle Notebook</em></a></p><blockquote>Note: If you download the pickle file from Kaggle, check the Output tab of the notebook. Make sure your local numpy and scikit-learn versions match what was used during training to avoid compatibility errors.</blockquote><h3>Common Issues and Fixes</h3><h3>“Model not found” error</h3><p>Make sure your pickle file is in the repository root and named correctly. Check that MODEL_PATH in app.py matches your filename.</p><h3>Version mismatch errors</h3><p>If you see errors about incompatible versions or dtype mismatches, your local scikit-learn version differs from your requirements.txt. Retrain and save your model using the same version you deploy with.</p><h3>Timeout on first request</h3><p>This is normal for free tier. The server sleeps after inactivity. Wait 30 to 60 seconds or open the root URL in a browser first to wake it up.</p><h3>“No open ports detected” in Render logs</h3><p>This usually means your app crashed during startup. Check that your pickle file uploaded correctly and your requirements.txt includes all needed packages.</p><h3>What You Can Do Next (optional)</h3><p>Now that you have a working API, consider these improvements:</p><p><strong>Add authentication.</strong> Protect your endpoint with API keys so only authorized users can access it.</p><p><strong>Add logging.</strong> Track who is using your API and what predictions they request.</p><p><strong>Connect to a frontend.</strong> Build a simple web form that sends data to your API and displays results.</p><p><strong>Try other platforms.</strong> Railway, Heroku, and Google Cloud Run offer similar free tiers with different tradeoffs.</p><h3>Summary</h3><p>Deploying a machine learning model is simpler than most tutorials make it seem. The core steps are:</p><ol><li>Save your model with joblib</li><li>Write a FastAPI endpoint that loads and uses the model</li><li>Push to GitHub</li><li>Connect GitHub to Render</li><li>Test with Postman</li></ol><p>The entire process uses free tools and takes about 30 minutes. Once deployed, your model can receive requests from anywhere in the world.</p><p>The next time someone asks “but how do you actually use this model?”, you will have an answer :)</p><p><em>If you found this helpful, consider sharing it with someone who is stuck at the model.fit() stage of their data science journey.</em></p><p><em>Follow my work on </em><a href="https://www.kaggle.com/ibrahimqasimi"><em>Kaggle</em></a>,<a href="https://github.com/muhammadibrahim313">Github</a></p><blockquote>Author: <a href="https://www.kaggle.com/ibrahimqasimi">Muhammad Ibrahim Qasmi (Youngest 3x kaggle Grandmaster)</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f992ac422f69" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/deploy-your-first-machine-learning-model-as-a-public-api-f992ac422f69">Deploy Your First Machine Learning Model as a Public API</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Gemini Pro Free for Students: The Complete Guide to Maximizing Your 1-Year Subscription]]></title>
            <link>https://medium.com/@ibrahim313/google-gemini-pro-free-for-students-the-complete-guide-to-maximizing-your-1-year-subscription-62eb271bd7c9?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/62eb271bd7c9</guid>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[gemini-pro-for-students]]></category>
            <category><![CDATA[google-gemini-pro]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Thu, 16 Oct 2025 13:48:36 GMT</pubDate>
            <atom:updated>2025-10-16T13:48:36.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2vqwq1G9FrTcbyBiuv-fPg.png" /><figcaption><a href="https://www.google.com/">Source</a></figcaption></figure><p>When Google announced they were giving students a free year of Gemini Pro, most people saw it as just another tech company promotion. But after diving deep into how students are actually using this tool, I discovered something more interesting. This isn’t just about free AI access. It’s about a complete transformation in how students study, research, and learn.</p><p>The offer includes Gemini Advanced with the 2.5 Pro model, two terabytes of storage, NotebookLM Plus with five times the capacity of the free version, Deep Research capabilities, and full Google Workspace integration. The total value adds up to around $360 per year when you consider the storage and AI subscription separately. For students on tight budgets, that number matters.</p><p>But here’s what nobody tells you in the promotional materials. The real value isn’t in the features list. It’s in knowing how to actually use these tools to save time, improve your grades, and make studying feel less like a chore. Let me show you exactly how to do that.</p><h3>What You’re Actually Getting</h3><p>Gemini Pro gives you access to Google’s most powerful AI model, which can process over a million tokens in a single conversation. In practical terms, this means you can upload an entire textbook and ask questions about any chapter without having to copy and paste individual sections. The AI remembers everything you’ve shared in that conversation.</p><p>The Guided Learning mode is different from regular AI chat. Instead of just giving you answers, it asks clarifying questions and walks you through concepts step by step. It checks if you understand along the way and adapts its explanations based on how you respond. One student described it as having a personal tutor who never gets impatient when you ask the same question three different ways.</p><p>Deep Research is where things get really powerful. You give it a topic, and it automatically analyzes over a hundred websites to create a comprehensive report with proper citations. What used to take you ten or fifteen hours of manual research now happens in about thirty minutes. Students writing major papers report saving between fifteen and twenty-five hours per project using this feature alone.</p><p>NotebookLM Plus deserves special attention because it’s become the standout feature for most students. You can upload up to fifteen hundred pages of material per notebook, and it creates these things called Audio Overviews. Imagine turning your textbook chapters into podcast-style content that you can listen to during your commute. Students are converting entire semesters worth of material into audio format and studying while they walk to class or sit on the bus.</p><p>The two terabytes of storage matters more than you might think. Most students are stuck with fifteen gigabytes on the free tier, which fills up fast with photos, videos, and documents. Having two terabytes means you can back up everything without constantly deleting files to make space. One important warning though: when your subscription ends, if you’re over the standard fifteen gigabytes, you won’t be able to upload new files until you delete enough to get back under the limit.</p><h3>How to Actually Claim the Offer Without Losing Your Mind</h3><p>The process should be straightforward, but many students run into problems. Here’s exactly what you need to do. First, go directly to gemini.google.com/students or one.google.com/ai-student. Don’t click on search results because there have been reports of phishing sites.</p><p>Sign in with your personal Gmail account. This is critical. Do not use your school-issued Google account. Even if your school email ends in gmail.com, you need to use a personal Gmail account that you created yourself. This trips up more students than anything else.</p><p>Click on “Verify Eligibility” or “Get Offer” and you’ll be taken to SheerID for verification. You have two options here. The first is instant email verification where you enter your school email address and click the verification link they send you. This works within twenty-four hours if your school is in their database. The second option is document upload where you provide a student ID, fee receipt, or enrollment letter. Make sure whatever document you upload shows your school’s name or logo and includes dates from the current academic year. Blurry photos get rejected automatically, so take a clear picture in good lighting.</p><p>After verification succeeds, you’ll need to add a payment method. Don’t worry, you won’t be charged during the twelve-month free period. Google just requires having a card on file. Once that’s done, go back to the Gemini app and check your settings to confirm you see “Google One AI Premium — Student” status. Your benefits should activate immediately.</p><h3>The Geographic Lottery and Deadline Confusion</h3><p>Not all students worldwide have access to this offer, and the deadlines vary wildly by region. Students in the United States initially had an October deadline, but Google extended it. If you sign up by June 30, 2025, you get access through August 31, 2026. Students in India had a September 15, 2025 deadline. Canada extends to December 9, 2025. The UK and several African countries including Ghana, Nigeria, Kenya, Rwanda, South Africa, Egypt, and Zimbabwe have November 3, 2025 deadlines.</p><p>More than twenty countries now have access, with recent additions including Taiwan, Bangladesh, Iraq, Jordan, UAE, Germany, Mexico, and Saudi Arabia. Google keeps adding countries, but they’re not always announcing it clearly. If you’re not sure whether your country is included, check the official student offer page directly.</p><p>Thousands of students have discovered the offer only after their regional deadline passed. That’s $240 in value lost because they waited. If you’re reading this and you’re eligible, don’t put it off. Even if you’re not sure you’ll use it heavily, the storage alone makes it worth claiming.</p><h3>The Verification Nightmare Nobody Prepared You For</h3><p>While Google’s documentation makes the process sound simple, reality tells a different story. Students at major universities including University of Toronto, University of Waterloo, and Toronto Metropolitan University report that SheerID requires manual document uploads even when they have perfectly valid school email addresses. The reviews can take up to forty-eight hours, and sometimes perfectly legitimate documents get rejected with no clear explanation.</p><p>Google Support forums are filled with unanswered threads. “Cannot register for Gemini Pro for students.” “Unable to Redeem Google AI Pro / Gemini Student Offer — SheerID Verification Blocked.” “SheerID rejected student verification — single name issue.” The pattern suggests the system works seamlessly for some schools while creating impossible barriers for others, with no transparency about why.</p><p>This frustration has created an unfortunate trend. Students are turning to fake student ID generators and sharing templates on forums like TechnoFino, Telegram, and Reddit. While I absolutely cannot recommend this approach because it violates terms of service and could get your account banned, the trend’s existence reveals a real problem. Legitimate students who deserve access are being blocked by inconsistent verification systems.</p><p>If you’re having trouble with verification, here are some legitimate troubleshooting steps. First, make sure you’re not using a VPN or proxy service. Connect directly from your campus network if you’re an international student. Second, if your school email doesn’t work for instant verification, switch to document upload. Third, contact SheerID support directly at <a href="/service/mailto:customerservice@sheerid.com">customerservice@sheerid.com</a> if problems persist beyond twenty-four hours. Finally, if your institution email has issues, talk to your IT department about whether the email appears in educational databases that SheerID uses.</p><h3>The Five Mistakes That Waste Your Free Year</h3><p>The <em>first </em>and most common mistake is using your school account instead of a personal Gmail. I’ve already mentioned this, but it bears repeating because it’s the number one reason students fail to activate their subscriptions. Verify your eligibility with your school email, but sign up and activate using your personal Gmail.</p><p>The <em>second </em>mistake involves existing Google One subscriptions. If you already have a Google One plan, you cannot stack the student offer on top of it. You have to cancel your current subscription, wait for the billing cycle to end, and then apply for the student offer. Several students got caught in a timing trap where they received a free year of Google One with a new Pixel phone, but by the time that promotion expires, the student offer deadline will have passed. They effectively lost access to the more valuable student offer because of timing.</p><p>The <em>third</em> mistake is procrastination. I’ve seen it happen over and over. Students hear about the offer, think “I’ll do that later,” and then discover weeks or months later that their regional deadline has passed. Don’t let this be you. If you’re eligible, claim it today.</p><p>The <em>fourth</em> mistake happens during document upload. Students submit blurry photos, documents from previous academic years, or materials that don’t clearly show the school logo and current enrollment dates. Every rejection means starting the review process over, which takes another forty-eight hours. Take five minutes to ensure your documents are perfect before submitting.</p><p>The <em>fifth </em>mistake is forgetting to set a cancellation reminder. Google will send you an email reminder within a month of your subscription expiring, but if you miss it, you’ll automatically be charged $19.99 per month. For a student on a budget, that’s a significant unexpected expense. Set a calendar reminder for month eleven of your subscription to evaluate whether you want to continue or cancel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbhK3BGsl3DsVxhs9OLtIA.png" /></figure><h3>How Successful Students Are Actually Using This</h3><p>The students getting the most value aren’t just asking Gemini random questions. They’ve built complete workflows around it. Let me show you what that actually looks like in practice.</p><p>One approach that works incredibly well is called the Test Maker Mindset. Instead of asking “What is photosynthesis?” you ask “What are the top three essay questions a teacher would likely use on a test about photosynthesis?” This completely changes how you engage with material. You’re not just memorizing facts anymore. You’re thinking about what matters most and anticipating how concepts might be tested. Students report this creates much deeper understanding because you’re synthesizing information from the perspective of someone evaluating knowledge rather than passively absorbing it.</p><p>The Reverse Engineering method takes a different approach. You start with a specific detail and work backward to build complete understanding. For example, if you’re studying the 2008 financial crisis, you might ask “What role did mortgage-backed securities play in the crisis?” Then follow up with “How did the housing market contribute to the creation of these securities?” Each answer generates new questions that uncover underlying mechanisms. This works particularly well for complex historical events, scientific processes, economic concepts, and literary analysis.</p><p>For major research projects, students are combining Deep Research with NotebookLM in a workflow that saves massive amounts of time. First, use Deep Research to analyze hundreds of sources and generate a comprehensive report with citations. Then upload all those sources to NotebookLM. From there, you can create Audio Overviews to review the research during your commute, build mind maps that visualize connections between sources, and generate study guides for presentations. One graduate student said this combination transformed thesis research from weeks of manual source compilation to just a few days of AI-assisted synthesis.</p><p>The PARTS framework gives structure to your prompts and dramatically improves output quality. PARTS stands for Persona, Act, Recipient, Theme, and Structure. An example: “You are a biology tutor for tenth graders. Create a study guide on cellular respiration that includes key concepts, diagrams, and five practice questions.” Students who start using this framework consistently report that their results get dramatically better compared to generic prompts like “explain cellular respiration.”</p><h3>Subject-Specific Strategies That Transform Learning</h3><p>History and social studies students have discovered unique applications. They upload political cartoons and ask for detailed analysis. They create timeline visualizations from historical events. Some students even conduct mock oral history interviews where the AI plays historical figures, then they transcribe and analyze those conversations. One student told me this creates deeper engagement with historical perspectives than traditional reading alone because you’re actively conversing with ideas rather than passively consuming them.</p><p>Science students leverage the multimodal capabilities in creative ways. They photograph lab experiments and ask Gemini to generate hypotheses about what might happen. They upload images of specimens for identification with detailed taxonomic breakdowns. They turn raw experimental data into visualizations. The ability to process entire textbooks means you can ask questions that span multiple chapters, like “How does the concept introduced in Chapter 3 relate to the experiment described in Chapter 7?” This eliminates the cognitive load of remembering where specific information appeared while building connections across topics.</p><p>Mathematics goes beyond simple problem-solving. Students upload entire problem sets and ask for step-by-step solutions with explanations at each stage. They generate practice problems at varying difficulty levels. They create visual representations of abstract concepts. One calculus student described uploading solutions to problems they got wrong and asking Gemini to explain not just the right answer but why the original approach failed and what conceptual misunderstanding led to the error. This meta-learning approach builds much stronger understanding than just getting correct answers.</p><p>Language arts students upload character images from their assigned books and ask for personality analysis grounded in textual evidence. They generate narrative writing prompts from images. They create book cover redesigns with artistic rationale. They analyze literary devices across multiple works simultaneously. The million-plus token context window means you can upload entire novels for analysis and ask questions like “How does the author’s use of water imagery in Chapter 2 foreshadow events in Chapter 15?” without manually finding and copying relevant passages.</p><p>Foreign language learners use voice recording features for pronunciation feedback. They generate culturally appropriate conversation starters. They create vocabulary quizzes organized by topic. They request explanations of idiomatic expressions with cultural context. They practice interactive dialogues using Gemini Live’s conversational voice interface that mimics natural dialogue. Students report this multimodal approach creates more engaging practice than traditional flashcard applications.</p><h3>The Honest Comparison With ChatGPT Nobody Wants to Admit</h3><p>Let me be straight with you. For coding and mathematics, ChatGPT generally outperforms Gemini. Students working on programming assignments or advanced calculus consistently report that ChatGPT’s step-by-step explanations and error identification are superior, despite Gemini scoring higher on some Python benchmarks. If you’re a computer science major, the coding assistance quality difference might justify paying for ChatGPT Plus in addition to using free Gemini.</p><p>For academic writing, the results split by purpose. Gemini excels at formal academic tone matching and research paper structure. ChatGPT produces more engaging creative writing and storytelling. Multiple students note that Gemini outputs read appropriately scholarly for term papers, while ChatGPT’s style works better for personal essays or creative fiction assignments. This distinction matters because submitting AI-generated content with inappropriate tone can flag potential academic integrity concerns.</p><p>Research capabilities show different strengths. ChatGPT’s Deep Research analyzes for thirty minutes across forty-plus sources, which is ideal for thesis-level work requiring comprehensive literature reviews. Gemini’s faster research completes in minutes with twenty-plus sources and includes current 2024–2025 data thanks to its January 2025 knowledge cutoff versus ChatGPT’s June 2024 cutoff. For assignments on recent events, Gemini’s real-time Google Search integration provides accurate current information while ChatGPT may produce outdated details.</p><p>But here’s the decisive factor for most students. Gemini is completely free for a year versus $240 annually for ChatGPT Plus with no student discount. Gemini has seamless Google Workspace integration that lets you work directly within Docs, Sheets, Slides, Gmail, and Meet with AI assistance in side panels. ChatGPT lacks this native integration. Gemini includes two terabytes of storage solving a universal student problem. ChatGPT offers no storage benefits. Gemini provides unlimited image generation while ChatGPT has rate limits that matter if you’re creating frequent presentation visuals.</p><p>The consensus among students seems to be this: Gemini Pro 2.5 is currently the best overall value for students. NotebookLM is the best learning tool available by a significant margin. For most students, the free Gemini offer covers all their needs without requiring additional tools. For computer science majors and students in mathematics-heavy disciplines, ChatGPT Plus might be worth paying for as a secondary tool specifically for coding and advanced problem-solving.</p><p>The optimal strategy for serious students is to claim the free Gemini offer immediately, then evaluate whether specific needs justify adding ChatGPT Plus as a supplement. Don’t choose one or the other. Use both if your workflow requires it.</p><h3>Privacy Concerns and the Strategy Nobody Discusses</h3><p>Google officially states that your data is not human-reviewed or used to train AI models with enterprise-grade data protection equivalent to Gmail and Docs. However, there’s an important catch. The requirement to use personal Gmail accounts rather than school-issued accounts raises questions about data separation between your academic work and Google’s commercial ecosystem.</p><p>More fundamentally, this free offer is part of a larger strategy. Google CEO Sundar Pichai has a reported goal of reaching five hundred million Gemini users by the end of 2025. The one billion dollar three-year investment in AI education represents customer acquisition spending spread across millions of students who will carry Gemini workflows into professional careers. The strategy is transparent: teach students how indispensable these tools are during college, then convert them to paying customers for life once they graduate.</p><p>This isn’t conspiracy theory. It’s explicit business strategy. The same thing happened with Microsoft Office and Google Workspace. Students who learn these tools in school continue using them professionally because the switching costs and relearning time make changing platforms inconvenient. Google is playing the long game, and the free student subscription is the opening move.</p><p>Smart students approach this with open eyes. Accept the substantial free value while maintaining awareness of the dependency being cultivated. Verify that AI assistance genuinely enhances rather than replaces your learning. Follow your institution’s guidelines on AI usage to avoid academic integrity violations. Maintain critical evaluation of AI outputs rather than blind trust. The goal should be building AI augmentation skills rather than AI dependency.</p><h3>What to Do Right Now</h3><p>If you’re eligible for this offer, claim it today. Don’t wait. Even if you’re unsure about using it heavily, the storage alone provides $120 in annual value independent of AI capabilities. Set a calendar reminder for month eleven to evaluate whether continuation at $19.99 per month justifies the cost.</p><p>For your first month, focus on establishing workflows rather than random queries. Upload all your course syllabi and textbooks to NotebookLM to maximize context for future questions. Create custom Gems for different courses using the Learning Coach Gem as a template. Generate comprehensive study guides for upcoming units to frontload your preparation. Experiment with different prompting techniques to identify what produces the best results for your learning style.</p><p>The students who benefit most from this offer aren’t necessarily the ones who use it most frequently. They’re the ones who use it most strategically. They build systems around it. They integrate it into their regular study routines. They treat it as infrastructure supporting their entire academic process rather than an occasional question-answering service.</p><p>And most importantly, they never stop being critical thinkers. They verify important facts against authoritative sources. They cross-reference claims when accuracy matters. They treat AI as a knowledgeable assistant rather than an infallible authority. They maintain the ability to do excellent work independently, using AI as amplification rather than replacement.</p><p>The real value of this offer transcends the promotional hype. It’s not about the storage or the AI model or the specific features. It’s about learning how to work with AI tools during a formative period when you have the time and freedom to experiment without the pressure of workplace productivity demands. The skills you develop now, the workflows you establish, the critical thinking you maintain while using these tools — that’s what will serve you long after this free subscription ends.</p><p>Claim your offer today. Build your systems. Maintain your judgment. And use this opportunity to become not just a better student, but a more capable thinker who knows how to leverage any tool without becoming dependent on any particular one. That’s the real education here.</p><p>Connect with me : <a href="https://www.linkedin.com/in/muhammad-ibrahim-qasmi-9876a1297/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62eb271bd7c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set a Deadline and watch your Productivity Skyrocket !]]></title>
            <link>https://medium.com/@ibrahim313/set-a-deadline-and-watch-your-productivity-skyrocket-eefdf50605e8?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/eefdf50605e8</guid>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[daydreaming]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[goals-objectives]]></category>
            <category><![CDATA[goals-in-life]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Thu, 13 Feb 2025 04:20:19 GMT</pubDate>
            <atom:updated>2025-02-13T04:20:19.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JcZr4VIntepZqNlQ14hlQ.png" /></figure><h3>Set a Deadline and watch your Productivity Skyrocket !</h3><p>Have you ever felt like your big ideas were floating around, waiting for a little spark to turn them into reality? The secret sauce is simple: <strong>deadlines</strong>. They’re not just dates on a calendar — they’re the arrows that guide you from intention to action.</p><h3><strong>→ Why Deadlines Matter</strong></h3><p>→ <strong>They Anchor Your Vision:</strong> A goal without a deadline is like a kite without a string — it might soar briefly, but it never stays grounded.</p><p>→ <strong>They Create Urgency:</strong> When time is ticking, every moment counts. A deadline sharpens your focus, turning “someday” into “right now.!!”</p><p>→ <strong>They Build Momentum:</strong> Each mini deadline is a small victory that adds up. Celebrate these wins — they’re the fuel that pushes you toward your larger goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdadn6ruurzsE5042HPPWw.png" /></figure><h3>→ Your Roadmap to Success</h3><ol><li>Define Your Ultimate Goal Start by writing down that big dream. This is your compass, your guiding star for the year ahead.</li><li>Break It Down Divide your goal into bite-sized pieces that are easier to digest:</li></ol><p>→ <strong>Yearly Goal:</strong> This is the big picture — a destination you’re aiming for by year’s end.</p><p>→ <strong>Monthly Milestones:</strong> Split your year into 12 parts. Each month, focus on one important milestone.</p><p>→ <strong>Weekly Tasks:</strong> Further break down your monthly milestone into 4 weekly tasks. This keeps your progress steady and doable.</p><ol><li>Reward Your Progress A little celebration goes a long way:</li></ol><p>→ <strong>Daily Wins:</strong> Even small tasks deserve recognition — whether it’s a quick coffee break or a short walk.</p><p>→ <strong>Weekly Treats:</strong> Mark the completion of each week with a reward that feels special.</p><p>→ <strong>Monthly Celebrations:</strong> Recognize your month-long progress with a reward that motivates you to keep pushing.</p><p>→ Keeping It Real Deadlines are your ally, but remember:</p><p>→ <strong>Flexibility is Key:</strong> Life happens. If things don’t go exactly as planned, adjust your timeline without losing sight of the end goal.</p><p>→ <strong>Learn and Adapt:</strong> Missed a deadline? Take a moment to understand what went wrong, adjust, and move forward with fresh focus.</p><p>→ <strong>It’s About Progress, Not Perfection:</strong> Every step, no matter how small, brings you closer to your vision. Embrace the journey with its ups and downs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJfvDbF-mSMGtvnPEYR2eg.png" /></figure><h3><strong>→ Final Thoughts</strong></h3><p>A goal without a deadline is just a daydream. By setting clear deadlines and breaking your journey into doable steps, you turn unclear ideas into real achievements. Each deadline is a marker on your roadmap to success — a reminder that every day is an opportunity to move forward.</p><p>Set that deadline today, break your big dream into digestible pieces, and watch your productivity soar — one arrow at a time.</p><p><strong>Now, take the leap: plan your path, set your deadlines, and let success follow!</strong></p><h4>Follow <a href="https://medium.com/@ibrahim313"><strong>me</strong></a> for more :)</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eefdf50605e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prepare to Win the MIT Competition with Free Resources by the MIT Informatics Tournament Club]]></title>
            <link>https://medium.com/@ibrahim313/prepare-to-win-the-mit-competition-with-free-resources-by-the-mit-informatics-tournament-club-887dd95226f9?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/887dd95226f9</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[mit]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 16:41:00 GMT</pubDate>
            <atom:updated>2025-01-08T16:41:00.344Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zgUy8b7W28ae2gS1m69j9Q.png" /></figure><p>Are you preparing for the prestigious <strong>MIT Competition</strong> or looking to improve your problem-solving and coding skills? Here’s some fantastic news for you!</p><p>The <strong>MIT Informatics Tournament Club</strong> has announced <strong>public access to all materials</strong> from their <strong>Class 6.S088</strong>. This includes <strong>lectures, recordings, slides, and daily problem sets</strong> — everything you need to excel in competitive programming.</p><p><strong>What’s Included in the MIT Class 6.S088 Resources?</strong></p><p>The course is running in person at MIT from <strong>January 6th to 17th, 2025</strong>, with daily lectures from <strong>4–5 PM (ET)</strong>. Even if you can’t attend in person, you can still benefit from the resources:</p><ul><li><strong>Lectures and Recordings:</strong> Learn directly from MIT experts.</li><li><strong>Slides and Notes:</strong> Access detailed presentations and study materials.</li><li><strong>Daily Problem Sets:</strong> Practice challenging problems to enhance your skills.</li></ul><p>To access all the slides and recorded lectures, visit the <a href="https://lnkd.in/d3BWiXD4"><strong>MIT Class Public Access Page</strong></a>.</p><p><strong>How to Practice with VJudge</strong></p><p>To further enhance your skills, you can practice problems hosted on <strong>VJudge</strong>, a popular platform for competitive programming. Here’s how to get started:</p><ol><li><strong>Create an Account on VJudge:</strong></li></ol><ul><li>Visit <a href="https://vjudge.net/"><strong>VJudge</strong></a> and sign up for a free account.</li></ul><ol><li><strong>Join the MIT 6.S088 Public Group:</strong></li></ol><ul><li>Use this link to join the group: <a href="https://lnkd.in/dWktuxNp"><strong>MIT 6.S088 Public Group</strong></a>.</li></ul><p>By joining the group, you’ll gain access to curated problem sets and compete with others preparing for the MIT Competition.</p><p><strong>Why This Opportunity is a Game-Changer</strong></p><ul><li><strong>Learn from the Best:</strong> MIT is a global leader in computer science and programming.</li><li><strong>Free Access:</strong> All resources are available at no cost.</li><li><strong>Flexible Learning:</strong> Access recordings and slides at your convenience.</li><li><strong>Community Support:</strong> Join a group of like-minded learners and competitors.</li></ul><p><strong>Ready to Get Started?</strong></p><ol><li><strong>Visit the MIT Class Public Access Page:</strong></li></ol><ul><li><a href="https://lnkd.in/d3BWiXD4"><strong>MIT Class 6.S088 Public Access</strong></a></li></ul><ol><li><strong>Join the VJudge Group:</strong></li></ol><ul><li><a href="https://lnkd.in/dWktuxNp"><strong>MIT 6.S088 Public Group on VJudge</strong></a></li></ul><ol><li><strong>Share with Friends:</strong></li></ol><ul><li>Spread the word and invite others to join this incredible learning opportunity.</li></ul><p><strong>Final Thoughts</strong></p><p>This is a <strong>golden opportunity</strong> for anyone passionate about competitive programming and problem-solving. Whether you’re preparing for the MIT Competition or simply looking to improve your skills, these free resources are invaluable.</p><p>Don’t miss out — start exploring the materials today and take your programming skills to the next level!</p><p><strong>If you didn’t register for the contest, here is a </strong><a href="https://opportunitymentor.com/index.php/2025/01/06/how-to-apply-for-mits-coding-competition-a-step-by-step-guide/"><strong>complete guide</strong></a><strong> you can follow.</strong><br> Additionally, here is another article explaining why <a href="https://opportunitymentor.com/index.php/2025/01/06/join-mit-informatics-tournament-2025/">you should join the MIT contest.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=887dd95226f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NLP | Where Machines Meet Meaning]]></title>
            <link>https://medium.com/@ibrahim313/nlp-where-machines-meet-meaning-1bc57b1d90d1?source=rss-5e9969986d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bc57b1d90d1</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Muhammad Ibrahim Qasmi]]></dc:creator>
            <pubDate>Tue, 22 Oct 2024 01:43:06 GMT</pubDate>
            <atom:updated>2024-10-22T01:43:06.619Z</atom:updated>
            <content:encoded><![CDATA[<p>The Heart of Human-AI Communication</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90Ktsa_9vqzadDvoO2CsAA.png" /></figure><p>Natural Language Processing (NLP) is a branch of artificial intelligence (AI) that enables computers to understand, interpret, and generate human language. NLP bridges the gap between human communication and machine understanding by analyzing text and speech in a way that allows machines to perform tasks like language translation, sentiment analysis, text summarization, and even conversational AI (chatbots).</p><p>Natural Language Processing (NLP) involves several key steps to transform and analyze human language in a way that machines can understand. Here’s an overview of the typical steps involved in NLP:</p><h3>1. Text Preprocessing</h3><ul><li><strong>Tokenization</strong>: Breaking down text into smaller units (words, sentences, or subwords).</li><li><strong>Lowercasing</strong>: Converting all text to lowercase to maintain uniformity.</li><li><strong>Removing Stop Words</strong>: Filtering out common words (e.g., “the”, “is”, “and”) that may not contribute to the overall meaning.</li><li><strong>Stemming and Lemmatization</strong>: Reducing words to their base or root form. Stemming cuts off word endings, while lemmatization uses dictionaries to map words to their base forms.</li><li><strong>Removing Punctuation</strong>: Removing any unnecessary symbols or punctuation from the text.</li><li><strong>Handling Special Characters</strong>: Removing or replacing numbers, special characters, and URLs if not needed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLCEHXp742N2z7GIQqmOXQ.png" /></figure><h3>2. Text Representation</h3><ul><li><strong>Bag of Words (BoW)</strong>: A simple way of representing text where each word is mapped to a frequency count.</li><li><strong>TF-IDF (Term Frequency-Inverse Document Frequency)</strong>: This reflects the importance of a word in a document, relative to its importance in a corpus.</li><li><strong>Word Embeddings</strong>: Converting text into vectors. Techniques include Word2Vec, GloVe, and FastText. More advanced models use contextual embeddings like BERT, GPT, or LLaMA.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AhCcZ_b1znsGIjMi8ijDeQ.png" /></figure><h3>3. Text Parsing</h3><ul><li><strong>Part-of-Speech (POS) Tagging</strong>: Assigning grammatical tags (nouns, verbs, adjectives, etc.) to each token.</li><li><strong>Dependency Parsing</strong>: Understanding the grammatical structure and relationships between words in a sentence.</li><li><strong>Named Entity Recognition (NER)</strong>: Identifying proper nouns (names, places, dates) and other important entities in text.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oehXQU9ekyz4ail95lEfXA.png" /></figure><h3>4. Feature Engineering</h3><ul><li><strong>N-grams</strong>: Capturing word sequences of size N (e.g., bi-grams, tri-grams) to capture context better.</li><li><strong>Syntactic and Semantic Features</strong>: Extracting features like sentiment, tone, or subjectivity from text.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yXQO-Damen57pSkT_akZyQ.png" /></figure><h3>5. Model Selection</h3><ul><li><strong>Traditional Machine Learning Models</strong>: Using models like Naive Bayes, Support Vector Machines (SVM), and Random Forests with hand-engineered features.</li><li><strong>Deep Learning Models</strong>: More advanced models like Recurrent Neural Networks (RNN), Long Short-Term Memory (LSTM), Transformers (BERT, GPT), that can handle sequential data more effectively.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IsDDdqeBY3pMf_KJDn9pJA.png" /></figure><h3>6. Training the Model</h3><ul><li><strong>Splitting Data</strong>: Dividing the dataset into training and testing sets.</li><li><strong>Optimization</strong>: Using techniques like gradient descent to train the model.</li><li><strong>Evaluation</strong>: Measuring the model’s performance using metrics like accuracy, F1-score, precision, recall, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pihMmSRSHGvxg5zqfnecog.png" /></figure><h3>7. Post-processing</h3><ul><li><strong>Text Generation or Completion</strong>: Using models like GPT or LLaMA to generate text based on the input sequence.</li><li><strong>Sentiment Analysis</strong>: Classifying the emotional tone of the text (positive, negative, neutral).</li><li><strong>Summarization</strong>: Condensing long documents into shorter, meaningful summaries.</li><li><strong>Translation</strong>: Converting text from one language to another.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQzGRh2NinTiGPrshlsDEA.png" /></figure><h3>8. Deployment</h3><ul><li>Integrating the trained NLP model into an application (e.g., chatbots, sentiment analysis tools, translation systems).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgB11B_Iy67w_bTwybUqsQ.png" /></figure><p>As NLP continues to evolve, it is revolutionizing the way we interact with technology, transforming raw language data into actionable insights. Whether it’s a smart assistant understanding your queries or an AI system translating languages seamlessly, NLP is opening new doors in human-computer interaction. With ongoing advancements, the possibilities for future innovations in communication are boundless, making NLP a pivotal force in the future of AI.</p><p>Subscribe and Follow For more Data Science Stuff.</p><p><strong>Connect with me On </strong><a href="https://www.linkedin.com/in/muhammad-ibrahim-qasmi-9876a1297/"><strong>Linkedin</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bc57b1d90d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>