<?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 Anand Lonkar on Medium]]></title>
        <description><![CDATA[Stories by Anand Lonkar on Medium]]></description>
        <link>https://medium.com/@anand.lonkar_98287?source=rss-23bbd2fbb76f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*J8Rc5ui0YYT7yK4o.jpg</url>
            <title>Stories by Anand Lonkar on Medium</title>
            <link>https://medium.com/@anand.lonkar_98287?source=rss-23bbd2fbb76f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 07:07:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anand.lonkar_98287/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[Agentic Spec-Driven Development: The Hard Parts]]></title>
            <link>https://medium.com/@anand.lonkar_98287/agentic-spec-driven-development-the-hard-parts-11969466e8db?source=rss-23bbd2fbb76f------2</link>
            <guid isPermaLink="false">https://medium.com/p/11969466e8db</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[generative-ai-development]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <dc:creator><![CDATA[Anand Lonkar]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 02:07:30 GMT</pubDate>
            <atom:updated>2026-06-21T02:07:30.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_eMzC5VvRAepMouY2wTMg.jpeg" /><figcaption>Image courtesy — Gemini</figcaption></figure><p><strong>Everyone talks about the magic of Day 1. Here’s how to handle the chaos of Day 2</strong></p><p>Unless you’ve been living under a rock for the past few months, there is no escaping the “agentic development” news and articles. The sensory overload is just too much. Spec-driven development came to the fore after AWS released Kiro during the last re:Invent. Being my curious self, I downloaded and tried it out. Nah, didn’t know what to do with it. I didn’t have a proper use case to do actual development on my own.</p><p>At the start of the new year, I wanted a place to track all my goals currently spread across fitness apps, Kindle, etc. While the tracking itself was working, it was too much manual work and lacked a single dashboard. This was a perfect use case to develop something the “agentic way”!</p><p>I stuck with VSCode instead of jumping across IDEs and started working on a goal tracker. I wanted to spec out the project first.</p><p>I started by having Claude interview me on what I needed from the project and document each of the requirements. Once I had what I thought was a comprehensive list of requirements, it was time to plan out the implementation.</p><p>This is where the plan mode worked beautifully! By the end of this phase, I had a solid implementation and test plan ready. I added the deployment steps as well and sent the agent to work. The first prototype was ready in a few hours — implemented, tested, and working on my laptop. Time to celebrate!</p><p><strong>But this is the part no one talks about. What happens after your first deployment?</strong></p><p>Change requests! How do you handle these? How do you follow spec-driven development for the many, many changes your customer (in this case, myself) wants? Naturally, I stumbled back into vibe coding, just trying things out. I built agents for writing test cases and executing them, and agents for deploying, but the middle part of writing code was still mostly individual prompts. That worked for a while, but soon spec-driven development was left behind.</p><p>With the recent discussions and loops, I started thinking about getting back into the discipline and treating every new feature as a new spec. Here is how my new workflow operates:</p><ul><li><strong>Interview-to-Spec Agent:</strong> I provide a small description of the requirement or change. It interviews me similarly to the first spec and creates a requirement document.</li><li><strong>Architect Agent:</strong> Takes the requirements and generates the necessary design changes and an implementation plan.</li><li><strong>Developer Agent:</strong> Takes the plan and executes the code. This is the part I watch closely and maintain a back-and-forth with the agent.</li><li><strong>Verify-Local Agent:</strong> Does a round of testing locally on Docker.</li><li><strong>Deploy-Checker Agent:</strong> Verifies all code still conforms to my deployment script and surfaces any non-standard development.</li><li><strong>Deployment &amp; Tester Agents:</strong> The deployment script handles the push, and the Tester executes live testing using Playwright.</li></ul><p>This pipeline has worked spectacularly for all stages except for the actual development, where it is still iterative. I am sure I can be more hands-off on this one as well, but I am not quite that trusting yet.</p><p>Spec-driven development is a breeze on Day 1. It’s Day 2 that actually tests your patience. By treating every minor change request as a brand-new spec and running it through a strict agent pipeline, I finally brought order back to the chaos. AI might be able to write the code, but discipline is still what ships the product.</p><p>I might still have trust issues with my developer agent — and I’ll probably keep watching the logs for a while — but hey, at least my goal dashboard is actually working. If you want to take it for a spin, here is a link to the current state of the goal tracker: <a href="https://goaltracker.dijit.tech/">https://goaltracker.dijit.tech</a>.</p><p>We’re all still figuring out the “Day 2” operations of AI development. If you’ve found a way to completely trust your agent without hovering over your keyboard, I’d love to hear about it. Until then, back to the terminal.</p><p>AI note — AI reviewed and polished</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11969466e8db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lazy Developer and Coding Agents]]></title>
            <link>https://medium.com/@anand.lonkar_98287/lazy-developer-and-coding-agents-01e3cace949d?source=rss-23bbd2fbb76f------2</link>
            <guid isPermaLink="false">https://medium.com/p/01e3cace949d</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[vibe-codeing]]></category>
            <category><![CDATA[ai-coding-agent]]></category>
            <dc:creator><![CDATA[Anand Lonkar]]></dc:creator>
            <pubDate>Mon, 08 Sep 2025 14:29:17 GMT</pubDate>
            <atom:updated>2025-09-08T14:32:45.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjoSPEXeCUyZdoXfuMPrgg.png" /><figcaption>Google Nano Banana generated image of lazy developer and coding agents</figcaption></figure><p>As a lazy developer, automation has been my thing for almost my entire career. Starting with writing VBS for automating logins, faking mouse movements to prevent VPN disconnection, testing firewall connections, writing whole VBA applications in excel and more recently using generative AI coding assistants.</p><p>What a long distance we have come on this front! As the automation scope increases, so has the risk. I remember connecting to and deleting a whole client production table trying to automate testing with just a script. Imagine what todays all powerful agentic AI can do.</p><p>No, no. This is not a rant about what you should and should not or how to use these tools just some of my observations working with generative AI coding assistants over the last year or so.</p><p>My journey started with Copilot used mostly as autocomplete, moving on to writing whole functions and more recently writing entire repos. Here are some of the gotchas:</p><p><strong>Hallucinations</strong> : Coding assistants have vastly improved over the last year on actually writing workable code rather than hallucinating complete APIs and workflows. These are easy to detect though since your code would not even run — provided you know it is the API that is the issue and don&#39;t go into debugging rabbit hole. More on that later</p><p><strong>Optimum solutions</strong> : Working code does not necessarily mean optimum or efficient code. Agents are the real culprits here. When you ask an agent to write, test and debug code you better know what it is doing and don&#39;t go out for a coffee or catch a nap while it is working. Too often, the agent takes a sub optimal path code, tests it, tries to debug it and goes into an endless cycle when there is a simpler solution.</p><p><strong>Supportable code</strong> : Unless we are ready to hand over the keys to the SRE kingdom to the agents (we are not.. yet at least) we need code that can be supported by Humans. Agents write elaborate code complete with well defined functions for simplest of the tasks. While it handles exceptions and logging very well, who needs 15 class files for a script to upload a CSV?</p><p><strong>Debugging</strong> : This is where the current agents fail miserably. They try to resolve the issues within the current code framework and dont look for alternate solutions. This is a product of the limited view they have. Partly this can be addressed by giving proper system prompts and giving the agent the context of the problem rather than a task. But, coder beware! Know your code even if it is AI generated!</p><p>Well then how I am handling this issues:</p><p><strong>Understand the problem, give more context:</strong> This is where generative AI shines, the more context it has the better the solution. Instead of saying “Write a script to upload this CSV” and then “generate a dashboard from this table” giving a context “I have this sensor data generated from a thermal sensor on my patio. I want to analyze this using Trino/Iceberg lakehouse setup on my NAS. Setup an automated workflow to gather the data from the sensor logs and generate a dashboard using Python” will definitely yield better results. On a similar note, IDE based agents have context of the entire folder open in the IDE. While this is difficult for humans to manage and I would normally open only the folder I am working on even from a cloned repo, Agents thrive on context and work much better when they have better understanding of what you want, rather than be limited to what you are asking it to do</p><p><strong>Understand what you want: </strong>This is more in relation to knowing the solution before implementing it. While not exactly chatbots, Agents are great at being a second pair of eyes, second opinion, sparring partner to brainstorm solutions. Dont hesitate to discuss possible solutions and give them a higher level question “I want to monitor temperature on my patio to determine when I should lower the shades. I have a thermal sensor, a docker capable NAS and am ok to have open source solutions deployed. I need a dashboard of the readings to validate my understanding. Discuss possible solutions. Do not assume anything and ask me any questions you have one by one in an interview style, periodically summarizing the conversation.” —Be prepared to spend time with your agent buddy.</p><p><strong>Know your code : </strong>During the conversation, read all the information Agent is spitting out. Agent produced code may not always be correct, optimized or manageable. Interrupt the agent when you feel it is going sideways and correct. All this assumes you actually know how to code :)</p><p>With rapidly progressing generative AI field, Coding agents are also adding capabilities every minute and some of the things above may be solved by the agent itself. Until then, like with any tool, know the options you have with agents and you will get the best results.</p><p>Would love to hear your thoughts on how you find the agents.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01e3cace949d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Agentic AI?]]></title>
            <link>https://medium.com/@anand.lonkar_98287/what-is-agentic-ai-efb1621d4289?source=rss-23bbd2fbb76f------2</link>
            <guid isPermaLink="false">https://medium.com/p/efb1621d4289</guid>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[foundational-model]]></category>
            <dc:creator><![CDATA[Anand Lonkar]]></dc:creator>
            <pubDate>Sat, 08 Feb 2025 21:14:48 GMT</pubDate>
            <atom:updated>2025-02-08T21:14:48.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ejRntBGTVdH4-mNm_PMlQ.jpeg" /><figcaption>Image by DALL-E</figcaption></figure><p>Agentic AI is the new buzzword! Its making AI agents to the work for you. The following is based on a recent discussion I was having with a colleague trying to understand what is Agentic AI.</p><p><strong><em>Wait! Isn&#39;t that what is happening now already? Why the buzz?</em></strong></p><p>AI agents (Gems, GPTs and the like) are good at Natural Language Understanding, summarizing, even reasoning. They can guide you to your desired outcome. “You are an expert trip planner specializing in Cruise vacations. Ask me one by one questions to plan a trip for a family of 4 to Bahamas” will most likely get you an excellent trip after a few iterations with any popular LLM. It will also give you links to the websites and explain its thinking. But it wont book the trip for you. This is where the “Agentic” part becomes important. With Agentic approach the agents are not only thinking but also doing things. Imagine an agent getting that exciting trip and then going ahead and booking it for you (ofcourse with your permission!)</p><p><strong><em>How does this work?</em></strong></p><p>The basic concept is that there is a overall FLM (Foundational Model) that you talk to. This model has access to tools (APIs and like) to actually do stuff. Depending on the situation the FLM or the orchestrator or router, reasons the steps needed to fulfil your request and then picks the tools to actually get things done.</p><p><strong><em>Isn&#39;t that what RAG was already doing?</em></strong></p><p>From the conceptual point of view, yes! RAG enabled FLMs to get reliable data that they have not been trained on and answer queries, but for the most part it is read only.</p><p><strong><em>Well, there were tools concept in frameworks like Langchain for a while now. Those could be used to call APIs and do a lot of stuff. So what changed?</em></strong></p><p>True! The tools existed for a while. One of the earliest use cases of Generative AI I had was a chatbot that could pick a right package for you from a list of packages available, check for the availability of the event center on your requested data, book the event center calendar for you and direct you to the payment gateway. This was not always reliable though. The models could pick up from a set of tools available to them in a straight-line following rules.</p><p>What changed now is that models crunched more parameters, became more adept at reasoning. This means that they can now handle flows that branch out, find the optimum solution and then use tools to execute the end result. And learn along the way to handle queries better!</p><p><strong><em>I understand how more advanced models might reason better, but learning on the job? That seems risky!</em></strong></p><p>Online learning is fairly new to the world of FLMs, though some of the same principles of machine learning apply to them like reinforcement learning. You do need to monitor what your FLM is learning. In addition to the usual parameters like accuracy, precision and recall, Concept drift (where the new data coming in is different from what the FLM has seen before and results in skewed or wrong inferences) also needs to be tracked.</p><p>Making sure your models are not learning things you dont want them to learn in a reliable time sensitive way can be tough. Based on your need, you can have the FLM ops pipelines tweak the model parameters in near real time, in micro batches or in scheduled batches while testing them before release. Similar to the analytics pipelines there are use cases where each of the different frequencies of retraining may be applicable.</p><p><strong><em>All the theory is fine, give me some actual use cases where I would need the learning?</em></strong></p><p>Consider cyber threat detection: High frequency, high accuracy, new methods coming in every minute. This would be an online learning scenario.</p><p>Recommendations to the customers based on what they are looking at: A standard nightly run would be more appropriate.</p><p>Choosing a payment gateway that makes my transactions less costly: Though a hypothetical scenario, something like this would need a more than nightly less than real time frequency.</p><p>Check out some of the courses on Coursera and Analytics Vidhya to learn more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efb1621d4289" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Data Engineering kitchen]]></title>
            <link>https://medium.com/@anand.lonkar_98287/the-data-engineering-kitchen-163c8289aab7?source=rss-23bbd2fbb76f------2</link>
            <guid isPermaLink="false">https://medium.com/p/163c8289aab7</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-architecture]]></category>
            <dc:creator><![CDATA[Anand Lonkar]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 00:38:35 GMT</pubDate>
            <atom:updated>2024-09-02T00:38:35.304Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine walking into a high-end restaurant. The ambiance is perfect, the lighting is just right, and you’re greeted with the tantalizing aromas of freshly prepared dishes. As you sit at your table, scanning the menu, you feel confident that whatever you choose will be delicious and perfectly prepared. You place your order, and within minutes, a beautifully plated dish arrives. You take a bite, and it’s everything you imagined.</p><p>Now, let’s pause for a moment. What you don’t see from your seat in the dining room is the flurry of activity happening behind the kitchen doors. Let me take you on a journey through that kitchen, where every dish begins its journey, much like how every piece of data starts in the world of data engineering.</p><h3>The Kitchen of Data Engineering</h3><p>Our story begins with the <strong>chefs</strong> — the masterminds in the kitchen. These are the data engineers. They are the ones who bring raw ingredients together to create something valuable. They don’t work alone. Each chef has a specific role: some are sous chefs (data architects) who oversee the operation, others are line cooks (data pipeline developers) who handle the details, and the executive chef (data engineering manager) orchestrates the entire team.</p><p><strong>Raw ingredients</strong> arrive daily, much like raw data streaming into a data system. These ingredients come from various sources: fresh produce from local farms (real-time streaming data), spices from international markets (third-party APIs), and staples stocked in the pantry (databases and internal systems). Each item is checked for quality and prepared before it is used in a dish.</p><p>Just as chefs carefully clean and chop vegetables, marinate meats, and prepare sauces, data engineers transform and prepare raw data. <strong>Raw data</strong> is ingested from different sources, cleaned to remove inconsistencies, transformed into a standard format, and stored for future use. This ensures that when a data product is needed, it’s ready to go without delay.</p><h3>Marinated Meat: The Data Product</h3><p>Now, let’s talk about the <strong>marinated meat</strong>. This is not just any ingredient. It’s been carefully prepared, flavored, and is ready to be cooked. This marinated meat represents our <strong>data products</strong> — pre-calculated, enriched data sets that are immediately usable. They are ready for action, saving time, and ensuring that the end result is rich in flavor (or, in our case, insight).</p><p>For the customer, this marinated meat is a game-changer. It’s like having pre-processed insights and dashboards at their fingertips. They don’t need to wait for hours while raw data is fetched and processed; instead, they can quickly cook up an analysis, answer a business question, or spot a trend.</p><h3>Pre-Calculated Data: The Chopped Veggies and Sauces</h3><p>Back in the kitchen, we also see trays of <strong>pre-chopped vegetables</strong>, ready-made sauces, and spice mixes. These are the unsung heroes of efficient cooking. They save time, reduce errors, and ensure consistency in every dish. In the data engineering world, these represent <strong>pre-calculated data sets</strong> — data that has been aggregated, pre-processed, and stored in accessible locations.</p><p>When a customer (a business analyst, data scientist, or decision-maker) asks for a report or analysis, they don’t have to wait for everything to be chopped and prepared from scratch. The pre-calculated data is ready to be pulled, ensuring that insights are delivered faster and more reliably.</p><h3>The Chefs: Data Engineers at Work</h3><p>The chefs in the kitchen work in harmony, each focusing on their specialty. Some might be experts in grilling, others in sauces, and some in dessert preparation. Similarly, <strong>data engineers</strong> specialize in different areas: some are experts in data ingestion, others in transformation and processing, and some in data storage and retrieval. Together, they ensure that the kitchen runs smoothly and efficiently.</p><h3>Sous Chef: The Data Architect</h3><p>Overseeing all this is the <strong>sous chef</strong>, the second-in-command who ensures everything is in order. This role is similar to the <strong>data architect</strong> in a data engineering team. The data architect designs the overall data architecture, ensuring that the data pipelines, storage solutions, and processes are aligned with the organization’s data strategy. They make sure that the ingredients (data) flow seamlessly from one station to the next, preventing any bottlenecks or quality issues.</p><h3>The Finished Dishes: Business Insights</h3><p>Finally, the kitchen sends out the <strong>finished dishes</strong> — beautifully plated, delicious, and ready to be savored. These dishes represent the <strong>business insights and reports</strong>. Just like a dish that must meet the customer’s expectations in taste, presentation, and timing, business insights must be accurate, visually compelling, and delivered at the right moment.</p><p>When you enjoy a meal at a restaurant, you experience the end result of a complex process that happens behind the scenes. Similarly, when business leaders make data-driven decisions, they are relying on the meticulous work of data engineers who transform raw data into refined, insightful data products.</p><h3>Conclusion: A Recipe for Success</h3><p>As a customer, whether in a restaurant or in a business, you rely on the skill, preparation, and organization of those behind the scenes. Just as a kitchen with pre-prepared ingredients can quickly serve high-quality meals, a well-organized data engineering team with pre-calculated data products can deliver high-quality insights efficiently.</p><p>So next time you bite into that perfectly seasoned steak or read an insightful data report, take a moment to appreciate the behind-the-scenes efforts. After all, both delicious meals and valuable insights come from careful preparation, skillful execution, and the right mix of raw ingredients.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=163c8289aab7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using data science to kick start market research — unsupervised learning and clustering]]></title>
            <link>https://medium.com/my-experiments-with-data/using-data-science-to-kick-start-market-research-unsupervised-learning-and-clustering-5615a7fd4ba7?source=rss-23bbd2fbb76f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5615a7fd4ba7</guid>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[k-means-clustering]]></category>
            <dc:creator><![CDATA[Anand Lonkar]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 03:18:18 GMT</pubDate>
            <atom:updated>2019-03-11T03:18:18.073Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using data science to kick start market research — unsupervised learning and clustering</h3><p>In the fast growing suburb of Dallas, we have an owner of 2 Montessori schools. Both the schools are quite successful. The cities in which these schools are are quite different, one established city of Plano and another one in the growing city of Frisco.</p><p>Now there is a plan to expand to other cities in Dallas area. Decoding what made the schools in the current locations tick is a matter of discussion and research which would probably be expensive and time consuming.</p><p>As it turns out I was working a project for IBM data science professional course and thought this was a good problem to solve. I thought there must be something common in these locations and given the right amount of data, I should be able to figure that out. First I had to figure out what data I needed and where to get it from.</p><h3>Data requirements</h3><p>In the preschool age group there are daycares, preschools, nursery schools and Montessori schools. The Montessori method of teaching differs from other preschools and nurseries. Montessori school teachers need to undergo special training. This contributes to these schools being costlier than other preschools, so the parents sending their kids to these schools should be at least in the middle-class income bracket. That points to income data. Depending on a parent’s income, you can make a prediction about what type of schooling their child or children receives.</p><p>Another factor that needs to be taken into account is; what’s the competition like? How many schools are in the area? This points to getting a list of all the preschools in the area.</p><p>We need to target areas with sizeable number of kids below age of 5 since those are the ones who will attend the Montessori school. That means we need demographic information, and we need some way to find an area of interest and split it into smaller areas to compare against each other. I used the zip codes to do this. I use my zip code, 75035, as a starter for this.</p><p>Summarizing, we need :</p><ol><li>All Zip codes within 100 miles of my location — Data from <a href="https://www.zipcodestogo.com/lookups/radius-search.php">https://www.zipcodestogo.com/lookups/radius-search.php</a></li><li>Location data for all zip codes in Texas — <a href="https://github.com/OpenDataDE/State-zip-code-GeoJSON">https://github.com/OpenDataDE/State-zip-code-GeoJSON</a></li><li>Census Data for each zip code</li><li>Population data — Total population and kids under 5</li><li>Income profile for each Zip code</li><li>Housing data for each Zip code</li><li>Foursquare API — to find educational institutions in each of the zip codes</li></ol><h3>Methodology</h3><p>The first step is to get the Zip codes within a 100-mile radius of the current locations. For simplicity, I took my location as the center and got data for surrounding zip-codes. This is our area of interest.</p><p>Next step is to get the location data for each of the zip codes. Fortunately this is a common problem and I was able to find a open source file giving all the required zip codes and their latitude longitude. Even though these may not be exact, they serve the purpose.</p><p>Once the location data was prepared, the next step is to get the number of preschools in a zip code. The Foursquare APIs were helpful in this context but posed several problems:</p><p>1. The APIs depend on a provided latitude and longitude and radius to find venues. Since the zip codes vary greatly in terms of area, applying this is not a one step solution. To overcome this issue, I matched the zip codes from the resultset venues to the zip code I was searching for effectively limit it to the zip code of interest</p><p>2. Another problem was the categories. Foursquare has preschools in different categories:</p><p>a. Daycare — 4f4532974b9074f6e4fb0104</p><p>b. Preschool — 52e81612bcbc57f1066b7a45</p><p>c. Nursery School — 4f4533814b9074f6e4fb0107</p><p>There is no separate classification for a Montessori school. This means that I found way more schools than expected. Though a Montessori school will compete with other Montessori schools, the target demographic is same irrespective of the type of school. So, this worked out to my advantage!</p><p>3. The data returned from foursquare was not consistent, the zip code and city fields were not returned consistently. I had to work around these and default them.</p><p>The school data was then aggregated over the zip codes.</p><p>Next was getting the census data. This is tricky since there is too much data to sift through and it is spread across multiple tables. After doing some research on the data, I finalized 3 tables each corresponding to Housing data, Income data and Age data from the 2017 estimate. I removed the unnecessary columns and renamed the columns to a more human readable format.</p><p>Merging this data was done on the zip code columns.</p><p>Once merged, K-means was used to cluster the data together. Some zip codes that did not have the necessary data were removed from the data set.</p><p><a href="https://en.wikipedia.org/wiki/K-means_clustering"><strong><em>k</em>-means clustering</strong></a> is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. <em>k</em>-means clustering aims to partition <em>n</em> observations into <em>k</em> clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*DRid9Xv81KBQoJkONK-e8A.png" /><figcaption>Inputs to K-means clustering</figcaption></figure><p>After the first set of clustering, both the locations fell into different clusters. I used the K-means elbow clustering to make sure the current schools are in the same cluster.</p><p>Once this was done, for looking at areas with least competition, I used the ratio of number of kids under 5 to the number of preschools was used to select the best zip code to open a new Montessori in the area of interest.</p><h3>Results and discussion</h3><p>Out of the 217 different zipcodes that participated in the battle of these neighborhoods, 5 clusters were formed. The number of clusters was chosen arbitrarily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ecEu0bl9qxwcdnqqIx0Cug.png" /><figcaption>Number of zip codes in each cluster</figcaption></figure><p>I verified that clusters are formed in such a way that both the locations are in same cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iEFQNkRcrRaF9CPABHY3jA.png" /><figcaption>Both 75035 and 75024 are in the same cluster</figcaption></figure><p>This cluster was then sorted by the kids to preschool ratio and the winner was zip code 75078 -a nearby suburb of Prosper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*UVNKOJUEnotTRz88nWZPlw.png" /><figcaption>And the winner is — 75078 — City of Prosper!</figcaption></figure><p>Prosper has many similarities with both Plano and Frisco which I know about anecdotally and is now proved by this exercise.</p><ol><li>Frisco and Prosper are new and upcoming locations</li><li>All 3 are high income cities mostly formed by expats from other states</li><li>Frisco and Plano are home to some of the new transplant companies from across US while Frisco and Prosper also serve as sleeper cities to the working class</li></ol><p>Highlighted below are existing locations in the bottom and the suggested location on the top</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*7XAnzSIdqOBc9Ud9ZalvrA.png" /><figcaption>Current locations and the future location of the schools</figcaption></figure><h3>Conclusion</h3><p>K-means offers a way to find similar data based on its characteristics. In this experiment, this clustering helped uncover a whole bunch of zip codes that are similar to the current locations of schools.</p><p>While this provides a good direction to where the best area to open the school would be there are some caveats:</p><ol><li>The data points considered were from my limited research and are by no means comprehensive. This method does provide a foundation to add more features.</li><li>The data from Foursquare is not comprehensive and real time. While directionally correct the ground realities on the especially fast growing north Texas suburbs may be different and would need manual verification or would need other data sources for confirmation</li><li>This analysis does not take into account other logistics of opening a school like permits, location scouting etc.</li></ol><p>Whether the school actually opens there or not will require some more work and research, but this analysis does provide a start.</p><p>Here is a link to my notebook detailing the above analysis:</p><ol><li><a href="https://github.com/anandlonkar/Coursera_ML/blob/master/Capstone%20Final%201%20-%20Data%20prep%20.ipynb">Data Prep Notebook</a></li><li><a href="https://github.com/anandlonkar/Coursera_ML/blob/master/Capstone%20Final%202%20-%20Data%20Merges%20and%20Clustering.ipynb">Data Merge and Analysis Notebook</a></li></ol><p>Thanks for reading and do drop a feedback!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5615a7fd4ba7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-experiments-with-data/using-data-science-to-kick-start-market-research-unsupervised-learning-and-clustering-5615a7fd4ba7">Using data science to kick start market research — unsupervised learning and clustering</a> was originally published in <a href="https://medium.com/my-experiments-with-data">My experiments with data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>