SlideShare a Scribd company logo
1 of 6
Download to read offline
Zillow’s Home Value Prediction (Zestimate)
- kaggle -
0. 데이터 설명
Zillow라는 미국 부동산 회사에서 Kaggle을 통해 제안한 competition은 미래의 분기별 Zestimate를 

예측하는 것이지만, 단순화 시켜 회귀분석을 이용해 주택 가격을 예측해보는 것이 목적
parcelid poolsizesum
airconditioningtypeid pooltypeid10
architecturalstyletypeid pooltypeid2
basementsqft pooltypeid7
bathroomcnt propertycountylandusecode
bedroomcnt propertylandusetypeid
buildingclasstypeid propertyzoningdesc
buildingqualitytypeid rawcensustractandblock
calculatedbathnbr regionidcity
decktypeid regionidcounty
finishedfloor1squarefeet regionidneighborhood
calculatedfinishedsquarefeet regionidzip
finishedsquarefeet12 roomcnt
finishedsquarefeet13 storytypeid
finishedsquarefeet15 threequarterbathnbr
finishedsquarefeet50 typeconstructiontypeid
finishedsquarefeet6 unitcnt
fips yardbuildingsqft17
fireplacecnt yardbuildingsqft26
fullbathcnt yearbuilt
garagecarcnt numberofstories
garagetotalsqft fireplaceflag
hashottuborspa structuretaxvaluedollarcnt
heatingorsystemtypeid taxvaluedollarcnt
latitude assessmentyear
longitude landtaxvaluedollarcnt
lotsizesquarefeet taxamount
poolcnt taxdelinquencyflag
poolsizesum taxdelinquencyyear
pooltypeid10 censustractandblock
변수별 관계을 파악하고, 도메인 지식을 활용하여 필요없는 변수제외한 데이터 프레
임을 생성해 준다.
• 추가로 삭제할 변수와 이유
▪ parcelid: 건물ID
▪ calculatedbathnbr: bathroomcnt과 같은 개념
▪ finishedsquarefeet12 : 세분화된 면적으로 calculatedfinishedsquarefeet에
포함되어 있음
▪ fullbathcnt: 세분화된 화장실 구조로 bathroomcnt에 포함되어 있음
▪ propertycountylandusecode: propertylandusetypeid와 유사한 개념
▪ propertyzoningdesc: propertylandusetypeid와 유사한 개념
▪ rawcensustractandblock, censustractandblock: 인구조사와 관련한 ID개
념, 의미없는 항목
▪ fips : 하위 개념인 regionidcity을 사용할 것임
▪ regionidcounty: 하위 개념인 regionidcity을 사용할 것임
▪ regionidneighborhood: 상위 개념인 regionidcity을 사용할 것임
▪ regionidzip: regionidcity와 같은 개념
▪ roomcnt: 대부분 0으로 기입되어 있어 bedroomcnt을 사용할 것임
▪ assessmentyear: 전부다 2015년임
▪ taxvaluedollarcnt, landtaxvaluedollarcnt, taxamount: target이 되는 가격
변수는 structuretaxvaluedollarcnt을 사용
1. 데이터 전처리
missing value 탐색 이상치 제거
결측치가 높은 데이터(70%이상)는 변수로서 활용이 

불가능하다고 판단되어 분석에서 제외.
모형에서 설명하고 있는 데이터와 동떨어진 값을 가지는 데이터를
아웃라이어(outlier)라고 한다.
다음과 같이 정의되는 값으로 레버리지가 커지거나 잔차의 크기
가 커지면 Cook's Distance 값이 커진다.
Fox' Outlier Recommendation 은 Cook's Distance가 다음과
같은 기준값보다 클 때 아웃라이어로 판단하자는 것이다.
잔차와 레버리지를 동시에 보기위한 기준으로는 Cook's Distance
가 있다.
2. 종속변수 structuretaxvaluedollarcnt에서 상식에 벗어나는
가격을 갖는 행은 삭제
3. bathroomcnt, bedroomcnt가 0인 데이터는 기록이 잘못된
이상치로 판단하고 삭제
1. 레버리지 활용

회귀 분석에는 잔차의 크기가 큰 데이터가 아웃라이어가 되는데
이 중에서도 주로 관심을 가지는 것은 레버리지와 잔차의 크기가
모두 큰 데이터들이다.
2. 주성분 분석
전처리를 마친 데이터로 회귀분석을 해본 결과, R_square 값은 높게 나왔지만 다중 공선성 문제 ( 독립변수들간의 상관관계가 존재)가 

