NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Machine Learning > Pandemic Effects on the Ames Housing Market and Lifestyle

Pandemic Effects on the Ames Housing Market and Lifestyle

Leland Murrin
Posted on Oct 16, 2024

Introduction

Purpose

The purpose of this project is to assist real estate agents in their service to out-of-town clients who are planning to move to Ames from a more urban setting. To assess the factors that affect the sale price of each home, consideration will be given to the proximity of desired services (e.g., gyms, spas, organic groceries, hospitals, etc.) as well as other housing features. Additionally, the project will analyze the housing market change due to the pandemic (i.e., 2019 vs 2021 data) and determine the neighborhood preferences for this particular client group. 

 

Data

The data was sourced from the Ames City Assessor website that archives recent home sales up to 2021. For the purposes of data cleaning, undeveloped lots were excluded from analysis, and only house sales from 2019 and 2021 were considered. Important dataset features include Sale Price, Year Built, Year Sold, Neighborhood, Property Address, and Other Dwelling Assessor Value (i.e., dwelling value = total value โ€“ land value).

 

Data Exploration

Sale Price

Figure 1: Ames neighborhood map by average Sale Price (color coded)

 

Figure 1 shows house sales distribution by neighborhood in Ames, Iowa. The annotations above show the average Sale Price within each selected neighborhood group along with the number of residences. Of note, condos generally had the lowest Sale Price, while the northern and western parts of the city exhibited the highest Sale Prices.

 

Services

Figure 2: Selected service and business locations in Ames, Iowa

 

Figure 2 depicts the selected services (e.g., Organic Grocery stores, Parks, High Schools, Gyms and Religious Institutions) based on possible interests of out-of-town home buyers. The individual businesses were manually chosen based on search engine user ratings (e.g., Google, Yelp) and popularity. Most businesses were located in the downtown area (i.e., Old Town).

 

Year Built

Figure 3: Ames neighborhood map by Year Built (color coded)

 

Among the features that could influence Sale Price, Year Built seemed to be significant. Figure 3 shows the progression of new house construction in Ames. The oldest houses sold were built in the 1880s in Old Town, while the newest houses were built in 2020 and appear in the northern and western suburbs of town. Comparing Figure 3 to Figure 1, it appears that the newer houses generally have a higher average Sale Price.

 

House Sales

Figure 4: Frequency of house sales per month (2019 vs. 2021)

 

Another point of interest is the house sales activity in 2019 and 2021. Figure 4 shows the distribution of house sales by month for both years. A chi squared test indicated that there was a significant difference (p-value < 0.05) in the activity across both years, even when accounting for house sales in 2021 ending in August. Year 2021 shows a more even distribution of sales throughout the year compared to 2019. 

 

Feature Engineering

Lat Longs

Creating visualizations for this project entailed converting the Property Address field into lat long coordinates. This was done by calling the Geoapify API service. To validate the lat longs through a cross check with the original street name, we used Nominatim for a reverse lookup. Any discrepancies were then manually corrected to provide the most accurate locations. This process was performed for both houses and businesses. 

 

Code Block 1: Geoapify API call function that takes in address input and returns lat long string

 

Drive Time

Code Block 2: OSMR API call function for drive times lookups that takes in as input the origin destination lat longs and returns the driving time to or from the destination

 

For every business and house combination, the driving time and driving distance was calculated using an OSMR API call as seen in Code Block 2. This allowed for the measurement of proximity to local businesses in terms that home buyers could understand. In addition, more advanced features were calculated, including the closest service to each house, the number of businesses within a certain driving time, and the average driving time to services.

Figure 5: Number of businesses within 180 vs. 480 seconds to each house

 

After the creation of various driving time fields, a select few were chosen based on their relative significance. For instance, in Figure 5, there is a large gap in the distribution of the number of businesses between a 3 minute (180 seconds) versus 8 minute (480 seconds) drive from each house. In other words, most businesses were located within 3 to 8 minutes of each residence.

Figure 6: Ames neighborhood map by minimum average driving time to Closest 5 Services (color coded)

 

In addition, the closest businesses to each home was determined, allowing for the calculation of the average driving time to the Closest, Closest 5, and All services. In the context of the Closest 5 services, neighborhoods in the far west of Ames, in Figure 6, had the longest average drive times, while those in the center and north of Ames had the shortest average drive times. Old Town had the absolute shortest drive time, as expected due to its centrality. Overall, however, the effect on Sale Price due to the proximity of the Closest 5 services is not entirely clear.

 

House Features

Determining the factors that affect Sale Price also required the conversion of house features into engineered fields. In terms of area, the Total Area field (Gross Living Area + Basement Area) and the Total Area with Garage field (Total Area + Garage Area) were calculated. Furthermore, boolean flags were created for the presence of significant amenities: Fireplace, Basement, and Garage.

Figure 7: Ames neighborhood map by average Total Area with Garage and Basement (color coded)

 

Figure 7 shows the distribution of Total Area with Garage. Neighborhoods in the northwest of Ames had the largest, while condo neighborhood subdivisions and Old Town had the smallest. Based on Figure 1, the Sale Price corresponds to a larger living area (e.g., North Ridge).

 

