<?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 Huayi Wei on Medium]]></title>
        <description><![CDATA[Stories by Huayi Wei on Medium]]></description>
        <link>https://medium.com/@huayiweicodes?source=rss-9e67eb9f9000------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*D4mIOCHLMXuelcM1ltsOXQ.png</url>
            <title>Stories by Huayi Wei on Medium</title>
            <link>https://medium.com/@huayiweicodes?source=rss-9e67eb9f9000------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:14:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@huayiweicodes/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[What Building an Agentic Homebuying Tool Taught Me About Reliable AI Systems]]></title>
            <link>https://medium.com/@huayiweicodes/what-building-an-agentic-homebuying-tool-taught-me-about-reliable-ai-systems-70906b7a28e3?source=rss-9e67eb9f9000------2</link>
            <guid isPermaLink="false">https://medium.com/p/70906b7a28e3</guid>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[home-buying]]></category>
            <category><![CDATA[personal-finance]]></category>
            <dc:creator><![CDATA[Huayi Wei]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 03:23:43 GMT</pubDate>
            <atom:updated>2026-08-12T18:16:34.240Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>How I divided the authority between AI agents, deterministic Python, and the user</em></h4><p>In <a href="https://medium.com/@huayiweicodes/what-building-an-agentic-homebuying-tool-taught-me-ea06872b86aa">the first article in this series</a>, I showed how Groundwork connects property research, evidence review, financial modeling, and follow-up scenarios.</p><p>To the user, this can feel like one continuous conversation. Underneath it are several different reliability problems:</p><ul><li><strong>Research is open-ended</strong>. Sources may conflict or omit critical facts.</li><li><strong>Financial calculations must be reproducible</strong>. A mortgage balance should not change with phrasing.</li><li><strong>Consequential assumptions require human judgment</strong>. A model should not quietly decide whether an assumption is sufficient for a conclusion.</li><li><strong>Saved results must remain explainable and reusable</strong>. Users need to understand what produced an earlier result and know whether it still applies when circumstances change.</li></ul><p>Building Groundwork turned reliability into a question of authority:</p><blockquote><strong><em>Who should control each part of the decision, and how should the system enforce those boundaries?</em></strong></blockquote><p>I divided the system among three owners: the user, the AI agent, and deterministic Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TDBCRQIv5L0jfW7b4eBXeg.png" /><figcaption>The agent handles open-ended research and interaction. The user reviews consequential assumptions. Python controls what enters the model, performs the calculations, and preserves the resulting decision state.</figcaption></figure><p>This division of responsibility led to three design principles for building a reliable AI system.</p><h3>Design Principle 1: Use agents for ambiguity and code for rules</h3><p>An agent is useful when the exact path cannot be fully specified in advance. It can research a listing, explain an unfamiliar cost, notice missing information, and interpret follow-up questions.</p><p>Financial calculations require a different standard. A language model can skip a step or apply a formula inconsistently, then explain the result so fluently that the error is difficult to notice. Groundwork therefore keeps mortgage amortization, closing costs, taxes, and long-term projections in explicit, testable Python.</p><p>Anthropic describes the underlying tradeoff in <a href="https://www.anthropic.com/engineering/building-effective-agents">Building Effective AI Agents</a>:</p><blockquote><em>“Workflows offer predictability and consistency for well-defined tasks, whereas agents are the better option when flexibility and model-driven decision-making are needed at scale.”</em></blockquote><p>The important part was <strong>turning that distinction into an enforceable system boundary</strong>. In Groundwork, this happens at the tool boundary. The agent calls Python functions to prepare and analyze a listing rather than constructing financial outputs in the conversation.</p><p>Before calculation begins, typed data contracts validate the listing, buyer profile, and evidence. Malformed values are rejected, while readiness checks stop the analysis when required information remains missing or unresolved. Groundwork implements these contracts with Pydantic.</p><p>Once the inputs are ready and approved, the financial engine applies explicit rules for mortgage amortization, closing costs, taxes, long-term projections, and stress scenarios. Given the same approved inputs and rule versions, it produces the same result.</p><p>The results are assembled into one structured record containing the approved inputs, supporting evidence, monthly costs, amortization, tax effects, long-term projections, and stress scenarios. Groundwork calls this the <em>ListingReport</em>. Both the saved JSON and the reader-facing report are generated from that same record, so the presentation layer cannot quietly recalculate or alter the result.</p><p>This separation allows the conversational experience to evolve without changing the financial logic.</p><h3>Design Principle 2: Good decision tools make uncertainty visible</h3><p>Keeping the calculations in Python solves only part of the reliability problem. <strong>In real estate, important inputs are not always available from structured data or online research</strong>. Assessments, tax abatements, operating costs, and rental restrictions may require manual confirmation, while an estimate such as comparable rent may also draw on a buyer’s or broker’s knowledge of the building and neighborhood.</p><p>Groundwork preserves the source and uncertainty around each input instead of collapsing it into a single number. A value may be verified from a source, supplied by the buyer, estimated from market evidence, derived by the calculator, or marked as needing manual review.</p><p>A value can therefore include a base estimate, a low and high range, a confidence assessment, linked sources, and the method used to produce it. A comparable-rent estimate might look like this:</p><pre>{<br>  &quot;value&quot;: 5200,<br>  &quot;low&quot;: 4900,<br>  &quot;high&quot;: 5500,<br>  &quot;confidence&quot;: &quot;medium&quot;,<br>  &quot;sources&quot;: [<br>    &quot;Comparable rental listing 1&quot;,<br>    &quot;Comparable rental listing 2&quot;,<br>    &quot;Comparable rental listing 3&quot;<br>  ],<br>  &quot;method&quot;: &quot;Similar units by location, size, bedrooms, and amenities&quot;<br>}</pre><p>For ranged inputs, Python recalculates the analysis at both bounds. Groundwork then checks whether either value changes the feasibility classification, scenario severity, monthly cost, upfront cash, breakeven timing, or projected ten-year ownership advantage.</p><p>For example, a change is material if it shifts monthly cost by at least $100, upfront cash by at least $2,500, breakeven by at least two years, or ten-year ownership advantage by at least $25,000. These are prototype thresholds, but making them explicit is important. The system should explain why an uncertainty requires attention rather than relying on a vague confidence label.</p><p>Some gaps stop the analysis entirely. An unusually low NYC property-tax bill may indicate an abatement, incomplete data, or an error. Without enough evidence to explain it, Groundwork will not silently project that amount across the analysis.</p><p>A reliable system should show both what remains uncertain and whether that uncertainty could change the decision.</p><h3>Design Principle 3: Preserve decision context, not just the answer</h3><p>Homebuyers rarely evaluate a property only once. They revisit earlier analyses as new information emerges. A buyer might analyze a property in March, then return to it in June after mortgage rates change or the building discloses an assessment. The earlier result remains useful only if its original inputs are clear and any new analysis can reflect what has changed. My goal was to let buyers revisit a decision without confusing earlier assumptions with current ones.</p><p>Groundwork supports this in two ways:</p><p><strong>First, it preserves the decision state behind each result</strong>. Groundwork saves the inputs, evidence, estimate ranges, and user approval as one snapshot. A SHA-256 fingerprint binds that approval to the exact information reviewed. If a mortgage rate, assessment, or other calculation-relevant input changes, the system keeps the earlier analysis intact but requires the revised analysis to be reviewed and approved separately.</p><p>S<strong>econd, Groundwork versions the methods used to produce the result</strong>. The same inputs can yield a different answer after financial logic, tax rules, or workflow requirements change. Versioning makes that difference explainable and identifies which analyses need to be recalculated.</p><p>Before comparing saved analyses, Groundwork reconstructs each report from its stored inputs and rejects legacy, unconfirmed, or internally inconsistent results. Even two valid reports may use different rates, horizons, or market assumptions. Those differences must be aligned or made visible.</p><p><strong>Reliable outputs need both: a preserved decision snapshot and a record of the methods that produced it.</strong></p><h3>So, what does reliability mean in an agentic system?</h3><p>Building Groundwork changed how I think about reliable AI. The goal is not to rely on a language model to be correct at every step. It is to design a system that assigns each task to the right owner, exposes uncertainty, and preserves the context behind every result.</p><p>In Groundwork, the agent explores incomplete information and helps the user ask better questions. Python validates inputs and performs the calculations. The user decides which evidence and assumptions are acceptable.</p><p>That led me to a practical definition:</p><blockquote><strong>Reliability in an agentic system means pairing flexible investigation with verifiable results.</strong></blockquote><p>Groundwork remains a personal prototype, not a validated financial product. But this pattern extends beyond this project. Real estate is full of consequential workflows that combine fragmented evidence, formal calculations, and human judgment. Agents can make those workflows easier to navigate while keeping the basis of each result open to inspection.</p><p>This article has focused on making Groundwork reliable in use. The next question is how to build such a system reliably in the first place. Tests, evaluations, and adversarial review can expose gaps in an implementation that initially appears complete. I plan to explore that side of the work in the next article.</p><p>I’m exploring partnerships with real estate leaders and builders who are working on similar problems<strong>.</strong> If you are building in this space, <a href="https://www.linkedin.com/in/huayiwei/">connect with me on LinkedIn</a>.</p><p><em>I used an AI writing assistant to help edit this article. The project experience, analysis, and conclusions are my own.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70906b7a28e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents for Homebuying: From Property Research to Financial Scenarios]]></title>
            <link>https://medium.com/@huayiweicodes/what-building-an-agentic-homebuying-tool-taught-me-ea06872b86aa?source=rss-9e67eb9f9000------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea06872b86aa</guid>
            <category><![CDATA[home-buying]]></category>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[agentic-ai-architecture]]></category>
            <dc:creator><![CDATA[Huayi Wei]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 13:47:31 GMT</pubDate>
            <atom:updated>2026-08-15T18:10:31.856Z</atom:updated>
            <content:encoded><![CDATA[<h4>How I used AI agents to connect fragmented research, financial modeling, and follow-up scenarios</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJBTPQYlv0u8H0hDy93L0g.png" /></figure><p>If you have ever looked into buying a home in NYC, you know the drill. The price tag is just the opening act. Just when you have recovered from discovering the $2,000+/month HOA, along come the mansion tax, closing costs, tax abatements, and a growing list of things you did not know you were supposed to worry about.</p><p>I kept coming back to the same questions<strong>: Does buying this property actually make financial sense for me? Why not just keep renting?</strong></p><p>Answering those seemingly simple questions took much more work than I expected. I spent whole afternoons researching neighborhood appreciation and comparable rents, learning how closing costs and tax rules worked, and rerunning a seven-tab spreadsheet while a small colony of browser tabs multiplied in the background.</p><p>Although there were plenty of articles and calculators online, I still had to piece together the research and calculations myself.</p><p>That’s when I started building <strong>Groundwork</strong>–an agentic homebuying tool.</p><h3>Why wasn’t a mortgage calculator enough?</h3><p>A mortgage calculator is only helpful for estimating monthly mortgage payments, which is only a small part of what I wanted to know. I also wanted to understand:</p><ul><li>What the home would actually cost after taxes, insurance, HOA fees, and maintenance?</li><li>How much cash I would need at closing?</li><li>If I put the down payment into the stock market instead, would I be better off in the long run?</li><li>If I had to sell in three years, how much financial risk would I be taking?</li></ul><p>As I worked through these questions, I kept finding costs I had not accounted for. Closing costs varied between New York and New Jersey, while an unusually low property-tax bill could reflect a temporary abatement. Each discovery changed the analysis and sent me back to do more research.</p><h3>Could AI agents connect the pieces?</h3><p>The agentic system proved useful by helping connect the steps I had been doing manually. I could start with a listing and ask questions as they come up. The agents autonomously research the property or explain any unfamiliar costs.</p><p>The agents then organize what they find into facts, estimates, and assumptions for me to review. Once I approve the inputs, the agents decide which tools to call to run the financial model. I can ask follow-up questions, test a different scenario, and repeat the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ijAMq8SP7YxI7Xaj4ZpMdA.png" /><figcaption><strong>Groundwork’s human-in-the-loop workflow: </strong>the system researches and models a listing, while the buyer reviews the evidence, approves the inputs, and iterates on scenarios.</figcaption></figure><p>Consider a synthetic two-bedroom Brooklyn condo listed for <strong>$895,000</strong>. The buyer has <strong>$315,000 in available cash</strong> and wants to keep monthly housing costs below <strong>$6,500</strong>.</p><p>The buyer drops in the listing URL and asks:</p><blockquote>Can I afford this home, and how does buying compare with continuing to rent?</blockquote><p>Groundwork researches the property and assembles the inputs behind the comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*km4567hjKvkWIkTHxqr8Xw.png" /></figure><p>The listing’s $3,600 tax bill reflects an abatement expiring in 2033, so Groundwork models the current and post-abatement taxes separately to estimate the costs of ownership beyond 2033.</p><p>After the buyer reviews the inputs, Groundwork compares two paths:</p><ol><li><strong>The buying path</strong> includes the down payment, closing costs, monthly ownership expenses, future sale value, and the eventual increase in taxes once the abatement expires</li><li><strong>The renting path</strong> includes future rent and the growth of money that remains invested instead of going into the purchase, which captures the opportunity cost of buying</li></ol><p>To estimate the federal tax savings due to the mortgage, Groundwork uses a synthetic profile with $290,000 in household income, married filing jointly, a 32% federal marginal rate, and $26,000 of existing SALT usage. It counts only the additional benefit created by owning, after accounting for the deductions the buyer already receives.</p><p>Under the baseline assumptions, the model estimates:</p><ul><li>Monthly ownership cost before tax benefits: $5,511</li><li>Buyer closing costs: $21,834</li><li>Cash remaining after purchase: approximately $73,000</li><li>Pre-tax rent-versus-buy breakeven: approximately year 6</li><li>Estimated federal tax savings in year 1: approximately $12,300</li></ul><p>In the current version, Groundwork reports breakeven before tax to keep the financial comparison separate from the buyer’s personal tax situation.</p><p>The tax benefit is recalculated each year under the same versioned 2026 rules. Mortgage interest declines as the loan is repaid. In this example, the expiring tax abatement later increases both the property-tax bill and its potential deduction, but the deduction offsets only a fraction of the additional cost.</p><p>The result is also sensitive to income and existing deductions. For newer mortgages, deductible interest is generally limited to the first $750,000 of qualifying debt. The 2026 SALT cap is $40,400 and begins phasing down above $505,000 of modified adjusted gross income. A higher marginal rate therefore does not automatically mean greater tax savings. Groundwork therefore treats tax savings as a year-by-year estimate, not a permanent reduction in monthly cost.</p><p>Beyond the baseline, the model stress tests alternative scenarios. For example, if the buyer needs to sell in year three and the market stays flat, buying would leave them approximately <strong>$129,000 worse off than renting</strong>.</p><p>The buyer can then continue the conversation:</p><blockquote>What if I put less money down and keep more cash?</blockquote><p>That single change ripples through the entire model, affecting the mortgage, closing cash, monthly payments, and money available to invest. Groundwork reruns the model with the new inputs and can compare the different scenarios side by side.</p><p>Other questions follow naturally: What if the holding period is only five years? What if comparable rent is lower than expected? How sharply do costs rise when the tax abatement expires?</p><p>I needed to explore all of these questions before I could feel comfortable with the decision. Groundwork let me test each scenario and learn how the numbers came about.</p><h3>Conclusion</h3><p>Groundwork remains a personal prototype, but this example captures what I had been missing. I did not need another standalone calculator. I needed a way to keep the property research, assumptions, financial model, and follow-up questions connected as my understanding changed.</p><p>Building that workflow raised a different set of questions. Which tasks should belong to an AI agent? Which calculations should remain in Python? How can the system remain flexible without making unreliable results look authoritative?</p><p>In the <a href="https://medium.com/@huayiweicodes/what-building-an-agentic-homebuying-tool-taught-me-about-reliable-ai-systems-70906b7a28e3?sharedUserId=huayiweicodes">next article</a><strong>, </strong>I will share what building Groundwork taught me about connecting AI agents with deterministic financial tools.</p><p><strong>I’m exploring partnerships with real estate leaders and builders who are working on similar buyer workflows. </strong>If this aligns with your work, <a href="https://www.linkedin.com/in/huayiwei/">connect with me on LinkedIn</a>.</p><p><em>Note: I used an AI writing assistant to help edit this article. The project experience, analysis, and conclusions are my own.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea06872b86aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Not-so-social-parks: predicting suitable times to visit parks while observing social…]]></title>
            <link>https://medium.com/insight-data/not-so-social-parks-predicting-suitable-times-to-visit-parks-while-observing-social-777c0be06497?source=rss-9e67eb9f9000------2</link>
            <guid isPermaLink="false">https://medium.com/p/777c0be06497</guid>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[socialdistancing]]></category>
            <category><![CDATA[insight-data-science]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Huayi Wei]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 16:09:03 GMT</pubDate>
            <atom:updated>2020-06-02T16:09:03.225Z</atom:updated>
            <content:encoded><![CDATA[<h3>Not-so-social-parks: predicting suitable times to visit parks while observing social distancing</h3><p><em>This article was co-authored by Huayi Wei, Isabel Urrutia, Eric Epstein, and Ed Kramkowski.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*4AWLAEbB4H53S3-2Y_a92g.png" /></figure><p>Among the many frustrations created by COVID-19, there is one question that bothers all park-goers: <strong>what is the best time to visit the park and to avoid crowds?</strong> Shortly after the lockdown began in New York City, we — four Insight Data Science Fellows — started working on a tool that Brooklynites can use to identify safe times to exercise in Prospect Park.</p><p>In the ensuing month and a half, we worked under intense time pressure to develop this time-sensitive idea into the fully functioning web app — <a href="http://not-so-social-parks.space/">not-so-social-parks.space</a>. In this post, we’ll share how<strong> teamwork and citizen science made our project possible</strong>.</p><p>We will walk you through how we explored what data to use for making predictions, and how we gathered data to label our dataset. We will then explain how we stretched our small dataset to generate a workable dataset, and how we performed feature selection and feature engineering. Lastly, we will talk about the design of our front end and back end.</p><p><em>More technical details and our code are available on </em><a href="https://github.com/four-insightfellows-corona-project/social_distancing"><em>Github</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*Pac359r-ayn4gMzV" /></figure><h3>Has Google already solved the problem?</h3><p>The first solution we thought of was the “popular times” feature on Google maps. Can these live reports on popularity tell us if the park is too crowded?</p><p>Not quite. In a small “popular times” dataset that we labeled with images taken from the park, we found <strong>a large overlap between “safe” and “not safe” data points</strong>. One possible explanation is that “popular times” captures motor traffic from the nearby streets, not just foot traffic inside the park. Given that, “popular times” alone will be ambiguous. To build a more accurate model, we decided to incorporate a diversity of data types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*_fBvbVXm9h6MFkq5" /></figure><h3>Building our dataset</h3><p>After some explorations, we discovered that weather, day of the week, and time of the day also have significant effects on park activities. To develop our final model, we supplemented the “popular times” data with data from additional sources.</p><p>Our team member Ed set up automatic web scrapers for weather data and popular times data. He housed the data in a SQL database and started assembling the back-end systems that would be the backbone of our model.</p><p>However, without any established method to label the park as “safe” or “not safe” for social distancing, we had to develop our own. To get close to the ground truth fast, we leveraged the power of teamwork and took a multi-front approach. We collected three types of data to label our dataset:</p><ul><li><strong>Images of the park</strong>. As we had no access to data from webcams or satellites, we literally had our team member Huayi take photos from her roof that overlooks Prospect Park, every hour from 7 am to 8 pm. We then manually labeled the photos based on how much crowding we observed in the photographs. Although this data was more accurate, she only lasted a week. <em>“I got so fit that week climbing up 4 floors of stairs every hour</em>,” she later recalled.</li><li><strong>Tweets.</strong> Meanwhile, Eric came to the rescue by using Tweepy and GetOldTweets to collect tweets related to Prospect Park. After filtering out bot-generated material, he manually sifted through the hundreds left to find any relevant tweets. Many were entertaining, a few were useful, and a handful, such as this one, were both: <em>“It’s nice for one day and just look at these a**holes not social distancing! Can we please just close the parks, because obviously Brooklyn isn’t getting the message. #stupidbrooklyn #whatcurve @Prospect Park”</em></li><li><strong>Survey responses</strong>. What exactly constitutes a “safe” condition for social distancing can be a subjective matter. To account for this subjectivity, we <strong>turned to citizen science</strong>, broadening our input to include live opinions from park-goers. Experienced in survey design, Isabel quickly designed and deployed a <a href="https://bit.ly/socialprospectpark">questionnaire</a>. Responses started rolling in as we distributed it on Reddit, Twitter, running clubs, and neighborhood Facebook groups.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ObSCt9rxgnJ73OXD" /><figcaption>An example image of Prospect Park taken from Huayi’s roof</figcaption></figure><h3>Training a model with very limited data</h3><p>After a month of data-gathering, we obtained <strong>a dataset with 157 labeled data points, far from enough</strong>. To generate a workable dataset, we assigned each label to a 15-minute time-bin. As crowds in the park take time to build up and disseminate, we assumed that one time-bin before and two time-bins after a labeled time-bin had the same label. We then filled any missing time-bins with averages of the surrounding labeled time-bins. <strong>The final dataset reached 515 labeled time points from 7am-8pm across 31 days.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*FFjiyt33LoUhm6b8ygF5SA.png" /><figcaption>Fill the missing time-bin with the averaged labels of adjacent time-bins</figcaption></figure><p>Feature selection on this small dataset was not a straightforward task. The weather data alone had <strong>30 highly correlated features</strong>. The changing seasons also meant that <strong>a model trained with absolute weather data would adapt poorly</strong> as NYC transitioned from March to June.</p><p>Keeping these concerns in mind, we carefully <strong>distilled 28 of the 30 weather features into 3 new categorical features</strong>: “good”, “bad”, and “maybe”. “Good” weather is a clear sunny day, inviting people to embrace the outdoors. “Bad” weather is an overcast or stormy day, keeping people inside. These intuitive categories not only capture the essence of our data, but are also robust to seasonal changes. We left 2 weather features untouched: temperature and wind-speed.</p><p>Our final model was <strong>a Random Forest Classifier trained on a dataset with only 8 features</strong>, including 5 weather features, the “Popular Times” data, the day of the week, and the hour of the day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*ALqPqcJrrU6nThVM" /><figcaption>AUC: 0.858</figcaption></figure><h3>A user-friendly front end</h3><p>To make our web app accessible to the public, we laid out our results sequentially, with <strong>the most actionable takeaway at the top of the page</strong>. A “thumbs up”/ “thumbs down” represents our current prediction on whether it’s safe to work out in the park. This is followed by a heatmap that visualizes the average risk levels per hour per day, to help those who want to plan ahead. Other data, such as more detailed predictions and tweets, are hidden under toggle buttons, easily available to any curious individuals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/0*9EoqLw9ZB0KuDAE_" /></figure><h3>An efficient pipeline</h3><p>Under the hood, our project is powered by AWS. <strong>EC2 instances and CRON jobs are the master commanders.</strong> All data stream into a PostgreSQL database. Every 15 minutes, the latest data is pulled into an S3 bucket, which the model uses to spit out a new prediction to the same S3 bucket. The front end fetches the new prediction and updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J0Ggwy4wmxlnVxIa" /></figure><h3>Continuously monitor model performance</h3><p>One factor that our static model couldn’t capture was ever-changing human behavior. The ups and downs of COVID-19 policies can easily disrupt the implicit relationships between the data and the predictions.</p><p>To monitor model performance, we once again turned to the public for help. On our web app, we <strong>constantly collect user feedback</strong> on the accuracy of our model. The feedback is piped to the backend, compared with our standing predictions, and used to retrain our model.</p><h3>Conclusion</h3><p>Hard times call for strong teamwork. Our collaborations enabled us to simultaneously collect data from multiple sources, and parallelize the construction of our front end and back end. As we pooled our wisdom and skills to generate creative solutions, we accelerated towards our product and completed it on time. But in the end, our team was not limited to the four of us. Without civic-minded Brooklynites, we wouldn’t have quickly gathered our data. Without the Insight community, our product would have lost the precious feedback at every step along the way. Hard times demand everyone to work as a team.</p><p><strong><em>Interested in seeing more content like this?</em></strong><em> </em><a href="https://notify.insightdatascience.com/notify"><em>Sign up</em></a><em> for our newsletter, and get updates on the latest resources and upcoming events.</em></p><h3>Authors</h3><p><a href="https://www.linkedin.com/in/huayiwei/"><em>Huayi Wei</em></a><em> is a big fan of Prospect Park. She holds a Ph.D. in Neuroscience. At Insight, she built a BERT-based named-entity-recognition model to automate the process of documenting art auction records. She is a brilliant communicator with a background in science writing.</em></p><p><a href="https://www.linkedin.com/in/isabel-urrutia/"><em>Isabel Urrutia</em></a><em> is a Ph.D. candidate in Geography &amp; Planning, and holds a Master of Mathematics, a Master of Environmental Studies, and a Bachelor of Mathematics. At Insight, Isabel consulted for a workplace analytics company, and built out their core product by adding features that incorporate recommendations using linear optimization.</em></p><p><a href="http://www.linkedin.com/in/eric-epstein5747"><em>Eric Epstein</em></a><em> earned a Ph.D. in Philosophy and, before that, a B.A. in Mathematics and Philosophy, all from Cornell University. As an Insight Fellow, he consulted for a major beer manufacturer, helping them sell more beverages through their smartphone app by using gradient boosted trees to identify better ways to engage app users.</em></p><p><a href="https://www.linkedin.com/in/e-kramkowski/"><em>Ed Kramkowski</em></a><em> is a Ph.D. candidate in Physics. At Insight, he built a recommendation system that helps podcasters grow their audience by analyzing podcasts’ audience interests and recommending ideal advertising and collaboration strategies.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=777c0be06497" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insight-data/not-so-social-parks-predicting-suitable-times-to-visit-parks-while-observing-social-777c0be06497">Not-so-social-parks: predicting suitable times to visit parks while observing social…</a> was originally published in <a href="https://medium.com/insight-data">Insight</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>