<?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 Hussnain Bashir on Medium]]></title>
        <description><![CDATA[Stories by Hussnain Bashir on Medium]]></description>
        <link>https://medium.com/@hussnain-bashir?source=rss-4e4184171b07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*INfOGEAXwIQ42b4fhi9uSw.png</url>
            <title>Stories by Hussnain Bashir on Medium</title>
            <link>https://medium.com/@hussnain-bashir?source=rss-4e4184171b07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:12:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hussnain-bashir/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[Automata Theory Finally Make Sense]]></title>
            <link>https://medium.com/@hussnain-bashir/automata-theory-finally-make-sense-0d6c27dc8042?source=rss-4e4184171b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d6c27dc8042</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[theory-of-computation]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Hussnain Bashir]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 11:25:28 GMT</pubDate>
            <atom:updated>2026-09-16T11:25:28.485Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Built a Free Tool That Makes Automata Theory Finally Make Sense</h3><p><strong>And I am asking you to help make it better.</strong></p><p>— -</p><h3>I Built a Free Tool That Makes Automata Theory Finally Make Sense</h3><p><strong>And I am asking you to help make it better.<br></strong>There is a specific kind of frustration that every computer science student knows. You are sitting in a Theory of Computation lecture. The professor is drawing a state diagram on the board, nodes and arrows and labels sprawling across the whiteboard in chalk. You follow along for the first few steps, but by the time the board fills up and they start talking about epsilon closures and trap states and powerset construction, something breaks. The diagram has twenty nodes. Some arrows are labeled with multiple symbols. The erased parts are still visible underneath the new ones. You start copying it into your notebook, but you are not sure you are getting it right. And the professor has already moved on.</p><p>This moment is not rare. It happens in classrooms all over the world. Automata theory is one of the most mathematically precise subjects in computer science, and also one of the hardest to teach visually, because the diagrams live inside the professor’s head, static and transient on a blackboard, and gone as soon as class ends.</p><p>I built something to fix that.</p><p>— -</p><p><strong>What is Automata Visualizer Pro</strong></p><p><strong>Automata Visualizer Pro</strong> is a free, open-source web application that lets you build automata interactively and watch conversion algorithms run step by step, with full mathematical transparency, right inside your browser.</p><p>You can find the live version here: <a href="https://husrocks.github.io/Automata-Converter/">https://husrocks.github.io/Automata-Converter/</a></p><p>The source code is fully open on GitHub: <a href="https://github.com/Husrocks/Automata-Converter">https://github.com/Husrocks/Automata-Converter</a></p><p>The tool covers nine core conversion algorithms that span the standard undergraduate Theory of Computation curriculum. You do not install anything. You do not create an account. You open it in a browser and start building state machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3gx6OLz2wLlFUdpRlW6zg.png" /></figure><p>— -</p><p><strong>Why I Built It This Way</strong></p><p>The first thing you will notice about the project is that it uses no frontend framework. No React. No Vue. No build step. Just HTML, CSS, and vanilla JavaScript, with one visualization library called Vis.js for the interactive graph canvas.</p><p>This was a deliberate choice, and it matters for a few reasons.</p><p>First, classroom hardware is often old. Universities in many parts of the world run lab computers that struggle with modern JavaScript bundle sizes. A tool that opens instantly on a ten-year-old laptop serves students better than one that requires Node, a package manager, and two minutes to compile.</p><p>Second, archival stability. Frameworks deprecate. Build chains rot. A project built with nothing but web standards and a well-maintained visualization library will still work in fifteen years without anyone touching it. Educational tools should outlive the trends of the year they were created.</p><p>Third, I wanted any computer science student who understands basic web development to be able to read and understand the source code. No complicated abstractions. No boilerplate. Just the algorithms and the interface.</p><p>— -</p><p><strong>What It Actually Does</strong></p><p>Let me walk you through the converters the project currently ships.</p><p><strong>NFA to DFA.</strong> This is the powerset subset construction algorithm. You draw a non-deterministic finite automaton, one where a single state can have multiple transitions on the same input symbol, and the tool converts it to a deterministic finite automaton by computing all possible subsets of states. The output panel shows you the full transition table with every subset labeled, so you can see exactly where each new DFA state comes from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhqWqnqA49FleXDFRmz_bw.png" /></figure><p><strong>Epsilon-NFA to DFA. </strong>This is the trickier version of the above. Epsilon transitions let a machine move between states without consuming any input symbol. Before the powerset construction can run, every epsilon closure must be computed. The tool shows you those closures explicitly, state by state, before showing you the final DFA.</p><p><strong>NFA to Regular Expression. </strong>This uses the state elimination method and Arden’s Theorem to derive a closed-form regular expression from a transition graph. This direction of conversion is something students rarely get to see step by step, because doing it by hand on paper is tedious and error-prone. Here you can watch each state get eliminated and the expressions grow.</p><p><strong>Regular Expression to NFA.</strong> The reverse direction, using Thompson’s Construction. You type in a regular expression and the tool builds the corresponding NFA inductively, showing how each subexpression compiles into a sub-graph connected by epsilon transitions.</p><p><strong>DFA Minimizer.</strong> Given a deterministic finite automaton, the minimizer finds all pairs of indistinguishable states using a table-filling equivalence algorithm and merges them into a single minimal machine. The resulting DFA accepts exactly the same language with the smallest possible number of states.</p><p><strong>PDA to CFG.</strong> This is where we go up the Chomsky hierarchy. A pushdown automaton uses a stack to handle context-free languages, and this converter derives equivalent context-free grammar production rules using the tri-variable derivation method. You specify your stack transitions and the tool generates the grammar.</p><p><strong>CFL to CFG.</strong> This lets you inspect and simplify context-free grammar productions directly, examining terminals, non-terminals, and the production rules that govern them.</p><p><strong>Turing Machine to FA.</strong> This is the experimental one. Turing machines are more powerful than finite automata in general, but by imposing a finite tape limit you can approximate them as linear bounded automata and study their state structure. This module is still growing, but it opens interesting conversations about the relationship between computational models.</p><p>— -</p><p><strong>The Part I Am Most Proud Of</strong></p><p>Every converter shows its work.</p><p>This sounds simple, but it is the thing that separates a useful educational tool from one that just gives you an answer. When a student asks how subset construction works, the answer is not another NFA and DFA sitting next to each other. The answer is the process. The epsilon closures computed at each step. The transition matrix being built row by row. The states being named and cross-referenced.</p><p>Every conversion in the tool shows intermediate steps. The epsilon closure computations. The subset tables. The algebraic expressions being built during state elimination. You can follow along at your own pace, go back, and run it again with a different input.</p><p>There are no black boxes here.</p><p>— -</p><p><strong>Who This Is For</strong></p><p>I designed this tool with three audiences in mind.</p><p><strong>Students </strong>who are working through homework and need to verify their understanding. You can build the NFA from your problem set, run the conversion, and then check your work step by step against what the tool shows. It tells you where the trap states come from. It shows you which subsets map to which DFA states. It gives you something concrete to reason against instead of just hoping your hand-drawn diagram was correct.</p><p><strong>Educators</strong> who want to demonstrate algorithms in lecture without spending twenty minutes drawing on a blackboard. You can project the tool, build the example live with the students watching, and then run the conversion. You can pause at any intermediate step and discuss what is happening. The whole thing is interactive, so if a student asks “what happens if we change this transition,” you can change it right there and show them.</p><p><strong>CS Researchers and enthusiasts</strong> who want a sandbox for testing edge cases in formal language theory. The tool is open-source and the algorithms are written to be readable, so if you find a case where the output looks wrong, you can inspect exactly what the code is doing and submit a fix.</p><p>— -</p><p><strong>The Technical Stack</strong></p><p>For anyone interested in the implementation details:</p><p>The visualization layer uses Vis.js, a physics-stabilized network graph library that lets users drag nodes, adjust layouts, and build graphs interactively. This was chosen over alternatives like D3 or Cytoscape because of its excellent out-of-the-box usability for beginners and its reasonable bundle size.</p><p>The design system uses a glassmorphism aesthetic with a light and dark mode toggle. The toggle persists your preference to localStorage so it remembers your choice across sessions. The navbar and footer are injected dynamically from a single centralized components file, so every page in the app stays consistent without duplicating HTML across fourteen separate files.</p><p>The algorithms themselves are implemented in plain JavaScript, written to reflect the mathematical definitions from standard textbooks as closely as possible. Michael Sipser’s “Introduction to the Theory of Computation” and Jeffrey Ullman’s work on formal languages and automata were the primary references during implementation.</p><p>— -</p><p><strong>How to Run It Locally</strong></p><p>If you want to work with the source code:</p><p>```bash<br>git clone <a href="https://github.com/Husrocks/Automata-Converter.git">https://github.com/Husrocks/Automata-Converter.git</a><br>cd Automata-Converter<br>```</p><p>Then open `index.html` in your browser. No npm install. No build command. No server required.</p><p>If you want a local server to avoid browser CORS restrictions on some SVG assets, you can use VSCode’s Live Server extension or run `npx serve` in the project directory.</p><p>— -</p><p><strong>I Want Your Help</strong></p><p>Here is the honest part of this post.</p><p>This project was built by one person, and it is still growing. There are algorithms I want to add. There are edge cases in the existing converters that need to be handled more gracefully. There are accessibility improvements to make. There are mobile layouts to polish. One person can only do so much.</p><p>If any of this sounds interesting to you, I would genuinely love for you to contribute.</p><p><strong>You do not need to be an expert.</strong> The codebase is intentionally simple. If you understand HTML, CSS, and basic JavaScript, you can contribute to the UI and the design system. If you know formal language theory and can implement algorithms cleanly, there are several converters that could use more rigorous implementations. If you are a student who found a bug while doing your homework, please report it. That is valuable too.</p><p>Here is how to get started:</p><p>1. Fork the repository on GitHub<br>2. Create a feature branch: `git checkout -b feature/your-improvement`<br>3. Make your changes and commit them with a clear message<br>4. Push your branch and open a pull request</p><p>If you are working on a UI change, please use the existing glassmorphism CSS classes in the stylesheet. If you are implementing an algorithm, please keep it readable and comment the steps so other students can learn from the code itself, not just run it.</p><p>The GitHub repository is here: <a href="https://github.com/Husrocks/Automata-Converter">https://github.com/Husrocks/Automata-Converter</a></p><p>You can also reach me on Instagram at <a href="http://twitter.com/imhussnain_">@imhussnain_</a> if you want to discuss ideas or ask questions before opening an issue.</p><p>— -</p><p><strong>Why Open Source Education Tools Matter</strong></p><p>There is a lot of educational software that sits behind paywalls or requires institutional licenses. Students at well-funded universities get access to commercial tools. Students everywhere else make do with static PDFs and hope their professor draws clear diagrams.</p><p>I think that is worth pushing back on, even in small ways.</p><p>Automata theory is not an obscure niche topic. It is foundational. The concepts of finite automata, regular expressions, context-free grammars, and Turing machines show up in compilers, network protocol design, bioinformatics, and artificial intelligence. Understanding them well, not just passing an exam on them but actually understanding what is happening at each step, makes you a better computer scientist.</p><p>If this tool helps even a few hundred students understand subset construction more clearly than they would have from a static blackboard diagram, it is worth maintaining and growing. And with more contributors helping shape it, it can reach a lot more people.</p><p>— -</p><p><strong>Try It Today</strong></p><p>The live version is at: <a href="https://husrocks.github.io/Automata-Converter/">https://husrocks.github.io/Automata-Converter/</a></p><p>Open the NFA to DFA converter. Draw a simple three-state NFA with some non-deterministic transitions. Hit convert. Watch the powerset construction run. Read the intermediate table it generates. Then try adding an epsilon transition and see how the epsilon closure computation changes the entire result.</p><p>If you have been confused about automata theory for a while, something might click.</p><p>And if you want to help make the tool better, the door is open and the welcome is genuine.</p><p><strong>Developed by Hussnain Bashir. Built on classical algorithms from Sipser and Ullman. Visualization powered by Vis.js. Licensed under MIT.</strong></p><p><strong>GitHub: </strong><a href="https://github.com/Husrocks/Automata-Converter*"><strong>https://github.com/Husrocks/Automata-Converter</strong></a><strong><br>Instagram: </strong><a href="https://www.instagram.com/imhussnain_/*"><strong>https://www.instagram.com/imhussnain_/</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d6c27dc8042" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oxygen Gym]]></title>
            <link>https://medium.com/@hussnain-bashir/oxygen-gym-fbd986de78a0?source=rss-4e4184171b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbd986de78a0</guid>
            <category><![CDATA[gym]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[gym-web]]></category>
            <category><![CDATA[oxygen]]></category>
            <category><![CDATA[hussnain-bashir]]></category>
            <dc:creator><![CDATA[Hussnain Bashir]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 10:31:20 GMT</pubDate>
            <atom:updated>2026-09-16T10:31:20.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>Re‑imagining the Oxygen Gym Landing Page: A Modern Web‑Tech Journey</h3><p><em>By Hussnain Bashir— Medium Tech &amp; Design</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ttaicsjPqyNj6Ekutfmbw.png" /></figure><h3>Introduction — From a Bare‑Bones Gym Site to a High‑Performance Digital Gymnasium</h3><p>When I first stumbled upon the original <strong>Oxygen Gym</strong> website, it felt like walking into an old gym that still had its original iron plates in the corner. The layout was functional, the colors were bright, and the code was pure HTML, CSS, and a sprinkle of vanilla JavaScript. It served its purpose, but it also reminded me of a workout routine that never evolves.</p><p>Just as the human body needs progressive overload to grow, a web presence needs progressive <strong>technical overload</strong> — the deliberate addition of modern tools that push performance, accessibility, and developer experience to the next level. In this article I’ll walk you through the <strong>why</strong> and <strong>how</strong> we rebuilt Oxygen Gym using a stack that feels as purposeful and efficient as a well‑designed strength‑training program.</p><h3>The “Why” — Defining the Problem Space</h3><p>Pain PointConsequenceDesired Outcome<strong>Static HTML‑only build</strong>No server‑side rendering → poor SEO, slower first paintRender on the server for instant content delivery<strong>No CSS framework</strong>Custom CSS grew chaotic → maintenance nightmareConsistent, scalable design system<strong>No typed language</strong>JavaScript bugs hidden until runtime → fragile codebaseCompile‑time safety, better tooling<strong>No animation library</strong>UI felt static → missed opportunity for engagementSmooth, physics‑based micro‑interactions<strong>Single‑page, monolithic</strong>Hard to add new sections without breaking othersModular component architecture</p><p>These shortcomings echo the classic “plateau” in strength training: progress stalls because the stimulus isn’t varied enough. The solution was to <strong>upgrade the training variables</strong> — the programming language, the framework, and the design system.</p><h3>Choosing the Stack — The “Progressive Overload” of Web Development</h3><h3>1. Next.js 14 (React‑based App Router)</h3><p><em>Why</em>: Next.js gives us <strong>hybrid rendering</strong> — static generation where possible, server‑side rendering for dynamic routes. This yields lightning‑fast LCP (Largest Contentful Paint) scores that Google loves, while still keeping the developer experience familiar. Its built‑in Image component automatically optimizes assets, and the file‑system routing mirrors the way we think about building a gym: each zone (home, classes, membership) lives in its own folder.</p><p><em>Analogy</em>: Think of Next.js as the <strong>periodized training program</strong> — it knows when to deliver a heavy‑load (SSR) versus a lighter, maintenance‑load (SSG).</p><h3>2. Tailwind CSS 3.3</h3><p><em>Why</em>: Tailwind is a <strong>utility‑first CSS framework</strong> that lets us craft a design system directly in markup. No more hunting through sprawling stylesheet files; every spacing, color, and typography token is defined in the tailwind.config.js. This translates to a <strong>consistent visual language</strong> across the site and near‑zero CSS bloat (unused utilities are purged at build time).</p><p><em>Analogy</em>: Tailwind is like a <strong>well‑organized weight rack</strong> — each weight (utility) is clearly labeled, always in the right place, and you can grab exactly what you need without rummaging.</p><h3>3. Framer Motion (10.x)</h3><p><em>Why</em>: Motion is a proven driver of <strong>perceived performance</strong> and user delight. Framer Motion gives us physics‑based animations with a declarative API that integrates beautifully with React’s lifecycle. From a gentle fade‑in on hero sections to subtle hover lifts on CTA buttons, the site now feels alive — mirroring the kinetic energy of a real gym.</p><p><em>Analogy</em>: Motion is the <strong>tempo of a workout</strong> — the rhythm that keeps the body engaged and the mind focused.</p><h3>4. TypeScript 5</h3><p><em>Why</em>: TypeScript adds <strong>static typing</strong> to JavaScript, catching mismatched props, mis‑named variables, and API contract violations <em>before</em> the code ever runs in a browser. This dramatically reduces runtime bugs and improves IDE autocomplete, making teamwork smoother.</p><p><em>Analogy</em>: TypeScript is like a <strong>certified trainer</strong> — it checks your form, warns you of potential injuries, and ensures you’re lifting safely.</p><h3>5. React 18 &amp; Server Components</h3><p><em>Why</em>: React 18’s concurrent rendering gives us smoother UI updates, while Server Components let us keep heavy data‑fetching logic off the client bundle. The result: a <strong>lighter JavaScript payload</strong> and snappier interactions on low‑end devices.</p><p><em>Analogy</em>: Server Components are comparable to <strong>deload weeks</strong> — they strip down the weight (bundle size) when the body (browser) needs recovery.</p><h3>6. ESLint + Prettier + Husky</h3><p><em>Why</em>: Code quality is non‑negotiable. ESLint enforces best practices, Prettier guarantees formatting consistency, and Husky runs linting hooks before every commit, preventing technical debt from accumulating.</p><p><em>Analogy</em>: This trio is the <strong>gym’s safety protocol</strong> — spotters, proper equipment checks, and a clean environment.</p><ul><li><strong>App Router</strong> (app/ directory) isolates each page as a <strong>React Server Component</strong>, enabling progressive rendering.</li><li><strong>Component Library</strong> lives under /components/, reusable across pages (just as a gym might reuse the same dumbbell set for multiple exercises).</li><li><strong>Tailwind</strong> values are centralized, ensuring brand consistency — think of a <em>color palette</em> akin to a gym’s branding colors on signage and equipment.</li></ul><h3>Performance &amp; SEO — The Measurable Gains</h3><p>MetricBefore (Static)After (Next.js + Tailwind)<strong>LCP</strong>~4.2 s<strong>1.1 sFirst Contentful Paint</strong>~3.7 s<strong>0.9 sTotal Blocking Time</strong>320 ms<strong>45 msCore Web Vitals (CLS)</strong>0.14<strong>0.04Google PageSpeed</strong>63/100<strong>96/100</strong></p><p>The improvements are comparable to moving from a <strong>baseline training program</strong> to a <strong>high‑intensity interval regimen</strong> — the same effort yields dramatically better results.</p><h3>The Development Process — A “Scientific” Workflow</h3><ol><li><strong>Hypothesis</strong>: <em>A modern React/Next stack will improve LCP by &gt;50% while keeping bundle size &lt;150 KB.</em></li><li><strong>Experiment</strong>: Scaffold with npx create-next-app@latest --ts, integrate Tailwind, add Framer Motion.</li><li><strong>Measurement</strong>: Run Lighthouse CI after each feature addition, track metrics in a markdown table.</li><li><strong>Iteration</strong>: Refactor heavy components into Server Components, purge unused Tailwind utilities, enable next/image optimization.</li><li><strong>Conclusion</strong>: The hypothesis held — performance jumped, and the UI gained a subtle, engaging polish.</li></ol><p>This method mirrors Andrew Huberman’s own <strong>science‑first mindset</strong>: start with a clear question, design an experiment, collect data, and iterate.</p><h3>Design Philosophy — The “Gym Aesthetic”</h3><ul><li><strong>Dark‑Mode Ready</strong>: A deep navy background (#0f172a) paired with a vibrant accent (#38bdf8) offers high contrast, reducing eye strain—a nod to <em>visual ergonomics</em>.</li><li><strong>Glassmorphism</strong>: Semi‑transparent cards with subtle backdrop filters emulate the <strong>modern, sleek look</strong> of high‑end equipment.</li><li><strong>Micro‑Animations</strong>: Button lifts, hero fade‑ins, and scroll‑triggered reveals keep users <em>physically engaged</em> — similar to how a trainer cues movement.</li><li><strong>Responsive Grid</strong>: Tailwind’s grid utilities guarantee a <strong>fluid layout</strong> from mobile to 4K monitors, ensuring accessibility for every user.</li></ul><h3>Deploy &amp; Host — Delivering the Final Product</h3><ul><li><strong>Vercel</strong>: One‑click deployment integrates directly with the GitHub repository, automatically builds the Next.js app, and provides global CDN caching.</li><li><strong>Edge Functions</strong>: Used for SEO‑critical meta generation, ensuring crawlers receive the correct Open Graph tags without additional latency.</li><li><strong>Environment Variables</strong>: Kept in Vercel’s dashboard for any future API integrations (e.g., membership sign‑up forms).</li></ul><p>Deploying is as simple as pushing to main, mirroring how a well‑programmed periodized routine just needs a <strong>weekly load increase</strong> to continue progressing.</p><h3>Lessons Learned — Takeaways for Future Projects</h3><ol><li><strong>Start with the End in Mind</strong> — Define performance and SEO goals before selecting a framework.</li><li><strong>Don’t Over‑Engineer</strong> — Tailwind’s utility‑first approach eliminated the need for a large CSS pre‑processor.</li><li><strong>Leverage Server‑Side Rendering Early</strong> — SSR solved the “blank screen” issue often seen with pure static sites.</li><li><strong>Micro‑Motion Matters</strong> — Subtle motion improves perceived speed more than raw milliseconds.</li><li><strong>Automation is Your Spotter</strong> — ESLint, Prettier, and CI pipelines catch mistakes before they become “injuries.”</li></ol><h3>Conclusion — A New Benchmark for Gym Websites</h3><p>The transformation from a <strong>bare‑bones static page</strong> to a <strong>Next.js‑powered, Tailwind‑styled, motion‑rich digital gym</strong> illustrates how deliberate technical choices — grounded in performance data and user psychology — can elevate a brand’s online presence dramatically.</p><p>Just as a well‑planned training program produces measurable strength gains, a thoughtfully engineered web stack yields tangible improvements in load times, SEO rankings, and user engagement.</p><p>If you’re ready to take your own web project from “entry‑level” to “elite,” consider the same progressive overload principles we applied here: upgrade the framework, systematize the design language, and inject purposeful motion. Your users — and your analytics dashboard — will thank you.</p><p><em>Happy coding, and may your next launch feel as satisfying as a perfect PR lift.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbd986de78a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Watched 10 Sales Agents Waste 8 Hours a Day on Voicemails — So I Built an AI That Fixed It]]></title>
            <link>https://medium.com/@hussnain-bashir/i-watched-10-sales-agents-waste-8-hours-a-day-on-voicemails-so-i-built-an-ai-that-fixed-it-51923008177b?source=rss-4e4184171b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/51923008177b</guid>
            <category><![CDATA[pakistani-tech-innovation]]></category>
            <category><![CDATA[call-center-ai]]></category>
            <category><![CDATA[ai-voice-sales-agent]]></category>
            <category><![CDATA[hussnain-bashir]]></category>
            <category><![CDATA[ai-integration]]></category>
            <dc:creator><![CDATA[Hussnain Bashir]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 11:19:25 GMT</pubDate>
            <atom:updated>2026-09-07T11:26:07.385Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Hussnain Bashir</strong> | AI Engineer &amp; Full-Stack Developer | Published 2026</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYe9-IqhOMTyPD9ivhQh9g.png" /></figure><p><em>Tags: Hussnain Bashir, Pakistani Tech Innovation, RingCentral AI Integration,AI Call Center Automation, Call Center AI Software, AI Call Screener, BPO Automation Pakistan, AI Voice Sales Agent, Outbound Dialer AI, Call Center Productivity.</em></p><p>It was 11:47 PM on a Tuesday.</p><p>I was sitting at my desk in a BPO call center in Pakistan, watching Umer one of the best sales agents on the floor slump back in his chair, headphones dangling around his neck, staring at the ceiling like he had just lost a war.</p><p>He hadn’t lost a sale. He hadn’t received bad news. He had just listened to his forty-third voicemail of the morning.</p><p>Forty-three. Before noon.</p><p>I walked over and asked him how he was doing. He looked at me with the kind of tired that sleep doesn’t fix and said something I haven’t been able to forget since:</p><p><strong>“Bhai, I didn’t come here to talk to answering machines. I came here to sell.”</strong></p><p>That sentence changed everything for me.</p><h3>The Problem Nobody Was Talking About</h3><p>I had joined this BPO company to learn the industry from the inside. As someone who studied computer science and had always been drawn to solving real-world problems with technology, I wanted to understand what the actual pain points were not from a textbook, not from a YouTube video, but from sitting on the floor, watching it happen in real time.</p><p>What I saw shocked me.</p><p>Every single agent on that floor was following the same painful loop, hundreds of times a day:</p><ol><li>Copy a phone number from an Excel spreadsheet</li><li>Paste it into RingCentral</li><li>Select the outgoing number every single time</li><li>Wait 20 seconds for the call to connect</li><li>Hear a voicemail, a busy tone, or a disconnected number</li><li>Hang up manually</li><li>Update the status manually in the spreadsheet</li><li>Repeat</li></ol><p>Out of every 10 calls an agent made, seven to eight were either voicemails, busy signals, wrong numbers, or dead lines.</p><p><strong>Seven out of ten calls were completely wasted.</strong></p><p>But wasted time was only half the problem. The other half was something harder to measure but far more damaging: <strong>energy.</strong></p><p>A sales agent’s most valuable asset is not their script. It is not their product knowledge. It is their energy that electric, optimistic charge they carry into every conversation that makes a stranger on the other end of the line feel like they are talking to someone worth listening to.</p><p>When you hear forty-three voicemails before lunch, that energy is gone.</p><p>And when the energy is gone, the conversion rate collapses. Agents who started the day closing sales at 15% were ending the day closing at 4% not because the leads got worse, but because the humans making the calls had been systematically drained by a broken workflow that technology could fix.</p><p>I started doing the math.</p><h3>The Numbers That Forced Me to Act</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kdCcb_-bVnET3CysNnKpQ.png" /></figure><p>I spent a week quietly tracking what I observed on the floor. Here is what I found:</p><p>Metric Reality Average calls per agent per day 150 Calls that were voicemails or junk 105 (70%) Time wasted per junk call ~55 seconds Total time wasted per agent daily ~96 minutes Agents on the floor 10 Total productivity lost daily ~16 hours Manual status update time per call ~15 seconds Time lost to status updates alone ~37 minutes per agent daily</p><p>Sixteen hours. Every single day. Across a team of ten people.</p><p>That is two full-time employees doing nothing not selling, not building relationships, not generating revenue just listening to voicemails and copy-pasting phone numbers.</p><p>In a month? Over 330 hours of pure waste.</p><p>At an average agent salary, that translated to PKR 400,000 to 500,000 per month being paid for work that an automated system could eliminate entirely.</p><p>I went home that night and opened my laptop.</p><h3>The Idea: What If the Agent Never Had to Wait Again?</h3><p>The core insight that drove everything I built next came from one simple question:</p><p><strong>What if the agent only ever spoke to real humans?</strong></p><p>Not “what if we could make them more efficient” or “what if we could give them better scripts.” What if we completely eliminated the dead time? What if, from the moment an agent put on their headphones in the morning to the moment they took them off in the evening, every call they answered had a real human being on the other end?</p><p>That would change everything.</p><p>An agent handling 30 human conversations out of 30 attempts is fundamentally different from an agent handling 30 human conversations out of 150 attempts. Same output. Completely different experience. Completely different energy. Completely different conversion rate.</p><p>This is the insight that became the foundation of what I now call <strong>OLO an AI-Powered Call Center Automation Platform.</strong></p><h3>What I Built: Three AI Engines in One Platform</h3><p>I am Hussnain Bashir, a computer science student in my final years of my BSCS degree, working at the intersection of machine learning, full-stack development, and applied AI systems. I built OLO as an independent product not a company project, not a university assignment because I saw a gap in the market and I had the technical skills to fill it.</p><p>Here is what OLO does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZPvkGRCRXXtGh5wdxyrDQ.png" /></figure><h3>Engine 1 — AI Call Screener: The Human Detector</h3><p>The first problem was simple but expensive: agents were spending the majority of their time on calls that had no human on the other end.</p><p>The solution I built works like this:</p><p>The system connects to RingCentral the telephony platform most Pakistani call centers already use via its developer API. Instead of an agent dialing each number manually, the system pulls numbers directly from an uploaded Excel file, loads them into an automated queue, and dials them automatically using RingCentral’s RingOut API.</p><p>The moment a call connects, RingCentral’s built-in AMD (Answering Machine Detection) system listens to the first two to three seconds of audio and classifies what it hears. If it detects a voicemail greeting, a busy signal, a disconnected tone, or silence the system immediately hangs up via API and automatically dials the next number in the queue. The agent sees nothing. Hears nothing. Their screen stays quiet.</p><p>Then the moment a real human voice is detected the agent’s screen fires a full alert:</p><pre>🔴 LIVE HUMAN — PICK UP NOW</pre><pre>Name:    Muhammad Bilal<br>Number:  +92 321 XXX XXXX<br>Company: ABC Traders Lahore<br>Notes:   Interested in premium plan last month</pre><pre>⏱ Waiting: 00:02</pre><figure><img alt="LIVE-HUMAN" src="https://cdn-images-1.medium.com/max/1024/1*L48qXo_yAg7gr-DEYXDzWg.png" /></figure><p>An alert sound plays. The call bridges to the agent’s handset. The agent picks up fresh, focused, and energized and begins their pitch.</p><p>Every single call the agent takes is a real human. Every single time.</p><p><strong>The result: agents went from 30 real conversations per 150 calls to 30 real conversations per 30 attempts they were aware of.</strong> The system handled the other 120 in the background, silently, instantly, without a single second of agent attention.</p><h3>Engine 2 — Full AI Voice Sales Agent: The Agent That Never Gets Tired</h3><p>The second engine is where things get genuinely transformative.</p><p>After building the screener, I kept asking myself a harder question: what if even the human-detected calls didn’t need a human agent at all at least not for the initial pitch?</p><p>The pitch itself is largely scripted. The objections are predictable. The pricing questions have fixed answers. The company information never changes. So why was a human being paid to repeat the same information two hundred times a day when an AI could do it with perfect consistency, zero fatigue, and instant product knowledge recall?</p><p>Engine 2 is a full AI voice sales agent built on top of Retell AI, connected to RingCentral’s telephony via SIP trunking. When the manager switches the platform to AI Agent Mode, the system no longer alerts a human when a real person answers. Instead, an AI voice trained on the company’s specific pricing, scripts, objection handlers, and product knowledge takes the call entirely on its own.</p><p>It speaks. It listens. It responds. It handles objections. It quotes prices. It tells stories about the product. And when a customer says the words that indicate genuine purchase intent when they ask about payment, when they say “okay I’m interested,” when they ask how to sign up the AI immediately transfers the call to a human closer who simply completes the transaction.</p><p>The human agent becomes a closer, not a pitcher. They receive only the warmest leads people who have already been engaged, already been pitched, and are already leaning toward yes.</p><p>This is not science fiction. This is running on RingCentral SIP trunking with Retell AI’s voice infrastructure and a knowledge base I built directly from the call center’s own product documentation, pricing sheets, and sales scripts.</p><h3>Engine 3 — AI Auto Status Updater: The One Nobody Talks About</h3><p>The third engine is the quietest one, but I would argue it is the most impactful on a day-to-day operational level.</p><p>Every call that ends in both modes generates a transcript via Retell AI’s webhook system. The moment a call ends, Retell fires a webhook to my backend containing the complete conversation in text form. My system then sends that transcript to Groq’s Llama 3.3 70B model one of the most capable open-source language models available, running on Groq’s inference infrastructure at near-zero cost with a carefully engineered prompt that asks it to classify the call outcome.</p><p>The AI reads the full conversation and returns a structured classification:</p><ul><li>Was this a voicemail?</li><li>Did the customer express interest?</li><li>Did they ask to be called back — and if so, when?</li><li>Did they say do not call again?</li><li>Was this a wrong number or junk?</li></ul><p>Based on that classification, the system automatically:</p><ol><li>Updates the contact status in the OLO database</li><li>Syncs the status update to the client’s RingCentral contact record via the RC API</li><li>If a callback was requested and a time was mentioned, schedules it automatically in the callback queue with an alert that fires five minutes before the scheduled time</li></ol><p>Zero agent input. Zero manual status updates. Zero missed callbacks.</p><p>The accuracy rate in testing has been above 95% — significantly higher than the manual disposition logging agents were doing before, where fatigue and time pressure regularly caused errors and omissions.</p><h3>The XYZ Impact: Real Numbers, Real Change</h3><p>Using the XYZ framework that defines great product impact — <strong>X happened, by doing Y, which resulted in Z</strong> — here is what OLO delivers:</p><blockquote><strong><em>By automating the outbound call screening and status update process using AI, call center agents went from spending 96 minutes per day on voicemails and junk calls to spending zero minutes on them — recovering 16 hours of lost team productivity every single day and increasing agent conversion rates by an estimated 40–60% due to sustained energy and focus.</em></strong></blockquote><p>Let me break that down into specific, measurable impacts:</p><p>Metric Before OLO After OLO Change Real human conversations per agent per day 30 30 Same output Calls an agent had to personally handle to get 30 humans 150 30 5x efficiency Time wasted on junk calls per agent daily 96 min 0 min 96 min recovered Time wasted on manual status updates daily 37 min 0 min 37 min recovered Total agent time recovered per day (10 agents) — ~22 hours Pure productivity gain Status update accuracy ~78% (human error) 95%+ (AI) 17% improvement Callbacks missed due to poor tracking ~40% Under 4% 90% reduction Agent energy and morale Declining by noon Sustained all day Qualitative</p><p>The monthly cost of wasted productivity at this call center — based on agent salaries and hours lost — was approximately PKR 450,000 to 500,000 per month<strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EM4bLZ87XsXBdKns_1jeKQ.jpeg" /></figure><h3>Why This Problem Was Invisible for So Long</h3><p>One of the most interesting things I discovered while building OLO was why this problem had gone unsolved for so long in the Pakistani call center market.</p><p>The answer, I believe, is that the waste had been normalized.</p><p>Everyone on the floor knew that most calls were voicemails. Everyone knew agents were tired by noon. Everyone knew manual status updates were riddled with errors. But these were not seen as technology problems — they were seen as just the way the job worked.</p><p>Nobody was asking “what if we automated the screening?” because nobody believed the technology was accessible enough, affordable enough, or practical enough for a Pakistani BPO operation. The US-based solutions that address this — platforms like Bland AI, Vapi, and Air AI — charge between $0.09 and $0.15 per minute and require USD subscriptions through American payment infrastructure. For a Pakistani call center making PKR-denominated revenue, these tools are practically inaccessible.</p><p>OLO is built for this market specifically. It runs on-premises — on a local PC or office server inside the call center, with no cloud hosting costs and no foreign subscription fees. It connects to the RingCentral infrastructure the call centers already pay for. And it is supported in Urdu by someone who can walk into the office and sit on the floor.</p><p>That local advantage is real, and it is durable.</p><h3>The Technical Architecture (For the Engineers in the Room)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3azRq1wGCJkdhqfIl8sH-Q.jpeg" /></figure><p>For readers with a technical background, here is how the platform is built:</p><p><strong>Backend:</strong> Node.js with Fastify, TypeScript in strict mode, BullMQ for the rate-limited dialer queue (Redis-backed), Prisma ORM with PostgreSQL.</p><p><strong>Frontend:</strong> React with Vite, TypeScript, Tailwind CSS, Zustand for state management, Socket.io for real-time agent alerts.</p><p><strong>Telephony:</strong> RingCentral API via JWT authentication, Long Polling for AMD event subscription (no public webhook URL required — runs entirely on local network).</p><p><strong>AI Layer:</strong> Retell AI for outbound call management and AI voice agent in Engine 2. Groq’s Llama 3.3 70B via free-tier API for transcript classification in Engine 3.</p><p><strong>Deployment:</strong> Fully on-premises. The backend runs on any Windows 10/11 or Ubuntu machine inside the office. All agents connect via local network IP. No external hosting required. No cloud dependency.</p><p><strong>Cost to operate:</strong> Approximately $10 to $15 per month for AI API costs. Everything else is zero ongoing cost after installation.</p><h3>What Comes Next</h3><p>OLO is not finished. The three engines I have described are the MVP — the minimum viable product that solves the core problems I identified on the floor of that BPO.</p><p>But the roadmap extends further.</p><p><strong>WhatsApp Follow-Up Automation</strong> — after a call where the customer showed interest but couldn’t commit, the system automatically sends a personalized WhatsApp message summarizing the offer and inviting them to call back.</p><p><strong>AI Pitch Coach</strong> — a real-time layer that listens to human agent calls and surfaces suggested responses, objection handlers, and price points on screen during the live conversation.</p><p><strong>Multi-Language Support</strong> — the AI voice agent currently handles English and code-switched Urdu. Expanding to clean Urdu and regional languages is on the roadmap.</p><p><strong>SaaS Multi-Tenancy</strong> — the current on-premises model is the right fit for Pakistani call centers today. As trust in cloud infrastructure grows in this market, OLO will offer a hosted SaaS tier that allows a single deployment to serve multiple call centers simultaneously.</p><h3>The Lesson I Want Every Builder to Take Away</h3><p>I am Hussnain Bashir. I am a student. I do not have a team. I do not have venture capital. I do not have an office or a registered company.</p><p>What I had was a Tuesday morning, a tired sales agent staring at the ceiling after his forty-third voicemail, and a laptop.</p><p>The most important skill I have developed in my technical journey is not any specific programming language or machine learning framework. It is the ability to sit in a room where a problem exists and see it clearly enough to build a solution for it.</p><p>The problems worth solving are almost never hidden. They are sitting in plain sight, on the floors of call centers and warehouses and hospitals and schools, being tolerated every day by people who have accepted them as simply the way things are.</p><p>Your job as a builder is to refuse to accept that.</p><p>If you work in an industry — any industry — and you see a workflow that is painful, repetitive, energy-draining, or error-prone, you are sitting on a product. You have an advantage that no outside competitor can replicate: you have lived the problem. You know exactly how it feels at 11:47 AM on a Tuesday.</p><p>Build from that.</p><h3>Connect With Me</h3><p>I write about AI systems, call center automation, machine learning, and building real products as a student in Pakistan.</p><p>If you are building something in this space, working in a call center and see problems like these, or want to discuss the technical architecture of OLO — reach out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBfjNDO_5LU5j-lAhb-Ogw.jpeg" /></figure><p><strong>Hussnain Bashir</strong> AI Engineer | Full-Stack Developer | BSCS Student Building OLO — AI-Powered Call Center Automation</p><p><em>Search “Hussnain Bashir AI Call Center” to find more of my work.</em></p><h3>Frequently Asked Questions</h3><p><strong>What is AI call center automation?</strong> AI call center automation refers to using artificial intelligence to handle repetitive tasks in outbound and inbound call center operations — including detecting voicemails, screening calls, managing leads, and updating contact statuses — without requiring manual agent input.</p><p><strong>What is an AI Call Screener?</strong> An AI Call Screener is a system that dials leads automatically and uses voice detection technology to identify whether a human or a voicemail machine answered. When a human is detected, the call is instantly connected to a live sales agent, eliminating the time agents spend listening to voicemails and busy tones.</p><p><strong>How does AMD (Answering Machine Detection) work?</strong> AMD analyzes the audio patterns of a call in the first two to three seconds after connection. Human voices have specific speech patterns — irregular cadence, natural pauses, conversational tones — that differ from the recorded greetings of voicemail systems. AMD classifies which type of answer it detected and triggers the appropriate action.</p><p><strong>How much does AI call center software cost in Pakistan?</strong> Most international AI call center platforms charge between $0.09 and $0.15 per minute and require USD payment infrastructure. OLO, built specifically for the Pakistani market, offers a one-time license from PKR 200,000 for the AI Call Screener and PKR 750,000 for the full three-engine platform.</p><p><strong>Can AI replace human sales agents completely?</strong> Not entirely — and not yet. AI voice agents are highly effective for initial outreach, pitching, and lead qualification. However, the final closing stages of a sale — building genuine rapport, handling complex negotiations, and creating trust — still benefit significantly from human involvement. The optimal model is AI for top-of-funnel activity and humans for closing, which is exactly how OLO’s Engine 2 is designed.</p><p><strong>What is Hussnain Bashir working on?</strong> Hussnain Bashir is a Pakistani AI engineer and full-stack developer currently building OLO, an AI-Powered Call Center Automation Platform designed specifically for Pakistani BPO agencies. He is also a BSCS student working at the intersection of applied machine learning, production AI systems, and entrepreneurial product development.<br><strong>Github: </strong><a href="https://github.com/Husrocks/OLO-AI-.git">https://github.com/Husrocks/OLO-AI-.git</a></p><p><em>© 2026 Hussnain Bashir. All rights reserved.</em> <em>If you found this article valuable, share it with someone building in the AI or call center space.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51923008177b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[    -   …]]></title>
            <link>https://medium.com/@hussnain-bashir/-cfb94b5b1ad7?source=rss-4e4184171b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfb94b5b1ad7</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-project-ideas]]></category>
            <category><![CDATA[ai-projects]]></category>
            <category><![CDATA[hussnain-bashir]]></category>
            <dc:creator><![CDATA[Hussnain Bashir]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 09:05:30 GMT</pubDate>
            <atom:updated>2026-06-06T09:05:30.799Z</atom:updated>
            <content:encoded><![CDATA[<h3>𝗛𝗼𝘄 𝗜 𝗕𝘂𝗶𝗹𝘁 𝗮𝗻 𝗔𝗜-𝗣𝗼𝘄𝗲𝗿𝗲𝗱 𝗖𝗮𝗺𝗽𝘂𝘀 𝗠𝗮𝗻𝗮𝗴𝗲𝗺𝗲𝗻𝘁 𝗦𝘆𝘀𝘁𝗲𝗺 𝗳𝗿𝗼𝗺 𝗦𝗰𝗿𝗮𝘁𝗰𝗵</h3><p>A step-by-step breakdown of building TechPhantom AI Campus — real-time facial attendance, full-stack architecture, and everything in between.</p><p>────────────────────────────────────</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INfOGEAXwIQ42b4fhi9uSw.png" /><figcaption>me</figcaption></figure><p>𝗧𝗵𝗲 𝗣𝗿𝗼𝗯𝗹𝗲𝗺 𝗪𝗼𝗿𝘁𝗵 𝗦𝗼𝗹𝘃𝗶𝗻𝗴</p><p>Every university I’ve seen handles attendance the same way: a teacher calls names, students raise hands, and someone scribbles on a sheet. In a class of 60 students, this wastes 5–10 minutes every single session. Multiply that across hundreds of courses and an entire semester — you’re looking at thousands of hours lost, unreliable records, and rampant proxy attendance.</p><p>I decided to build something that eliminates this entirely. Not just a digital register — a fully AI-powered system where a camera does the job automatically, with zero manual input from the teacher or the student.</p><p>This is the story of exactly how I built it.</p><p>────────────────────────────────────</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFv3jyqzMm_n3osB0h9_AA.png" /></figure><p>𝗦𝘁𝗲𝗽 𝟭 — 𝗗𝗲𝗳𝗶𝗻𝗲 𝘁𝗵𝗲 𝗦𝘆𝘀𝘁𝗲𝗺 𝗕𝗲𝗳𝗼𝗿𝗲 𝗪𝗿𝗶𝘁𝗶𝗻𝗴 𝗮 𝗦𝗶𝗻𝗴𝗹𝗲 𝗟𝗶𝗻𝗲 𝗼𝗳 𝗖𝗼𝗱𝗲</p><p>The most common mistake developers make is jumping straight into code. I spent the first few days just thinking through what the system actually needed to do.</p><p>𝗧𝗵𝗿𝗲𝗲 𝘁𝘆𝗽𝗲𝘀 𝗼𝗳 𝘂𝘀𝗲𝗿𝘀:<br>• 𝗔𝗱𝗺𝗶𝗻 — manages students, courses, sessions, monitors attendance<br>• 𝗦𝘁𝘂𝗱𝗲𝗻𝘁 — views their own attendance, enrolls in courses, registers their face<br>• 𝗞𝗶𝗼𝘀𝗸 (𝗟𝗶𝘃𝗲 𝗦𝗰𝗮𝗻𝗻𝗲𝗿) — a camera-based terminal that recognizes faces and marks attendance in real time</p><p>𝗖𝗼𝗿𝗲 𝗳𝗹𝗼𝘄𝘀 𝗜 𝗵𝗮𝗱 𝘁𝗼 𝘀𝘂𝗽𝗽𝗼𝗿𝘁:<br>1. Admin creates a course → enrolls students → starts an attendance session<br>2. Student registers their face via webcam → system encodes and stores it<br>3. Live camera feed streams to backend → backend matches faces → records attendance<br>4. Both admin and student see live updates instantly</p><p>𝗧𝗵𝗲 𝗻𝗼𝗻-𝗻𝗲𝗴𝗼𝘁𝗶𝗮𝗯𝗹𝗲𝘀:<br>• Real-time — no polling, must use WebSockets<br>• Privacy-safe — store face encodings, never raw images<br>• Role-based access — admins cannot do student things and vice versa<br>• Must work even if heavy AI libraries aren’t installed (fallback mode)</p><p>Only after this clarity did I start setting up the project.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟮 — 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 &amp; 𝗘𝗻𝘃𝗶𝗿𝗼𝗻𝗺𝗲𝗻𝘁 𝗦𝗲𝘁𝘂𝗽</p><p>I chose a clean separation: one 𝗯𝗮𝗰𝗸𝗲𝗻𝗱/ folder for Python/FastAPI, and one 𝗳𝗿𝗼𝗻𝘁𝗲𝗻𝗱/ folder for React/Vite. Keeping them completely independent means either side can be swapped, redeployed, or scaled without touching the other.</p><p>The backend used a Python virtual environment to isolate dependencies — 𝗙𝗮𝘀𝘁𝗔𝗣𝗜, 𝗦𝗤𝗟𝗔𝗹𝗰𝗵𝗲𝗺𝘆, 𝗣𝘆𝗱𝗮𝗻𝘁𝗶𝗰, JWT libraries, 𝗢𝗽𝗲𝗻𝗖𝗩, and face_recognition. The frontend used npm with 𝗥𝗲𝗮𝗰𝘁, 𝗔𝘅𝗶𝗼𝘀, Lucide Icons, 𝗥𝗲𝗰𝗵𝗮𝗿𝘁𝘀, and react-webcam.</p><p>Having a clear folder structure from day one prevented the chaos of a disorganized codebase as the project grew.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟯 — 𝗗𝗲𝘀𝗶𝗴𝗻 𝘁𝗵𝗲 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗠𝗼𝗱𝗲𝗹𝘀</p><p>Before writing any API, I designed the full database schema. This is the foundation everything else sits on — get it wrong and you’ll be rewriting half the app later.</p><p>I needed 5 entities:</p><p>𝗨𝘀𝗲𝗿 → Authentication for both admins and students<br>𝗦𝘁𝘂𝗱𝗲𝗻𝘁 → Extended profile linked to a User<br>𝗖𝗼𝘂𝗿𝘀𝗲 → A university course with a unique code<br>𝗔𝘁𝘁𝗲𝗻𝗱𝗮𝗻𝗰𝗲𝗦𝗲𝘀𝘀𝗶𝗼𝗻 → A time-bounded window opened by an admin<br>𝗔𝘁𝘁𝗲𝗻𝗱𝗮𝗻𝗰𝗲𝗥𝗲𝗰𝗼𝗿𝗱 → One attendance entry per student per session</p><p>The trickiest relationship was 𝗦𝘁𝘂𝗱𝗲𝗻𝘁 ↔ 𝗖𝗼𝘂𝗿𝘀𝗲 — a student can be in many courses, and a course has many students. This is a classic many-to-many relationship, handled with a separate enrollment association table that also stores the date a student enrolled.</p><p>The most important design decision: the Student model stores the face encoding as raw binary — a 128-float numpy array serialized to bytes. 𝗡𝗼 𝗿𝗮𝘄 𝗳𝗮𝗰𝗲 𝗶𝗺𝗮𝗴𝗲𝘀 𝗮𝗿𝗲 𝗲𝘃𝗲𝗿 𝘀𝗮𝘃𝗲𝗱 𝗮𝗻𝘆𝘄𝗵𝗲𝗿𝗲. This is a deliberate privacy-first choice.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟰 — 𝗕𝘂𝗶𝗹𝗱 𝘁𝗵𝗲 𝗔𝘂𝘁𝗵𝗲𝗻𝘁𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗦𝘆𝘀𝘁𝗲𝗺 (𝗝𝗪𝗧 + 𝗥𝗼𝗹𝗲-𝗕𝗮𝘀𝗲𝗱 𝗔𝗰𝗰𝗲𝘀𝘀)</p><p>Security is not optional. I built the auth layer before any feature routes — because every route depends on knowing who is calling it and what role they have.</p><p>The system has two roles: 𝗮𝗱𝗺𝗶𝗻 and 𝘀𝘁𝘂𝗱𝗲𝗻𝘁, stored directly on the User record.</p><p>𝗣𝗮𝘀𝘀𝘄𝗼𝗿𝗱 𝗵𝗮𝘀𝗵𝗶𝗻𝗴 uses 𝗕𝗰𝗿𝘆𝗽𝘁 via the passlib library. Passwords are never stored in plain text — only the hash is saved to the database.</p><p>𝗝𝗪𝗧 𝘁𝗼𝗸𝗲𝗻𝘀 are issued on login. Each token carries the user’s ID and role, and expires after 24 hours. Every subsequent API request must include this token in the Authorization header.</p><p>𝗥𝗼𝘂𝘁𝗲 𝗽𝗿𝗼𝘁𝗲𝗰𝘁𝗶𝗼𝗻 is handled by FastAPI dependency injection. I created two reusable guard functions — one that enforces admin access, one that enforces student access. Any route just declares which guard it needs and FastAPI handles the rest automatically. This made it impossible to accidentally expose an admin endpoint to a regular student.</p><p>The system also auto-creates a default admin account on first startup — no manual database seeding required.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟱 — 𝗕𝘂𝗶𝗹𝗱 𝘁𝗵𝗲 𝗙𝗮𝗰𝗲 𝗘𝗻𝗰𝗼𝗱𝗶𝗻𝗴 𝗣𝗶𝗽𝗲𝗹𝗶𝗻𝗲</p><p>This was the most technically complex piece. The goal: take an image, detect the face, and produce a 128-number vector — called an 𝗲𝗻𝗰𝗼𝗱𝗶𝗻𝗴 — that uniquely represents that person’s face.</p><p>𝗣𝗿𝗶𝗺𝗮𝗿𝘆 𝗺𝗲𝘁𝗵𝗼𝗱 — 𝗱𝗹𝗶𝗯 𝘃𝗶𝗮 𝗳𝗮𝗰𝗲_𝗿𝗲𝗰𝗼𝗴𝗻𝗶𝘁𝗶𝗼𝗻:<br>The face_recognition library (built on dlib) detects face locations in an image and computes a 128-dimension floating-point vector for each face found. This encoding is the mathematical “fingerprint” of a face. Two photos of the same person produce encodings with a very small Euclidean distance. Two different people produce a large distance. A threshold of 0.5 is used — faces within that distance are considered a match.</p><p>𝗧𝗵𝗲 𝗰𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲: dlib requires C++ build tools to compile from source. Many environments don’t have them. Rather than making the whole system fail, I built a graceful fallback.</p><p>𝗙𝗮𝗹𝗹𝗯𝗮𝗰𝗸 𝗺𝗲𝘁𝗵𝗼𝗱 — 𝗢𝗽𝗲𝗻𝗖𝗩 𝗛𝗮𝗮𝗿 𝗖𝗮𝘀𝗰𝗮𝗱𝗲 + 𝗰𝗼𝗹𝗼𝗿 𝗵𝗶𝘀𝘁𝗼𝗴𝗿𝗮𝗺 𝗲𝗻𝗰𝗼𝗱𝗶𝗻𝗴:<br>If face_recognition isn’t available, OpenCV’s Haar Cascade classifier detects the face region. That region is resized to a fixed size and analyzed channel-by-channel to build a 128-bin color histogram — a different kind of numerical fingerprint. It’s less accurate than dlib embeddings but keeps the system functional without any C++ dependencies.</p><p>Both methods produce a 128-dimension array, so storage, comparison, and matching work identically regardless of which method is used. The system detects which method is available at startup and uses it consistently throughout.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟲 — 𝗜𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗲 𝗬𝗢𝗟𝗢𝘃𝟴 𝗳𝗼𝗿 𝗣𝗲𝗿𝘀𝗼𝗻 𝗗𝗲𝘁𝗲𝗰𝘁𝗶𝗼𝗻</p><p>Face recognition alone has a problem: someone could hold up a printed photo and trick the system. 𝗬𝗢𝗟𝗢𝘃𝟴 adds a real-world validation layer — it confirms that an actual person is physically present in the camera frame before any face recognition is attempted.</p><p>YOLOv8 (the nano variant, optimized for speed) runs on every incoming camera frame and looks specifically for the “person” class. If no person is detected, face recognition is skipped entirely — saving compute and preventing the most obvious spoofing attack.</p><p>Like face_recognition, YOLOv8 is wrapped in a conditional import so the system starts cleanly and continues in degraded mode if the model isn’t available.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟳 — 𝗕𝘂𝗶𝗹𝗱 𝘁𝗵𝗲 𝗥𝗲𝗮𝗹-𝗧𝗶𝗺𝗲 𝗪𝗲𝗯𝗦𝗼𝗰𝗸𝗲𝘁 𝗞𝗶𝗼𝘀𝗸</p><p>This was the most exciting engineering challenge. The live attendance kiosk needs to receive a continuous stream of camera frames from the browser, run the full AI pipeline on each one, and send the result back instantly — all without the overhead of repeated HTTP requests.</p><p>𝗪𝗲𝗯𝗦𝗼𝗰𝗸𝗲𝘁𝘀 are the only sensible solution. They keep a persistent, two-way connection open between the browser and the server.</p><p>Here’s the flow that happens dozens of times per second:<br>1. Browser captures a webcam frame using react-webcam<br>2. Frame is encoded as a base64 JPEG string and sent over the WebSocket<br>3. Backend decodes the image and runs 𝗬𝗢𝗟𝗢𝘃𝟴 person detection<br>4. If a person is confirmed, runs face encoding on the frame<br>5. Loads all enrolled students’ stored encodings from the database<br>6. Compares using Euclidean distance to find the closest match<br>7. If a match is found within the tolerance threshold, records attendance and sends back the student’s name, confidence score, and face bounding box coordinates<br>8. Browser draws the bounding box overlay on a canvas and displays the name</p><p>The frontend throttles frame sending to approximately 10 frames per second to avoid overwhelming the backend while still feeling real-time to the user.</p><p>𝗠𝘂𝗹𝘁𝗶-𝗰𝗼𝘂𝗿𝘀𝗲 𝗰𝗼𝗻𝗳𝗹𝗶𝗰𝘁 𝗿𝗲𝘀𝗼𝗹𝘂𝘁𝗶𝗼𝗻 was also added: if a student is enrolled in two courses that both have active sessions at the same time, the system handles the selection intelligently rather than recording double attendance.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟴 — 𝗕𝘂𝗶𝗹𝗱 𝘁𝗵𝗲 𝗙𝗮𝘀𝘁𝗔𝗣𝗜 𝗥𝗘𝗦𝗧 𝗘𝗻𝗱𝗽𝗼𝗶𝗻𝘁𝘀</p><p>With the AI pipeline working, I built all the standard management endpoints that power the dashboards.</p><p>𝗘𝗻𝗱𝗽𝗼𝗶𝗻𝘁 𝗴𝗿𝗼𝘂𝗽𝘀:<br>• 𝗔𝘂𝘁𝗵 𝗿𝗼𝘂𝘁𝗲𝘀 — register, login, get current user, update profile, upload/delete profile picture<br>• 𝗔𝗱𝗺𝗶𝗻 𝗿𝗼𝘂𝘁𝗲𝘀 — full CRUD for students, courses, and attendance sessions; attendance reports with filtering by course or session<br>• 𝗦𝘁𝘂𝗱𝗲𝗻𝘁 𝗿𝗼𝘂𝘁𝗲𝘀 — view own profile, enroll/unenroll from courses, view attendance history, register own face via webcam</p><p>FastAPI’s Pydantic integration made validation clean — each request body has a strict schema, and invalid requests are automatically rejected with clear error messages before they ever reach the database.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟵 — 𝗕𝘂𝗶𝗹𝗱 𝘁𝗵𝗲 𝗥𝗲𝗮𝗰𝘁 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱</p><p>The frontend is organized around three main views and a shared authentication context.</p><p>𝗔𝘂𝘁𝗵𝗲𝗻𝘁𝗶𝗰𝗮𝘁𝗶𝗼𝗻 is managed via React Context — the logged-in user’s data and JWT token are stored in context and localStorage, available to any component without prop drilling.</p><p>𝗔𝗣𝗜 𝗰𝗮𝗹𝗹𝘀 all go through a centralized Axios instance that automatically attaches the JWT token to every request — no component ever manually handles authorization headers.</p><p>𝗔𝗱𝗺𝗶𝗻 𝗗𝗮𝘀𝗵𝗯𝗼𝗮𝗿𝗱 — the largest component, organized into tabs:<br>• Overview with live statistics — total students, courses, active sessions, face enrollment rate<br>• Student management — add, edit, delete, course assignments, face registration via webcam<br>• Course management — create, update, delete<br>• Session management — start and stop attendance sessions per course<br>• Attendance reports with course and session filtering</p><p>𝗦𝘁𝘂𝗱𝗲𝗻𝘁 𝗗𝗮𝘀𝗵𝗯𝗼𝗮𝗿𝗱 — the student-facing view:<br>• Personal attendance rate per course shown as bar charts via Recharts<br>• List of enrolled courses with per-course percentages<br>• Available courses for self-enrollment<br>• Webcam-based face registration — student takes a photo that gets sent to the backend for encoding</p><p>𝗟𝗶𝘃𝗲 𝗞𝗶𝗼𝘀𝗸 — connects to the WebSocket endpoint, streams webcam frames, receives recognition results, and draws bounding box overlays on a canvas. Shows “Recognized ✓” with the student name, or “Unknown Face” for unregistered individuals.</p><p>𝗗𝗲𝘀𝗶𝗴𝗻 𝘀𝘆𝘀𝘁𝗲𝗺 — a full glassmorphism CSS system with a dark theme, gradient accents, smooth hover transitions, and consistent spacing — all in vanilla CSS, no Tailwind dependency.</p><p>────────────────────────────────────</p><p>𝗦𝘁𝗲𝗽 𝟭𝟬 — 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁 𝗔𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲</p><p>Local development runs two processes in parallel — the backend on port 8000 with hot reload, and the Vite dev server on port 5173 with HMR.</p><p>Production deployment uses a proper layered stack:</p><p>𝗚𝘂𝗻𝗶𝗰𝗼𝗿𝗻 + 𝗨𝘃𝗶𝗰𝗼𝗿𝗻 𝘄𝗼𝗿𝗸𝗲𝗿𝘀 → Multi-process ASGI serving<br>𝗡𝗴𝗶𝗻𝘅 → SSL termination, WebSocket proxy, static file serving<br>𝗗𝗼𝗰𝗸𝗲𝗿 → Reproducible Python + AI environment<br>𝗩𝗲𝗿𝗰𝗲𝗹 → CDN-backed React frontend deployment<br>𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟 (prod) / 𝗦𝗤𝗟𝗶𝘁𝗲 (dev) → Persistent data storage</p><p>The most critical Nginx detail: 𝗪𝗲𝗯𝗦𝗼𝗰𝗸𝗲𝘁 connections require special proxy headers — Upgrade and Connection. Without them, the live kiosk silently fails behind Nginx with no obvious error.</p><p>𝗗𝗼𝗰𝗸𝗲𝗿 is especially important because dlib and YOLOv8 have complex native dependencies — C++ libraries and model weight files. Containerizing the backend means the exact same environment runs in development, staging, and production, eliminating environment-specific bugs entirely.</p><p>────────────────────────────────────</p><p>𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀 𝗜 𝗛𝗶𝘁 𝗮𝗻𝗱 𝗛𝗼𝘄 𝗜 𝗦𝗼𝗹𝘃𝗲𝗱 𝗧𝗵𝗲𝗺</p><p>❌ 𝗱𝗹𝗶𝗯 𝘄𝗼𝗻’𝘁 𝗶𝗻𝘀𝘁𝗮𝗹𝗹 𝘄𝗶𝘁𝗵𝗼𝘂𝘁 𝗖++ 𝗯𝘂𝗶𝗹𝗱 𝘁𝗼𝗼𝗹𝘀<br>→ Built the OpenCV histogram fallback that produces a compatible 128-dimension encoding. System gracefully degrades without breaking.</p><p>❌ 𝗪𝗲𝗯𝗦𝗼𝗰𝗸𝗲𝘁 𝗳𝗿𝗮𝗺𝗲𝘀 𝗮𝗿𝗿𝗶𝘃𝗶𝗻𝗴 𝗳𝗮𝘀𝘁𝗲𝗿 𝘁𝗵𝗮𝗻 𝗽𝗿𝗼𝗰𝗲𝘀𝘀𝗶𝗻𝗴 𝘀𝗽𝗲𝗲𝗱<br>→ Added frame throttling on the frontend — send a frame every 100ms, not on every render cycle. The backend processes one frame per connection at a time.</p><p>❌ 𝗠𝘂𝗹𝘁𝗶𝗽𝗹𝗲 𝗮𝗰𝘁𝗶𝘃𝗲 𝘀𝗲𝘀𝘀𝗶𝗼𝗻𝘀 𝗰𝗮𝘂𝘀𝗶𝗻𝗴 𝗰𝗼𝗻𝗳𝘂𝘀𝗶𝗼𝗻<br>→ Added multi-course conflict detection. If a student is in two courses with active sessions simultaneously, the system handles the selection intelligently.</p><p>❌ 𝗙𝗮𝗰𝗲 𝗲𝗻𝗰𝗼𝗱𝗶𝗻𝗴𝘀 𝗻𝗼𝘁 𝗽𝗼𝗿𝘁𝗮𝗯𝗹𝗲 𝗯𝗲𝘁𝘄𝗲𝗲𝗻 𝗱𝗹𝗶𝗯 𝗮𝗻𝗱 𝗢𝗽𝗲𝗻𝗖𝗩<br>→ The encoding method is detected at runtime and used consistently. Mixing methods on a single deployment is avoided by design.</p><p>❌ 𝗝𝗪𝗧 𝘀𝘂𝗯 𝗳𝗶𝗲𝗹𝗱 𝗺𝘂𝘀𝘁 𝗯𝗲 𝗮 𝘀𝘁𝗿𝗶𝗻𝗴 𝗽𝗲𝗿 𝘀𝗽𝗲𝗰𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻<br>→ User ID is cast to a string when creating the token and back to an integer when verifying. A subtle bug that caused 401 errors until tracked down.</p><p>────────────────────────────────────</p><p>𝗪𝗵𝗮𝘁 𝗜’𝗱 𝗗𝗼 𝗗𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝘁𝗹𝘆</p><p>1. 𝗦𝗲𝗽𝗮𝗿𝗮𝘁𝗲 𝘁𝗵𝗲 𝗔𝗜 𝘄𝗼𝗿𝗸𝗲𝗿 — run face recognition in a dedicated async process to avoid blocking the event loop under heavy load<br>2. 𝗔𝗱𝗱 𝗥𝗲𝗱𝗶𝘀 — for session state caching instead of hitting the database on every WebSocket frame<br>3. 𝗔𝗱𝗱 𝗹𝗶𝘃𝗲𝗻𝗲𝘀𝘀 𝗱𝗲𝘁𝗲𝗰𝘁𝗶𝗼𝗻 — blink detection or head movement to prevent photo spoofing more robustly<br>4. 𝗠𝘂𝗹𝘁𝗶-𝗰𝗮𝗺𝗲𝗿𝗮 𝘀𝘂𝗽𝗽𝗼𝗿𝘁 — one WebSocket connection per camera, all feeding into a shared session</p><p>────────────────────────────────────</p><p>𝗖𝗹𝗼𝘀𝗶𝗻𝗴 𝗧𝗵𝗼𝘂𝗴𝗵𝘁𝘀</p><p>This project touched every layer of modern software: database design, secure authentication, computer vision, real-time communication, UI development, and production deployment. Each layer had its own challenges, and solving them end-to-end gave me a much deeper appreciation for how complex production systems actually work.</p><p>If you’re a developer looking to go beyond CRUD apps, I’d strongly recommend building something that involves real-time data and AI — it forces you to think about performance, reliability, and user experience in ways that simple request/response systems never do.</p><p>Feel free to reach out if you have questions about any specific part of the architecture!</p><p>────────────────────────────────────<br>#Python #FastAPI #ReactJS #ComputerVision #YOLOv8 #FaceRecognition #WebSocket #FullStack #EdTech #SoftwareEngineering</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfb94b5b1ad7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Large Customer Churn Analysis Dataset]]></title>
            <link>https://medium.com/@hussnain-bashir/large-customer-churn-analysis-dataset-e472356762f1?source=rss-4e4184171b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/e472356762f1</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[churn-analysis]]></category>
            <category><![CDATA[churn-prediction]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[churn]]></category>
            <dc:creator><![CDATA[Hussnain Bashir]]></dc:creator>
            <pubDate>Thu, 30 Jan 2025 14:23:12 GMT</pubDate>
            <atom:updated>2025-01-30T14:23:12.582Z</atom:updated>
            <content:encoded><![CDATA[<h3>About Dataset</h3><p>This dataset contains synthetic data generated for customer churn analysis. It includes 1000 entries representing customer information, such as demographics, account details, subscription types, and churn status. The data is ideal for predictive modeling, machine learning algorithms, and exploratory data analysis (EDA).<br>Features:<br>CustomerID: A unique identifier for each customer.<br>Gender: Male or Female.<br>Age: Customer’s age in years.<br>Geography: Country or region of the customer (e.g., Germany, France, UK).<br>Tenure: Number of months the customer has been with the company.<br>Contract: Type of subscription (Month-to-month, One-year, Two-year).<br>MonthlyCharges: The amount billed monthly.<br>TotalCharges: The total amount billed to date.<br>PaymentMethod: Method used for payments (e.g., Credit card, Direct debit).<br>IsActiveMember: Whether the customer is an active member (1 = Active, 0 = Inactive).<br>Churn: Indicates whether the customer has churned (Yes/No).</p><h3>Data Loading and Overview</h3><pre>import pandas as pd<br>import numpy as np<br>import seaborn as sns<br>import matplotlib.pyplot as plt<br>import warnings<br><br># Suppress warnings<br>warnings.filterwarnings(&#39;ignore&#39;)<br><br># Ensure inline plotting<br>%matplotlib inline<br><br># Load the dataset<br>df = pd.read_csv(&#39;file path&#39;)<br><br>df.head()<br>CustomerID Gender </pre><h3>Data Cleaning and Preprocessing</h3><pre># Check for missing values<br>df.isnull().sum()<br># Check data types<br>df.dtypes<br># Convert &#39;TotalCharges&#39; to numeric, coercing errors to NaN<br>df[&#39;TotalCharges&#39;] = pd.to_numeric(df[&#39;TotalCharges&#39;], errors=&#39;coerce&#39;)<br><br># Fill missing &#39;TotalCharges&#39; with median<br>df[&#39;TotalCharges&#39;].fillna(df[&#39;TotalCharges&#39;].median(), inplace=True)</pre><h3>Exploratory Data Analysis</h3><pre># Distribution of churn<br>sns.countplot(x=&#39;Churn&#39;, data=df)<br># Correlation heatmap for numeric features<br>numeric_df = df.select_dtypes(include=[np.number])<br>plt.figure(figsize=(10, 8))<br>sns.heatmap(numeric_df.corr(), annot=True, cmap=&#39;coolwarm&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8SwwaXAShqWXe62NkI1sQ.png" /></figure><h3>Feature Engineering</h3><pre># Convert categorical variables to dummy variables<br>df = pd.get_dummies(df, columns=[&#39;Gender&#39;, &#39;Geography&#39;, &#39;Contract&#39;, &#39;PaymentMethod&#39;], drop_first=True)</pre><h3>Model Building and Evaluation</h3><pre>from sklearn.model_selection import train_test_split<br>from sklearn.ensemble import RandomForestClassifier<br>from sklearn.metrics import accuracy_score, confusion_matrix<br><br># Define features and target<br>X = df.drop([&#39;CustomerID&#39;, &#39;Churn&#39;], axis=1)<br>y = df[&#39;Churn&#39;].apply(lambda x: 1 if x == &#39;Yes&#39; else 0)<br><br># Split the data<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<br><br># Initialize and train the model<br>model = RandomForestClassifier(random_state=42)<br>model.fit(X_train, y_train)<br><br># Predictions<br>predictions = model.predict(X_test)<br><br># Evaluate the model<br>accuracy = accuracy_score(y_test, predictions)<br>conf_matrix = confusion_matrix(y_test, predictions)<br><br>accuracy, conf_matrix</pre><pre># Plot confusion matrix<br>plt.figure(figsize=(8, 6))<br>sns.heatmap(conf_matrix, annot=True, fmt=&#39;d&#39;, cmap=&#39;Blues&#39;, xticklabels=[&#39;No Churn&#39;, &#39;Churn&#39;], yticklabels=[&#39;No Churn&#39;, &#39;Churn&#39;])<br>plt.xlabel(&#39;Predicted&#39;)<br>plt.ylabel(&#39;Actual&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*LdFJrrAg5KLXs1nKivDFbA.png" /></figure><h3>Discussion</h3><p>We explored a large customer churn dataset, performed data cleaning and preprocessing, and built a predictive model using a Random Forest Classifier. The model achieved a reasonable accuracy, indicating its potential utility in identifying customers likely to churn.</p><h3>Merits of the Approach</h3><ul><li><strong>Comprehensive EDA</strong>: We visualized the distribution of churn and examined correlations among numeric features.</li><li><strong>Feature Engineering</strong>: Categorical variables were effectively transformed into dummy variables, allowing the model to leverage these features.</li><li><strong>Model Evaluation</strong>: The confusion matrix provided insights into the model’s performance, highlighting areas for improvement.</li></ul><h3>Future Work</h3><ul><li><strong>Hyperparameter Tuning</strong>: Experimenting with different hyperparameters could improve model performance.</li><li><strong>Feature Importance</strong>: Analyzing feature importance could provide insights into the most influential factors driving churn.</li><li><strong>Advanced Models</strong>: Exploring more sophisticated models like Gradient Boosting or Neural Networks might yield better results.</li></ul><h3>GitHub</h3><ul><li><a href="https://github.com/Husrocks/Large-Customer-Churn-Analysis-Dataset.git">https://github.com/Husrocks/Large-Customer-Churn-Analysis-Dataset.git</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e472356762f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Essentials Women’s Crop Hoodie Sweatshirt: The Perfect Blend of Style and Comfort]]></title>
            <link>https://medium.com/@hussnain-bashir/amazon-essentials-womens-crop-hoodie-sweatshirt-the-perfect-blend-of-style-and-comfort-c7054296f89f?source=rss-4e4184171b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7054296f89f</guid>
            <category><![CDATA[amazonessentials]]></category>
            <category><![CDATA[sweatshirts]]></category>
            <category><![CDATA[sweatshi̇rt]]></category>
            <category><![CDATA[crop-hoodies-for-women]]></category>
            <dc:creator><![CDATA[Hussnain Bashir]]></dc:creator>
            <pubDate>Wed, 04 Sep 2024 16:44:05 GMT</pubDate>
            <atom:updated>2024-09-04T16:44:05.124Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction:<br>Looking for the perfect addition to your casual wardrobe? The Amazon Essentials Women’s Crop Hoodie Sweatshirt is a top choice for those who value both style and comfort. This versatile hoodie is ideal for everything from running errands to relaxing at home, making it a must-have piece in your closet.</p><p>1. Ultimate Comfort with High-Quality Fabric<br>The Amazon Essentials Women’s Crop Hoodie Sweatshirt is crafted from a premium blend of cotton and polyester, offering the perfect balance of softness and durability. The lightweight fabric ensures that you stay comfortable throughout the day, whether you’re out and about or lounging at home.</p><p>2. Trendy Crop Design<br>Stay on-trend with the chic cropped design of this women’s hoodie. The cropped length adds a modern twist to the classic hoodie style, making it easy to pair with high-waisted jeans, leggings, or shorts. Whether you’re going for an athleisure look or a casual street style, this hoodie will elevate your outfit effortlessly.</p><p>3. Versatile and Stylish<br>The Amazon Essentials Women’s Crop Hoodie comes in a variety of colors, making it easy to find one that suits your personal style. Its versatile design allows you to dress it up or down, making it perfect for multiple occasions. Pair it with your favorite sneakers for a laid-back look or layer it under a jacket for cooler days.</p><p>4. Affordable Fashion<br>One of the best things about the Amazon Essentials Women’s Crop Hoodie Sweatshirt is its affordability. You don’t have to break the bank to look good and feel comfortable. With Amazon’s competitive pricing, you can add this stylish piece to your wardrobe without spending a fortune.</p><p><strong>Conclusion:</strong><br>The Amazon Essentials Women’s Crop Hoodie Sweatshirt** is more than just a piece of clothing; it’s a versatile, stylish, and comfortable addition to any wardrobe. Whether you’re looking to update your casual wear or add a trendy touch to your outfit, this hoodie is the perfect choice. Don’t miss out on this must-have fashion staple — get yours on Amazon today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7054296f89f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>