있다는 것을 알 수 있었기 때문에, 이를 해결하기 위해 주성분분석(PCA)을 사용함
bath
bed
cfsf
year 

latitude
longitude
• PC1 = 0.57 * bath + 0.50 * bed + 0.56 * cfsf + ..

( PC1은 집 크기 또는 면적에 대한 변수로 볼 수 있음 )
• PC2 = -0.67 * latitude + 0.52 * year + 0.38 * longitude … 

( PC2는 집의 위치나 건축년도 같은 외부적인 요인들을 나타내는 변수)
• PC3 = -0.46 * year - 0.87 * longitude …
• PC1 까지의 누적 설명력 약 50%
• PC2 까지의 누적 설명력 약 80%
• PC3 까지의 누적 설명력 100%
• 변수 자체가 많지 않으므로 3가지의 주성분을 모두 사용하기로 함.
3가지 주성분들의 상관계수를 히트맵으로 시각화를 통해
PC1, PC2, PC3 세 변수들의 상관관계가 0임을 확인할 수
있다.
특히, PC1의 경우에는 종속변수인 가격과 높은 상관관계가
있음을 확인할 수 있다.
•R_squared이 0.632가 나왔고, F-statistic에 대한 

p-value가 0 이 나왔으므로 모델의 유의하다고
볼 수 있음.

•변수들에 대한 coefficient들의 p-value도 모두
유의한 결과를 보여 주고 있음

