Descriptive and Predictive Analysis of Ames Housing Data

Posted on May 17, 2023


The housing market is a dynamic and complex system influenced by various factors. In this blog post, we delve into the descriptive and predictive analysis of the Ames Housing Data. By exploring historical data on housing sales in Ames between 2006 and 2010, our goal is to determine the factors that affect housing prices, train a model to accurately predict prices, and enhance prediction accuracy using machine learning techniques.

Dataset Overview:

We used a dataset for this analysis that consists of 2577 rows and 81 features. It provides historical data on housing sales in Ames between 2006 and 2010. The dataset is a valuable resource for understanding the factors that influence housing prices and developing accurate predictive models.

Descriptive Analysis: We employed traditional Exploratory Data Analysis (EDA) techniques to determine the factors that affect housing prices in the local market. This involved examining the correlation between variables, checking for skewness in the data, detecting and removing outliers, and conducting simple regression models.

Correlation Analysis: Correlation analysis allows us to identify the relationships between different features and the target variable, which is the sale price in this case. The correlation coefficients can help us understand which variables strongly correlate positively or negatively with housing prices

Skewness: Skewness measures the asymmetry of the distribution of a variable. By checking the skewness of the housing price data, we can assess whether it follows a normal distribution or if there is any skewness that needs to be addressed. Skewness can impact the accuracy of regression models, so it's important for us to address it appropriately. Skewed distributions may be transformed to a near normal distribution via log transformation.

Outlier Detection and Removal: Outliers are data points that deviate significantly from the majority of the data. They can distort the analysis and affect the performance of predictive models. By visualizing the relationship between sale price and relevant variables, we can identify and remove outliers to improve the accuracy of the analysis.

Simple Regression Models:

We used simple regression models to explore the relationship between the target variable (sale price) and individual features. This helps in understanding the strength and direction of the relationship between each feature and housing prices. With a simple regression plot, we can visualise the most important predictors;

Above, the price is obviously positively correlated to the Price while the OveralQual affects the price.

The same argument applies to the GrLivArea, GarageType, Housestyle, and Alley. Taking a close look at the relationship between GrLivArea and SalePrice, we observe that different SaleConditions exhibit different prices with 'Partial' being highly priced while 'Abnorml' is lowly priced.

Moreover, the neighborhood affects the SafePrice of the properties to.

Other important predictors are the quality of the property, the year it was either built or remodeled, and the season in which it was sold.

Data Cleaning and Exploratory Data Analysis:

Our analysis begins with data cleaning and exploratory data analysis (EDA). This step is crucial for understanding the dataset and developing an efficient model. We perform the following tasks:

  1. Log Transformation: To ensure normality and constant variance, we apply a log transformation to the data.
  2. UpSampling: We upsample the data to account for any imbalances and improve the representation of different classes.
  3. Outlier Removal: Using a plot of SALE PRICE versus GR LIV AREA, we identify and remove outliers. The instructor's notes suggest removing houses with more than 3700 square feet, eliminating unusual observations that may distort the analysis.
  4. Transformation of Ordinal to Numerical Types: We convert ordinal variables to numerical types to better capture their impact on housing prices.
  5. Dummification of Categorical Data: Categorical variables are transformed into dummy variables to enable their inclusion in the predictive models effectively.

Descriptive Analysis:

To determine the factors that affect housing prices in the local market, we perform correlation analysis, examine skewness, and compute descriptive statistics.

Observations: Several key observations were made. Firstly, we observed that 70% of the variation in sales price can be attributed to the neighborhood of the building. This suggests that the location and characteristics of the neighborhood play a significant role in determining housing prices.

Furthermore, we found that 76% of the variation can be attributed to its size.

The factors, quality and size, account for a total of 91% of the variations in housing prices.

This highlights the importance of considering the quality and size of a property when determining its value.

In addition, by utilizing 30 variables, including some created specifically for the analysis, it was possible to achieve a high level of predictive accuracy. All of these variables were statistically significant at the 5% confidence level. The resulting model resulted in an impressive R^2 value of 95.5%.

This indicates that the selected variables and their relationship to the target variable explain 95.5% of the variation in housing prices

These observations emphasize the critical factors that influence housing prices, such as neighborhood, quality, and size. They also demonstrate the effectiveness of the analysis in capturing and explaining a substantial portion of the price variations. Such insights provide valuable guidance for potential buyers and sellers in understanding the key determinants of housing prices in the local market.

Predictive Analysis:

The dataset was utilized to train different models that accurately predict housing prices. Predictive modeling involves the use of machine learning techniques to build a model that can learn from the historical data and make predictions on unseen data. Machine learning techniques were employed to enhance the accuracy of price predictions. e applied various algorithms, such as Lasso, Random Forest, Gradient Boosting, Stacking Regressor, XGBoost, and Support Vector Regressor, to develop predictive models. Additionally, hyperparameter tuning using GridSearchCV was performed to optimize the models and improve their performance.

Testing the Realism of Predictions: To test the realism of the predictions, they were compared against actual market values and industry benchmarks. This step ensures that the predictive models provide practical and reliable guidance to potential buyers.

By analyzing the historical data of Ames housing sales, descriptive and predictive analysis techniques were employed to determine the factors affecting housing prices and develop accurate price prediction models. By utilizing traditional EDA methods, conducting regression analysis, and applying machine learning algorithms, valuable insights were obtained, and models were created to assist potential buyers in making informed decisions. Through rigorous testing against actual market values, the realism and reliability of the predictions were assessed. The combination of descriptive and predictive analysis offers valuable recommendations for optimum prices in the local housing market.

Predictive Analysis: Building on the descriptive analysis, we develop predictive models to accurately forecast housing prices. We employ various regression techniques and machine learning algorithms, including Lasso, Random Forest, Gradient Boosting, Stacking Regressor, XGBoost, and Support Vector Regressor. To ensure the internal consistency of our models, we use GridSearchCV for hyperparameter tuning.

Model Validation:

To validate the predictive models, we perform cross-validation and split the dataset into training and validation sets. This approach allows us to evaluate the models' performance and assess their ability to generalize to new data. We report the predictive accuracy of each model and compare their results.

Improving Prediction Accuracy:

In our quest for improved prediction accuracy, we explore advanced machine learning techniques and model ensembles. By combining the strengths of multiple models, we aim to enhance the precision of price predictions.

Testing Realism: Lastly, we evaluate the realism of our predictions by comparing them against actual market values and industry benchmarks. This step helps us validate the effectiveness of our models and ensure their practical applicability.


Through a comprehensive descriptive and predictive analysis of the Ames Housing Data, we have gained valuable insights into the factors influencing housing prices in the local market. By leveraging machine learning techniques and employing advanced modeling approaches, we have developed accurate price prediction models. These models can guide potential buyers in making informed decisions and assist sellers in determining optimum prices. The combination of data-driven analysis, EDA, and predictive modeling offers a robust foundation for understanding and navigating the Ames housing market..

About Author

Okpala Mmaduabuchi

I hold a Ph.D. in Computer Science with a focus on Artificial Intelligence and Machine Learning. Throughout my academic journey, I have developed a deep understanding of advanced algorithms, data analysis, and predictive modeling. My research and coursework...
View all posts by Okpala Mmaduabuchi >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

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 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 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 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