Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Predicting house prices with machine learning methods
KTH, School of Electrical Engineering and Computer Science (EECS).
KTH, School of Electrical Engineering and Computer Science (EECS).
2019 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
Förutspå bostadspriser med maskininlärningsmetoder (Swedish)
Abstract [en]

In this study, the machine learning algorithms k-Nearest-Neighbours regression (k-NN) and Random Forest (RF) regression were used to predict house prices from a set of features in the Ames housing data set. The algorithms were selected from an assessment of previous research and the intent was to compare their relative performance at this task.

Software implementations for the experiment were selected from the scikit-learn Python library and executed to calculate the error between the actual and predicted sales price using four different metrics. Hyperparameters for the algorithms used were optimally selected and the cleaned data set was split using five-fold cross-validation to reduce the risk of bias. An optimal subset of hyperparameters for the two algorithms was selected through the grid search algorithm for the best prediction.

The Random Forest was found to consistently perform better than the kNN algorithm in terms of smaller errors and be better suited as a prediction model for the house price problem.

With a mean absolute error of about 9 % from the mean price in the best case, the practical usefulness of the prediction is rather limited to making basic valuations.

Abstract [sv]

I den här studien användes maskininlärningsalgoritmerna k-Nearest-Neighbours regression och Random Forest regression för att förutsäga huspriserna från en uppsättning variabler i Ames Housing datasetet. Algoritmerna valdes utifrån en bedömning av tidigare forskning och avsikten var att jämföra deras relativa prestanda i lösandet av denna uppgift. För experimentet valdes programvaruimplementeringar från Pythonbiblioteket scikit-learn och kördes för att beräkna felet mellan det faktiska och förutsedda försäljningspriset med fyra olika mätsätt. Hyperparametrar för de använda algoritmerna valdes optimalt och den rengjorda datamängden delades med femfaldig korsvalidering för att minska risken för partiskhet med hänsyn till datat. En optimal delmängd av hyperparametrar valdes även ut med algoritmen grid search för bästa möjliga förutsägelse. Random Forest-algoritmen visade sig konsekvent prestera bättre än k-NN-algoritmen i bemärkelsen minimalt fel och är en mer lämplig modell för problemet.

Med ett genomsnittligt absolutfel på ca 9 % från det genomsnittliga priset i bästafallet är den praktiska användbarheten av förutsägelsen tämligen begränsad till att göra grundläggande värderingar.

Place, publisher, year, edition, pages
2019. , p. 25
Series
TRITA-EECS-EX ; 2019:373
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-260140OAI: oai:DiVA.org:kth-260140DiVA, id: diva2:1354741
Supervisors
Examiners
Available from: 2019-10-09 Created: 2019-09-26 Last updated: 2022-06-26Bibliographically approved

Open Access in DiVA

fulltext(651 kB)26291 downloads
File information
File name FULLTEXT01.pdfFile size 651 kBChecksum SHA-512
6a0d1da85ebb891a40f56cd7298f4eea2ebe1e92cb79d8fda36918ae44c95f1a09b0db3939f7c593bfb6901615b195b30b09342430a9ca88df4f5cdbae947a99
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer and Information Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 26292 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 4395 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf