<?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 Anthony Rentsch on Medium]]></title>
        <description><![CDATA[Stories by Anthony Rentsch on Medium]]></description>
        <link>https://medium.com/@anthony.rentsch?source=rss-e8fe8e4172c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*z1su28dxQcUgjiGg</url>
            <title>Stories by Anthony Rentsch on Medium</title>
            <link>https://medium.com/@anthony.rentsch?source=rss-e8fe8e4172c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 07:51:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anthony.rentsch/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[Machine Learning for Urban Planning: Estimating Parking Capacity]]></title>
            <link>https://medium.com/data-science/machine-learning-for-urban-planning-estimating-parking-capacity-15aabd490cf8?source=rss-e8fe8e4172c------2</link>
            <guid isPermaLink="false">https://medium.com/p/15aabd490cf8</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[calibration]]></category>
            <category><![CDATA[cities]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[uncertainty]]></category>
            <dc:creator><![CDATA[Anthony Rentsch]]></dc:creator>
            <pubDate>Mon, 16 Dec 2019 04:21:47 GMT</pubDate>
            <atom:updated>2019-12-16T22:07:04.194Z</atom:updated>
            <content:encoded><![CDATA[<h4>Harvard Data Science Capstone Project, Fall 2019</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wu3H0xQGbmigqC3Ih0Cvyg.png" /><figcaption><em>Figure 1. Map of predicted proportion of driveways in Somerville by block</em></figcaption></figure><p><em>Note: This article was co-written by Josh Feldman, Lipika Ramaswamy, and Anthony Rentsch.</em></p><p>If everything continues as planned, Somerville, Massachusetts — a city just outside of Boston — will be getting a new subway line in 2021. Though the new line is exciting, it may cause issues for the existing citywide resident on-street parking program. If residents drive to these new stations and park their cars on nearby streets, will people who live on these streets lose access to a parking spot or will they be able to park in their driveway?</p><p>To address transportation planning questions like this, Somerville is conducting an audit of their parking supply. They have a good estimate of on-street parking capacity, but they have much less data about off-street parking. Their question is deceptively simple: how many residential units in Somerville have off-street parking?</p><p>For our capstone project for Harvard University’s Data Science master’s program, we partnered with the City of Somerville to answer this question. Our first step was figuring out the exact meaning of counting driveways. While we could provide a single point estimate with confidence intervals for the number of driveways citywide, Somerville planners will likely need to aggregate driveway counts at different levels of granularity. We want to provide them accurate probabilistic estimates at the parcel-level as well as uncertainties about these probabilities.</p><p>First, we needed to get labels. The city of Somerville provided us with aerial satellite photos of the entire city in raster format which we divided into images of each parcel using GIS software. Next, we wrote a script to download Google Street View images of each parcel. We randomly sampled over 600 addresses and manually labelled whether they had a driveway based on what we saw in the satellite and street view photos. We noticed in the assessment data that a few hundred more parcels were marked as having garages, so we added those to the parcels labelled as having driveways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*oROd5LP5JrCrDhJXF2IkeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*Qu8etHcbofJ97v4xfgvamQ.png" /><figcaption><em>Figure 2. Examples of aerial and street view imagery</em></figcaption></figure><p><strong>Feature Engineering</strong></p><p>To predict whether a residential unit has a driveway, we collected and engineered features from a variety of sources to feed into a supervised learning model. We used Somerville’s tax assessment database to get a wide array of information about homes ranging from the year it was built to the style of roof.</p><p>Two incredibly valuable sources of information were the parcel and building footprints. We used these polygons to measure how much space there was between a house and the edges of the parcel and how centered the house was on the parcel. Presumably, houses with driveways sit off to the side and have enough space on one side to fit a car.</p><p>In addition to these geometric and spatial features, we also aggregated permits for street parking by parcel with the assumption that more parking permits would indicate that a unit does not have access to parking in a driveway or garage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2U6SPNC5BpqfbMBsihqAw.png" /><figcaption><em>Figure 3. Visualization of our feature engineering process with building and parcel footprints</em></figcaption></figure><p><strong>Modelling</strong></p><p>After generating features, we tried to fit a variety of binary classifiers to our data with the outcome variable being whether a house had a driveway.</p><p>Initially, we experimented with using convolutional neural networks to extract features from our image data and make predictions, but we had very few photos labelled and their quality was too low to be useful despite extensive attempts to perform data augmentation, incorporate transfer learning, and tweak the architecture of our network.</p><p>Instead, the tax assessment data and hand-engineered features paired with traditional machine learning proved more effective than deep learning.</p><p>We fit several classifiers to this data, including logistic regression (with and without interactions), random forest, AdaBoost, XGBoost and feed forward neural network. We also experimented with stacking combinations of these models.</p><p>Our problem also had a large class imbalance. Among the parcels we labelled by hand, which represented a random sample, 82% had driveways. To compensate for this, we naively oversampled parcels without driveways, a technique that we found boosted performance more than fancier techniques such as Synthetic Minority Oversampling Technique (SMOTE) and Adaptive Synthetic Sampling (ADASYN).</p><p>Logistic regression and random forest obtained comparable performance. We chose the random forest since it better captured nonlinearities in the relationship between features and labels. This tree-based model also provided interpretability by way of feature importance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpHMx2UpjP3vdQPwRhj48A.png" /><figcaption>Figure 4. Feature importances from random forest model</figcaption></figure><p><strong>Post-Modelling</strong></p><p>Since our model will be used by the City of Somerville for transportation planning, we wanted to produce probabilistic estimates at the parcel-level. For this purpose, we wanted well-calibrated probabilities, i.e., probabilities that reflect the true likelihood of an event.</p><p>Unfortunately, many machine learning models, like random forests, do not produce well-calibrated probabilities by default. Additionally, our upsampling of the minority class pushed many of the raw random forest scores toward 0.5, even though we expected the majority of parcels to have driveways.</p><p>To handle this, we performed a calibration step to adjust the probabilities produced by our model. For the units we predicted as having a 70% chance of having a driveway, we wanted this to be true for 70% of them.</p><p>We used a technique called Platt scaling, which involves fitting a logistic regression to our uncalibrated predicted probabilities and labels. It is important to note that we wanted the distribution of the data we used to calibrate the model to reflect our expectations for the overall distribution of driveways in Somerville. Before fitting this model, we rebalanced our calibration set so that the proportion of driveways in this set was roughly 82%.</p><p>This calibration technique shifted many of the probabilities closer to 1, reflecting our educated belief that the majority of parcels in Somerville have driveways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cj84-GkmMUhcRTnny8wzhQ.png" /><figcaption><em>Figure 5. Calibration curves for uncalibrated and calibrated predictions on labelled data</em></figcaption></figure><p><strong>Estimation</strong></p><p>Finally, since we wished to allow City of Somerville analysts to estimate the number of driveways at any level of aggregation, such as a block or neighborhood, we formalized a method to do this estimation.</p><p>We modelled the presence of a driveway in each parcel <em>Y</em> as a Bernoulli random variable with a corresponding probability <em>p</em> estimated by the two-step classifier and calibration model. We made an assumption that, conditional on the features used in our model <em>X</em>, the presence of a driveway and the associated probability of a driveway being present at any parcel is independent from other parcels. This assumption is important because it allows us to ignore any spatial correlation in our estimates when we consider the variance of the expected number of driveways, <em>S</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzt69eqStEsJpC0HQ5qOtw.png" /><figcaption><em>Figure 6. Variance derivation</em></figcaption></figure><p>To get the expected number of driveways, we can sum up the probabilities for all the parcels of interest. To get the variance, we first created many bootstrapped samples of our training data and fit a new random forest model to each sample. Then we calculated a set of probabilities for each parcel, one for each bootstrapped sample. To get the variance of the parcel-level estimates, we calculated the mean of <em>p⋅</em>(1-<em>p</em>) and the variance of <em>p</em> over our bootstrapped estimates for each parcel and added these together. Finally, to obtain the variance for the level of aggregation of interest, we can sum all of these parcel-level variances.</p><p>Modelling the presence of a driveway using this approach allows statistically sound aggregation at any geographical level. If we add predictions and the variances for any set of parcels, we can recover valid point estimates and confidence intervals.</p><p>Overall, we estimate that there are 10,288 driveways +/- 74 (2 standard errors) present among the 12,069 residential parcels in the city, although different neighborhoods have different proportions of driveways, as can be seen in the map of block-level predictions.</p><p><strong>Final Thoughts</strong></p><p>We went into this project intending to use state-of-the-art computer vision and deep learning techniques to extract information from satellite and street view images of houses to figure out whether or not they have driveways. We found that this strategy was neither appropriate nor effective for the problem and data at hand.</p><p>Instead, it was effective to take a more traditional machine learning approach combined with smart feature engineering inspired by domain knowledge and realistic uncertainty estimation. We hope our work provides value to analysts from the City of Somerville as they plan for the new subway stop and more.</p><p>For more information about the Harvard Data Science Capstone, visit: <a href="http://capstone.iacs.seas.harvard.edu/">capstone.iacs.seas.harvard.edu</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15aabd490cf8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/machine-learning-for-urban-planning-estimating-parking-capacity-15aabd490cf8">Machine Learning for Urban Planning: Estimating Parking Capacity</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>