<?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 Jagath on Medium]]></title>
        <description><![CDATA[Stories by Jagath on Medium]]></description>
        <link>https://medium.com/@jagathjijo01?source=rss-25a9900e0a8d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XJ-7l3BQny6DwM_jdzTgsQ.png</url>
            <title>Stories by Jagath on Medium</title>
            <link>https://medium.com/@jagathjijo01?source=rss-25a9900e0a8d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:56:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jagathjijo01/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[I used Data Science to feed a college student for $50 a week. It said $8.24 was enough.]]></title>
            <link>https://medium.com/@jagathjijo01/i-used-data-science-to-feed-a-college-student-for-50-a-week-it-said-8-24-was-enough-4d388507dc71?source=rss-25a9900e0a8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d388507dc71</guid>
            <category><![CDATA[food]]></category>
            <category><![CDATA[nutrition]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Jagath]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 21:01:21 GMT</pubDate>
            <atom:updated>2026-09-01T21:01:21.020Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEqqKZtvAy9MPrAM-6tH3g.png" /><figcaption>What a computer sees as optimal isn’t always optimal for us.</figcaption></figure><p><em>Then I had to teach the algorithm what humans actually eat.</em></p><p>College students have a fairly universal problem: food is expensive.</p><p>So I started with what sounded like a simple question:</p><blockquote><strong><em>Can data science be used to build a nutritious college meal plan for under $50 a week?</em></strong></blockquote><p>At first, I imagined this would be straightforward.</p><p>Find grocery prices. Find nutritional information. Combine the datasets. Give an optimization algorithm a $50 budget. Let mathematics figure out what to eat.</p><p>Instead, the project turned into an experiment about messy data, deep learning, optimization loopholes, and the surprisingly difficult question of what makes a meal something a human would actually want to eat.</p><p>And at one point, my algorithm decided that a nutritionally adequate week of food should cost <strong>$8.24</strong>.</p><p>But I’m getting ahead of myself.</p><h3>The Original Idea</h3><p>I wanted the final system to consider three things:</p><p><strong>Cost</strong> — Can a student afford it?</p><p><strong>Nutrition</strong> — Does the diet actually meet reasonable nutritional requirements?</p><p><strong>Preference</strong> — Would someone realistically want to eat these meals?</p><p>Conceptually, I wanted to build:</p><blockquote><strong><em>Price + Nutrition + Human Preference → Optimized College Meal Plan</em></strong></blockquote><p>The first problem was finding the data.</p><h3>Attempt #1: Walmart + Open Food Facts</h3><p>I started with two large public datasets.</p><p>The <strong>Open Food Facts</strong> dataset contained nutritional information for hundreds of thousands of food products.</p><p>The Walmart grocery dataset contained over <strong>568,000 observations</strong>, representing roughly <strong>30,000 unique grocery products</strong> across multiple locations.</p><p>It seemed perfect.</p><p>Walmart could tell me:</p><blockquote><em>“This package costs $3.98.”</em></blockquote><p>Open Food Facts could tell me:</p><blockquote><em>“This food contains X calories, Y grams of protein and Z grams of fiber.”</em></blockquote><p>All I had to do was connect them.</p><p>That turned out to be much harder than expected.</p><h3>Problem #1: The Same Product Rarely Has the Same Name</h3><p>A Walmart listing might look like:</p><blockquote><em>Great Value Old Fashioned Oats, 42 oz</em></blockquote><p>while another database might call the same thing:</p><blockquote><em>Old Fashioned Oats</em></blockquote><p>So I first tried normalized exact matching.</p><p>I converted names to lowercase, removed punctuation, standardized whitespace and matched using brand and product name.</p><p>The result?</p><blockquote><strong><em>1 exact match.</em></strong></blockquote><p>Out of tens of thousands of products.</p><p>Not exactly encouraging.</p><h3>Cleaning the Product Names</h3><p>I improved the normalization.</p><p>Brand names were removed from product titles.</p><p>Package sizes such as:</p><p>42 oz</p><p>were removed.</p><p>Measurement units and standalone numbers were stripped.</p><p>Suddenly:</p><blockquote><strong><em>1 match became 1,131 matches.</em></strong></blockquote><p>About <strong>3.97%</strong> of the relevant Walmart products could now be matched exactly after normalization.</p><p>That was a huge improvement, but still nowhere near enough.</p><p>This was the point where I decided to try deep learning.</p><h3>Can Deep Learning Understand Grocery Products?</h3><p>Instead of asking whether two product names contain exactly the same characters, I wanted to ask:</p><blockquote><strong><em>Do these product descriptions mean the same thing?</em></strong></blockquote><p>I used a pretrained <strong>Sentence Transformer (</strong><strong>all-MiniLM-L6-v2)</strong>.</p><p>The model converts text into a <strong>384-dimensional embedding</strong> representing its semantic meaning.</p><p>As a sanity check, I compared:</p><blockquote><em>Great Value Old Fashioned Oats 42 oz</em></blockquote><p>with:</p><blockquote><em>Old Fashioned Oats</em></blockquote><p>The cosine similarity was:</p><blockquote><strong><em>0.773</em></strong></blockquote><p>Then I compared the oats with:</p><blockquote><em>Chocolate Ice Cream</em></blockquote><p>Similarity:</p><blockquote><strong><em>0.322</em></strong></blockquote><p>The model clearly understood that the first two products were much more closely related.</p><p>Now things were getting interesting.</p><h3>Reducing the Search Space</h3><p>Comparing every Walmart product with every Open Food Facts product would require billions of comparisons.</p><p>Instead, I restricted comparisons to products sharing the same normalized brand.</p><p>Walmart contained:</p><blockquote><strong><em>3,660 brands</em></strong></blockquote><p>Open Food Facts contained:</p><blockquote><strong><em>26,946 brands</em></strong></blockquote><p>Shared brands:</p><blockquote><strong><em>1,821</em></strong></blockquote><p>Nearly half of Walmart’s brands had a corresponding brand in Open Food Facts.</p><p>That gave me:</p><blockquote><strong><em>20,376 Walmart products eligible for semantic matching.</em></strong></blockquote><p>For each product, the Sentence Transformer searched products belonging to the same brand and selected the most semantically similar candidate.</p><p>The results initially looked excellent.</p><p>Examples included:</p><blockquote><em>Le Sueur Very Young Small Sweet Peas, 8.5 oz<br>↔ </em><em>Very Young Small Sweet Peas</em></blockquote><p>Similarity: <strong>0.937</strong></p><p>and:</p><blockquote><em>Barilla Protein+ Elbows Pasta<br>↔ </em><em>Protein Plus, Multigrain Pasta, Elbows</em></blockquote><p>Similarity: <strong>0.891</strong></p><p>The deep-learning model was finding relationships that exact string matching couldn’t.</p><h3>Deep Learning Wasn’t Enough</h3><p>Semantic similarity has an important weakness.</p><p>Consider:</p><blockquote><em>Chocolate Chip Ice Cream</em></blockquote><p>and:</p><blockquote><em>Chocolate Ice Cream</em></blockquote><p>They are semantically extremely similar.</p><p>But they aren’t necessarily the same product.</p><p>The same thing happens with:</p><blockquote><em>strawberry yogurt<br>blueberry yogurt</em></blockquote><p>or:</p><blockquote><em>canned beans<br>dry beans</em></blockquote><p>So I combined the Sentence Transformer with traditional lexical similarity using RapidFuzz.</p><p>Using a manually reviewed validation sample, I tested combinations of semantic and lexical thresholds.</p><p>One useful rule was:</p><blockquote><strong><em>Semantic similarity ≥ 0.80</em></strong><em><br></em><strong><em>Lexical similarity ≥ 0.70</em></strong></blockquote><p>On my small 40-pair validation sample, this accepted 28 candidate matches, of which 26 were judged correct — an estimated precision of approximately <strong>92.9%</strong> on that sample.</p><p>I then scaled the system.</p><p>From <strong>20,376 candidate products</strong>, the hybrid matcher retained:</p><blockquote><strong><em>6,894 high-confidence matches</em></strong></blockquote><p>or:</p><blockquote><strong><em>33.83%</em></strong></blockquote><p>It looked like the problem had been solved.</p><p>It hadn’t.</p><h3>The Black Bean That Broke My Model</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbO9gYNRF4ohU9IvOIaszQ.png" /></figure><p>I began calculating <strong>protein per dollar</strong>.</p><p>The highest-ranked food was:</p><blockquote><strong><em>La Preferida Black Beans, 32 oz</em></strong></blockquote><p>According to my pipeline, it provided:</p><blockquote><strong><em>162.7 grams of protein per dollar.</em></strong></blockquote><p>That seemed suspicious.</p><p>So I inspected the nutritional record the AI had matched.</p><p>The Walmart product:</p><blockquote><em>La Preferida Black Beans, 32 oz</em></blockquote><p>had been connected to:</p><blockquote><em>Black Beans</em></blockquote><p>with:</p><ul><li>Semantic similarity: <strong>0.880</strong></li><li>Lexical similarity: <strong>1.00</strong></li></ul><p>Almost a perfect-looking match.</p><p>But Open Food Facts reported:</p><blockquote><strong><em>23.68 g protein per 100 g</em></strong></blockquote><p>and about:</p><blockquote><strong><em>60.53 g carbohydrates per 100 g</em></strong></blockquote><p>Those values looked much more like <strong>dry beans</strong> than the prepared/canned product I was pricing.</p><p>The AI had correctly understood:</p><blockquote><em>“These are both black beans.”</em></blockquote><p>But my analysis required something much stricter:</p><blockquote><em>“These are nutritionally equivalent forms of the same food.”</em></blockquote><p>They weren’t.</p><p>That gave me one of the most important lessons of the project:</p><blockquote><strong><em>Semantic similarity does not imply nutritional equivalence.</em></strong></blockquote><p>A 93%-ish matching system sounds impressive until the remaining errors attach the nutritional profile of one food form to the price of another.</p><p>So I rejected the entire Walmart/Open Food Facts integration as the foundation for the final optimization.</p><h3>Starting Over With USDA Data</h3><p>Instead of trying to infer food identity from text, I switched to standardized USDA datasets.</p><p>I used <strong>USDA Purchase to Plate National Average Prices (PP-NAP)</strong> for price information and <strong>USDA FNDDS 2017–2018</strong> for nutritional information.</p><p>This changed everything.</p><p>Both datasets use standardized USDA food codes.</p><p>Instead of:</p><blockquote><em>product name → AI → maybe the same food</em></blockquote><p>I now had:</p><blockquote><em>food_code 11111000 → </em><em>food_code 11111000</em></blockquote><p>An exact database join.</p><p>I selected the 2017–2018 PP-NAP cycle available in the dataset:</p><blockquote><strong><em>2017/2018</em></strong></blockquote><p>It contained:</p><blockquote><strong><em>4,435 price records</em></strong></blockquote><p>with <strong>zero missing prices</strong>.</p><p>The corresponding FNDDS nutrition dataset contained:</p><blockquote><strong><em>7,083 foods</em></strong></blockquote><p>and <strong>69 nutritional variables</strong>, including calories, protein, fiber, fat, sodium, potassium, calcium, iron and multiple vitamins.</p><p>When I joined the datasets using their food codes:</p><blockquote><strong><em>4,435 / 4,435 records matched.</em></strong></blockquote><h3>100% merge coverage.</h3><p>After hours of trying to make AI infer whether two product names represented the same food, a standardized identifier solved the problem perfectly.</p><p>Another lesson:</p><blockquote><strong><em>Sometimes better data beats a better model.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYKO-8MOADY5Ud6PHXZ8Kw.png" /></figure><h3>Measuring Nutrition per Dollar</h3><p>The USDA data had another major advantage.</p><p>Prices were already standardized as:</p><blockquote><strong><em>price per 100 grams</em></strong></blockquote><p>and nutrition was also reported per:</p><blockquote><strong><em>100 grams</em></strong></blockquote><p>That meant I could directly calculate metrics such as:</p><blockquote><em>protein per dollar<br>calories per dollar<br>fiber per dollar</em></blockquote><p>The results were fascinating.</p><p>Some of the strongest protein-per-dollar foods included:</p><ul><li>chicken legs and drumsticks</li><li>textured vegetable protein</li><li>peanuts</li><li>grains</li><li>dried/reconstituted milk products</li></ul><p>Fiber-per-dollar rankings heavily favored:</p><ul><li>beans</li><li>split peas</li><li>lentils</li><li>barley</li><li>whole-grain foods</li></ul><p>But calories per dollar revealed another problem.</p><p>The winner?</p><blockquote><strong><em>Corn oil.</em></strong></blockquote><p>Then sugar.</p><p>Then more oil.</p><p>Mathematically, oil is an incredible source of cheap calories.</p><p>Nutritionally, living on corn oil is a terrible idea.</p><p>Clearly, optimizing one nutrient wasn’t enough.</p><h3>Turning Nutrition Into an Optimization Problem</h3><p>I created a standardized college-student scenario using a roughly <strong>2,000-calorie/day reference diet</strong>.</p><p>The weekly model included constraints for:</p><ul><li>calories</li><li>protein</li><li>fiber</li><li>calcium</li><li>iron</li><li>potassium</li><li>vitamin C</li><li>vitamin D</li></ul><p>and upper limits for:</p><ul><li>sodium</li><li>saturated fat</li></ul><p>The grocery budget was:</p><blockquote><strong><em>≤ $50/week</em></strong></blockquote><p>I then used linear programming with <strong>PuLP</strong>.</p><p>Each decision variable represented the number of 100-gram portions of a USDA food consumed during the week.</p><p>The first objective was intentionally simple:</p><blockquote><strong><em>Minimize cost while satisfying every nutritional constraint.</em></strong></blockquote><p>I expected the result to be strange.</p><p>I underestimated the optimizer.</p><h3>Experiment 1: The $8.24 Diet</h3><p>The optimization status came back:</p><blockquote><strong><em>Optimal</em></strong></blockquote><p>Minimum weekly cost:</p><h3>$8.24</h3><p>Apparently, according to mathematics, a college student needed approximately:</p><ul><li><strong>2.20 kg split peas</strong></li><li><strong>1.37 kg dry milk powder</strong></li><li>153 g bran cereal</li><li><strong>424 g corn oil</strong></li><li><strong>867 g fortified fruit-drink powder</strong></li></ul><p>That’s it.</p><p>Five foods.</p><p>And amazingly, it satisfied every constraint I gave it.</p><p>Daily averages were approximately:</p><ul><li><strong>1,900 calories</strong></li><li><strong>97.3 g protein</strong></li><li><strong>28 g fiber</strong></li><li><strong>2,559 mg calcium</strong></li><li><strong>18 mg iron</strong></li><li><strong>4,700 mg potassium</strong></li><li><strong>90 mg vitamin C</strong></li><li><strong>22.3 μg vitamin D</strong></li><li><strong>1,894 mg sodium</strong></li><li><strong>11.9 g saturated fat</strong></li></ul><p>The optimizer had done exactly what I asked.</p><p>The problem was that I had asked the wrong question.</p><p>I had optimized:</p><blockquote><strong><em>How cheaply can nutrition constraints be satisfied?</em></strong></blockquote><p>not:</p><blockquote><strong><em>What would a human being actually want to eat?</em></strong></blockquote><h3>Experiment 2A: Teaching the Algorithm About Food Groups</h3><p>I created a more practical pool of <strong>1,249 foods</strong> divided into six groups:</p><ul><li>protein</li><li>grains and starches</li><li>vegetables</li><li>fruit</li><li>dairy</li><li>nuts and seeds</li></ul><p>Then I required minimum weekly amounts from every group and limited individual USDA food records to 700 grams per week.</p><p>The result:</p><blockquote><strong><em>$19.89/week</em></strong></blockquote><p>Much better.</p><p>The basket now contained 23 food records and all six food groups.</p><p>Daily averages included:</p><ul><li><strong>1,900 calories</strong></li><li><strong>89.5 g protein</strong></li><li><strong>49.8 g fiber</strong></li><li><strong>1,300 mg calcium</strong></li><li><strong>18 mg iron</strong></li><li><strong>4,700 mg potassium</strong></li><li><strong>132 mg vitamin C</strong></li><li><strong>20 μg vitamin D</strong></li></ul><p>Still nutritionally valid.</p><p>But the optimizer found another loophole.</p><p>It selected:</p><blockquote><em>milk<br>another kind of milk<br>another milk<br>another milk…</em></blockquote><p>It also treated raw banana and fried banana as separate forms of variety.</p><p>Technically, they were different database records.</p><p>Practically, they weren’t meaningful dietary variety.</p><p>That produced another lesson:</p><blockquote><strong><em>Database-record diversity is not dietary diversity.</em></strong></blockquote><h3>Could User Ratings Teach the Algorithm What People Like?</h3><p>Nutrition and price weren’t enough.</p><p>So I introduced a third dataset:</p><blockquote><strong><em>Food.com Recipes and User Interactions</em></strong></blockquote><p>The dataset contained more than <strong>226,000 recipes</strong> along with real user ratings and reviews.</p><p>Instead of assuming that college students enjoy particular foods, I wanted observed preference data.</p><p>I filtered invalid/zero ratings and aggregated ratings for each recipe.</p><p>But average rating alone creates another problem.</p><p>A recipe rated:</p><blockquote><em>⭐ 5.0 by one person</em></blockquote><p>shouldn’t necessarily outrank:</p><blockquote><em>⭐ 4.8 by 1,000 people.</em></blockquote><p>So I calculated a <strong>Bayesian weighted preference score</strong>, pulling recipes with very few ratings toward the global average while trusting heavily reviewed recipes more.</p><p>Then I defined “college-friendly” recipes using transparent rules:</p><ul><li>at least 20 ratings</li><li>≤60 minutes preparation time</li><li>3–15 ingredients</li><li>tagged as main-dish or lunch</li><li>not primarily dessert</li></ul><p>Food.com tags also provided useful indicators such as:</p><ul><li>easy</li><li>inexpensive</li><li>beginner-cook</li><li>healthy</li><li>to-go</li><li>30-minutes-or-less</li></ul><p>After filtering, I found:</p><blockquote><strong><em>481 popular, inexpensive, college-friendly meal candidates.</em></strong></blockquote><p>Now I had actual evidence about what combinations of foods people tended to rate highly.</p><h3>Experiment 2B-v1: Another Optimizer Loophole</h3><p>My first attempt at incorporating preferences directly into the optimizer rewarded foods according to how frequently their ingredients appeared in popular Food.com recipes.</p><p>The model happily spent the entire:</p><blockquote><strong><em>$50</em></strong></blockquote><p>and selected:</p><blockquote><strong><em>35 different food categories.</em></strong></blockquote><p>Sounds great.</p><p>Except it bought ridiculous amounts of milk again.</p><p>Why?</p><p>Milk appears in thousands of recipes.</p><p>The model interpreted:</p><blockquote><em>“Milk frequently appears in popular recipes”</em></blockquote><p>as:</p><blockquote><em>“Consume as much milk as possible.”</em></blockquote><p>That is not the same thing.</p><p>Yet another lesson:</p><blockquote><strong><em>Ingredient popularity is not proportional to desirable consumption quantity.</em></strong></blockquote><p>So I separated the two systems.</p><p>USDA would determine:</p><blockquote><strong><em>What nutritional ingredients make economic sense?</em></strong></blockquote><p>Food.com would determine:</p><blockquote><strong><em>What appealing meals can those ingredients form?</em></strong></blockquote><p>That turned out to be a much cleaner architecture.</p><h3>Experiment 2B-v2: Genuine Variety</h3><p>I introduced binary category-selection variables and turned the optimization into a mixed-integer problem.</p><p>A food category only counted toward variety if the plan actually consumed a meaningful amount from that category.</p><p>I required:</p><ul><li>at least 3 protein categories</li><li>at least 3 grain/starch categories</li><li>at least 4 vegetable categories</li><li>at least 3 fruit categories</li><li>at least 2 dairy categories</li><li>at least 1 nuts/seeds category</li></ul><p>The entire diet had to contain between:</p><blockquote><strong><em>16 and 20 distinct USDA food categories</em></strong></blockquote><p>while still meeting all nutritional requirements.</p><p>The result:</p><h3>$20.60/week</h3><p>with:</p><blockquote><strong><em>18 distinct food categories</em></strong></blockquote><p>and all six major food groups.</p><p>The final nutritional framework averaged approximately:</p><ul><li><strong>1,900 calories/day</strong></li><li><strong>100.0 g protein/day</strong></li><li><strong>43.6 g fiber/day</strong></li><li><strong>1,300 mg calcium/day</strong></li><li><strong>18 mg iron/day</strong></li><li><strong>4,700 mg potassium/day</strong></li><li><strong>121 mg vitamin C/day</strong></li><li><strong>20 μg vitamin D/day</strong></li><li><strong>1,614 mg sodium/day</strong></li><li><strong>16.0 g saturated fat/day</strong></li></ul><p>And it still left:</p><blockquote><strong><em>$29.40 of the $50 budget unused.</em></strong></blockquote><p>Again, an important caveat: these are based on <strong>historical 2017–2018 USDA national-average prices</strong>, not a claim that the same basket costs $20.60 at a supermarket in 2026.</p><h3>Finally: Turning Nutrients Into Meals</h3><p>The optimizer now gave me a nutritional ingredient framework.</p><p>But nobody wants a spreadsheet for dinner.</p><p>So I compared the selected ingredient categories with the <strong>481 highly rated, inexpensive Food.com recipes</strong>.</p><p>Recipes were ranked according to:</p><ul><li>user preference score</li><li>preparation practicality</li><li>ingredient-keyword overlap with the optimized basket</li></ul><p>This finally produced recognizable food.</p><p>Some of the strongest matches included:</p><h3>Creamy Chickpea Curry</h3><ul><li><strong>25 minutes</strong></li><li>⭐ <strong>4.97</strong></li><li>ingredient overlap: chickpeas/peas, milk, rice, soy-related ingredients</li></ul><h3>Chicken Pineapple Stir-Fry</h3><ul><li><strong>22 minutes</strong></li><li>⭐ <strong>4.66</strong></li><li>strong overlap with pineapple, rice, corn and soy-based ingredients</li></ul><h3>Vegetarian Taco Salad</h3><ul><li><strong>15 minutes</strong></li><li>⭐ <strong>4.88</strong></li><li>beans, corn and greens</li></ul><h3>Easy Chicken Chow Mein</h3><ul><li><strong>30 minutes</strong></li><li>⭐ <strong>4.83</strong></li></ul><h3>Easy Fried Rice</h3><ul><li><strong>30 minutes</strong></li><li>⭐ <strong>4.66</strong></li><li>rice, peas and soy</li></ul><h3>Peanut Butter + Banana Burrito</h3><ul><li><strong>5 minutes</strong></li><li>⭐ <strong>4.88</strong></li></ul><h3>Creamy Chickpea Curry, bean bowls, vegetable rice dishes and peanut-based noodle meals</h3><p>all naturally emerged as useful meal structures.</p><p>For the final plan, these recipes are <strong>inspiration</strong>, not sources of nutritional values. USDA remains the source of truth for the nutritional and economic calculations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnD7jzpTyLHeT5ooVetW6w.png" /></figure><h3>So, Can Data Science Feed a College Student for Under $50?</h3><p>According to this experiment:</p><blockquote><strong><em>Yes — very easily, at least under the historical USDA price assumptions.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91Ibam39uUzNIIBv8JWulg.png" /></figure><p>But that turned out to be the least interesting finding.</p><p>The progression looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cwgfu9Y3YxZkD7NecL2WNg.png" /></figure><p>The biggest challenge wasn’t finding enough calories for $50.</p><p>It wasn’t even finding enough protein.</p><p>The hard part was teaching the model the difference between:</p><blockquote><strong><em>a mathematically valid diet</em></strong></blockquote><p>and</p><blockquote><strong><em>food a person might realistically eat.</em></strong></blockquote><h3>What I Learned</h3><p>This project started as a meal-planning problem.</p><p>It became a lesson in data science.</p><h3>1. Better models cannot always rescue incompatible data.</h3><p>My Sentence Transformer successfully understood product meaning, but semantic similarity wasn’t strong enough to guarantee nutritional equivalence.</p><h3>2. Validation matters more than impressive metrics.</h3><p>“6,894 high-confidence AI matches” sounded great.</p><p>One suspicious can of black beans revealed a systematic weakness in the methodology.</p><h3>3. Better identifiers can beat deep learning.</h3><p>After experimenting with embeddings, fuzzy matching and threshold tuning, USDA’s standardized food_code produced a <strong>100% exact merge</strong>.</p><p>Sometimes the smartest model is no model at all.</p><h3>4. Optimizers exploit your assumptions.</h3><p>Every time I wrote an imperfect rule, the optimizer found it.</p><p>Limit individual foods?</p><p>It selected multiple database versions of the same food.</p><p>Reward popular ingredients?</p><p>It tried to buy enormous quantities of milk.</p><p>Tell it only to satisfy nutrition?</p><p>It invented the $8.24 split-pea-and-corn-oil diet.</p><h3>5. Human preference is a different kind of data.</h3><p>Nutrition can be measured.</p><p>Price can be measured.</p><p>“Would someone actually enjoy eating this?” is much harder.</p><p>Recipe ratings gave me a useful proxy, but they still couldn’t perfectly represent the preferences of every college student.</p><h3>The Most Important Result</h3><p>I originally expected the project to answer:</p><blockquote><strong><em>“What should a college student eat for $50?”</em></strong></blockquote><p>Instead, the more interesting question became:</p><blockquote><strong><em>“What happens when you ask an algorithm to understand something as human as a meal?”</em></strong></blockquote><p>The computer was extraordinarily good at satisfying inequalities.</p><p>It was much worse at understanding dinner.</p><p>And perhaps that’s the real lesson.</p><p><strong>Data science can optimize what we can measure.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1MjATZm9UwKzg-O66azYog.png" /></figure><p>The difficult part is deciding whether what we’ve measured actually represents what we care about.</p><p>📂 <strong>GitHub Repository:</strong> The complete code, datasets, and resources for this project are available on <a href="https://github.com/jahgath/College-Meal-Plan-Data-Mining">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d388507dc71" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>