•이전 모델에서 가장 문제가 되었던 다중 공선성
문제가 해결된 것을 확인할 수 있음.
예측치와 실제값의 분포가 두 개의 그룹으로 나누어져 있
는 것을 알 수 있는데 이 부분은 모델링을 2개를 하거나 클
러스터링을 통해서 해결이 가능.
실제값과 예측값의 차이가 크게 나왔고 종속변수가 가격임
에도 불구하고 음수로 예측하는 경우도 있었다. 데이터는
충분히 많지만 데이터에 대한 설명의 부족으로 제대로 데
이터를 활용하는데 한계가 있었음.
PCA를 통해 차원축소를 한 다음 회귀분석
실제 가격과 예측 가격에 대한 scatter plot
감사합니다.

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Zillow house pirce prediction

  • 1. Zillow’s Home Value Prediction (Zestimate) - kaggle -
  • 2. 0. 데이터 설명 Zillow라는 미국 부동산 회사에서 Kaggle을 통해 제안한 competition은 미래의 분기별 Zestimate를 
 예측하는 것이지만, 단순화 시켜 회귀분석을 이용해 주택 가격을 예측해보는 것이 목적 parcelid poolsizesum airconditioningtypeid pooltypeid10 architecturalstyletypeid pooltypeid2 basementsqft pooltypeid7 bathroomcnt propertycountylandusecode bedroomcnt propertylandusetypeid buildingclasstypeid propertyzoningdesc buildingqualitytypeid rawcensustractandblock calculatedbathnbr regionidcity decktypeid regionidcounty finishedfloor1squarefeet regionidneighborhood calculatedfinishedsquarefeet regionidzip finishedsquarefeet12 roomcnt finishedsquarefeet13 storytypeid finishedsquarefeet15 threequarterbathnbr finishedsquarefeet50 typeconstructiontypeid finishedsquarefeet6 unitcnt fips yardbuildingsqft17 fireplacecnt yardbuildingsqft26 fullbathcnt yearbuilt garagecarcnt numberofstories garagetotalsqft fireplaceflag hashottuborspa structuretaxvaluedollarcnt heatingorsystemtypeid taxvaluedollarcnt latitude assessmentyear longitude landtaxvaluedollarcnt lotsizesquarefeet taxamount poolcnt taxdelinquencyflag poolsizesum taxdelinquencyyear pooltypeid10 censustractandblock 변수별 관계을 파악하고, 도메인 지식을 활용하여 필요없는 변수제외한 데이터 프레 임을 생성해 준다. • 추가로 삭제할 변수와 이유 ▪ parcelid: 건물ID ▪ calculatedbathnbr: bathroomcnt과 같은 개념 ▪ finishedsquarefeet12 : 세분화된 면적으로 calculatedfinishedsquarefeet에 포함되어 있음 ▪ fullbathcnt: 세분화된 화장실 구조로 bathroomcnt에 포함되어 있음 ▪ propertycountylandusecode: propertylandusetypeid와 유사한 개념 ▪ propertyzoningdesc: propertylandusetypeid와 유사한 개념 ▪ rawcensustractandblock, censustractandblock: 인구조사와 관련한 ID개 념, 의미없는 항목 ▪ fips : 하위 개념인 regionidcity을 사용할 것임 ▪ regionidcounty: 하위 개념인 regionidcity을 사용할 것임 ▪ regionidneighborhood: 상위 개념인 regionidcity을 사용할 것임 ▪ regionidzip: regionidcity와 같은 개념 ▪ roomcnt: 대부분 0으로 기입되어 있어 bedroomcnt을 사용할 것임 ▪ assessmentyear: 전부다 2015년임 ▪ taxvaluedollarcnt, landtaxvaluedollarcnt, taxamount: target이 되는 가격 변수는 structuretaxvaluedollarcnt을 사용
  • 3. 1. 데이터 전처리 missing value 탐색 이상치 제거 결측치가 높은 데이터(70%이상)는 변수로서 활용이 
 불가능하다고 판단되어 분석에서 제외. 모형에서 설명하고 있는 데이터와 동떨어진 값을 가지는 데이터를 아웃라이어(outlier)라고 한다. 다음과 같이 정의되는 값으로 레버리지가 커지거나 잔차의 크기 가 커지면 Cook's Distance 값이 커진다. Fox' Outlier Recommendation 은 Cook's Distance가 다음과 같은 기준값보다 클 때 아웃라이어로 판단하자는 것이다. 잔차와 레버리지를 동시에 보기위한 기준으로는 Cook's Distance 가 있다. 2. 종속변수 structuretaxvaluedollarcnt에서 상식에 벗어나는 가격을 갖는 행은 삭제 3. bathroomcnt, bedroomcnt가 0인 데이터는 기록이 잘못된 이상치로 판단하고 삭제 1. 레버리지 활용
 회귀 분석에는 잔차의 크기가 큰 데이터가 아웃라이어가 되는데 이 중에서도 주로 관심을 가지는 것은 레버리지와 잔차의 크기가 모두 큰 데이터들이다.
  • 4. 2. 주성분 분석 전처리를 마친 데이터로 회귀분석을 해본 결과, R_square 값은 높게 나왔지만 다중 공선성 문제 ( 독립변수들간의 상관관계가 존재)가 
 있다는 것을 알 수 있었기 때문에, 이를 해결하기 위해 주성분분석(PCA)을 사용함 bath bed cfsf year 
 latitude longitude • PC1 = 0.57 * bath + 0.50 * bed + 0.56 * cfsf + ..
 ( PC1은 집 크기 또는 면적에 대한 변수로 볼 수 있음 ) • PC2 = -0.67 * latitude + 0.52 * year + 0.38 * longitude … 
 ( PC2는 집의 위치나 건축년도 같은 외부적인 요인들을 나타내는 변수) • PC3 = -0.46 * year - 0.87 * longitude … • PC1 까지의 누적 설명력 약 50% • PC2 까지의 누적 설명력 약 80% • PC3 까지의 누적 설명력 100% • 변수 자체가 많지 않으므로 3가지의 주성분을 모두 사용하기로 함. 3가지 주성분들의 상관계수를 히트맵으로 시각화를 통해 PC1, PC2, PC3 세 변수들의 상관관계가 0임을 확인할 수 있다. 특히, PC1의 경우에는 종속변수인 가격과 높은 상관관계가 있음을 확인할 수 있다.
  • 5. •R_squared이 0.632가 나왔고, F-statistic에 대한 
 p-value가 0 이 나왔으므로 모델의 유의하다고 볼 수 있음.
 •변수들에 대한 coefficient들의 p-value도 모두 유의한 결과를 보여 주고 있음
 •이전 모델에서 가장 문제가 되었던 다중 공선성 문제가 해결된 것을 확인할 수 있음. 예측치와 실제값의 분포가 두 개의 그룹으로 나누어져 있 는 것을 알 수 있는데 이 부분은 모델링을 2개를 하거나 클 러스터링을 통해서 해결이 가능. 실제값과 예측값의 차이가 크게 나왔고 종속변수가 가격임 에도 불구하고 음수로 예측하는 경우도 있었다. 데이터는 충분히 많지만 데이터에 대한 설명의 부족으로 제대로 데 이터를 활용하는데 한계가 있었음. PCA를 통해 차원축소를 한 다음 회귀분석 실제 가격과 예측 가격에 대한 scatter plot