Covid Effects

Regression

Figure 8: Comparison of Sale Price to Other Dwelling Assessor Value pre-pandemic vs. post-pandemic

 

In order to compare the effects before and after Covid, it is necessary to analyze important features using descriptive models and testing. Figure 10 shows that the Other Dwelling Assessor Value field is the most important factor in determining the Sale Price. 

In Figure 8, a regression is performed to demonstrate how the year affects the correlation between this feature and the Sale Price. Even though 2021 has a smaller number of records, there was a greater range of Sale Prices for that year. The plot also shows that the Sale Price for any given Assessor value was higher in 2021 than in 2019, meaning that the pandemic may have increased the demand for housing. 

 

Hypothesis testing

Table 1: A/B testing results for categorical features across both 2019 & 2021

 

Table 2: Hypothesis testing results for numerical features across both 2019 & 2021

 

A/B testing was performed to compare categorical features across both years (Table 1). 2019 showed a preference for more moderately priced neighborhoods (Sawyer West) whereas 2021 seemed to split between more expensive and less expensive neighborhoods (North Ridge and Old Town). Overall, the houses bought in 2021 have more extreme features and Sale Prices. 

Hypothesis testing was performed to compare numerical features across both years (Table 2). Sales in 2021 indicate that more houses were bought closer to services in general, as seen by the reduced average drive times (Closest 5 and All). 

 

Closest Service Analysis

Figure 9: Closest service percentage comparison (2019 vs. 2021)

 

Finally, in Figure 9, a stark contrast between 2019 and 2021 is seen when comparing the frequencies of the Closest Service to each house. In 2019, gym and recreation services had a higher percentage of nearby house sales. However, in 2021, restaurant, religion, and shopping services had a higher percentage. There may have been a migration towards downtown during the pandemic since restaurant, religious, and shopping services were located in the center of town, as opposed to gym and recreation services which were located more in the suburbs.

 

Predictive Modeling

Feature Reduction

Due to the large number of features, it was important to reduce the feature space in order to alleviate multicollinearity issues. Sequential Feature Selection (SFS) using tree-based ensemble regression was utilized to reduce the number of features by half. Notable features that were determined to significantly influence the Sale Price included Total Area with Garage, Other Dwelling Assessor Value, Sale Condition, and Year Built as seen in Figure 10. 

Figure 10: Top important features from final Gradient Boosting predictive model

 

Several regression models were tested, including Multiple Linear, Support Vector, Random Forest, and Gradient Boosting. Gradient Boosting, with GridSearchCV tuning its hyperparameters, resulted in the best model. The final optimized model reached a coefficient of determination (R2) of ~89%. As seen in Figure 10, the Other Assessor Value and Total Area with Garage have the highest importances over all other features (~50% and ~25% respectively). 

 

Sensitivity Analysis

Table 3: Sale Price prediction based off the addition of selected features and consumer preferences

 

To utilize the predictive model, 3 records were chosen from the dataset representing a townhome, condo, and single-family detached home. All records were standardized by Year Sold, Sale Price, and Year Built. Specific features were changed or added to predict Sale Price for each unit type. In Table 3, the cheapest change for 2 out of 3 homes was hypothetically having shopping as the Closest Service, while the most expensive was adding a fireplace. 

Notably, 2021 housing prices were significantly larger than 2019 for all house types. Condos had the largest percent change when adding amenities, whereas single family detached homes had the smallest. Overall, proximity to services, in Table 3, had less of an effect on Sale Price than either Year Sold or the addition of amenities.

 

Conclusion

In addressing the clients concerns, most houses in Ames were within 3 to 8 minutes of all services (gyms being the closest). The house amenities that had the greatest impact on Sale Price were fireplaces and central air: fireplaces distinguish expensive homes from average homes, whereas central air distinguishes average homes from inexpensive homes.

In addressing real estate firm concerns, house Sale Prices post-pandemic were more extreme in 2021 than in 2019. Real estate agents should focus on selling homes with more extreme Sale Prices: less expensive or more expensive than average. Based on the predictive model, proximity to any given service has no real effect on Sale Price. Post-pandemic, the best neighborhoods to recommend would be North Ridge and Old Town, which are both convenient to all services. However, based on Total Area with Garage in Figure 7, we see that North Ridge is best for families and Old Town is best for single individuals.

 

Links & References

  • Real Estate Dataset Source: Ames City Assessor Reports
  • Housing Dataset Source: Ames Housing Data Kaggle
  • Original Paper: Ames, Iowa: Alternative to Boston Housing by Dean De Cock
  • Github & Final Presentation: Pandemic Effects Project

About Author

Leland Murrin

View all posts by Leland Murrin >

Related Articles

Capstone
Catching Fraud in the Healthcare System
Capstone
The Convenience Factor: How Grocery Stores Impact Property Values
Capstone
Acquisition Due Dilligence Automation for Smaller Firms
Machine Learning
The Ames Data Set: Sales Price Tackled With Diverse Models
AWS
Automated Data Extraction and Transformation Using Python, OpenAI, and AWS

Leave a Comment

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application