https://github.com/wichopy/finding_nearest_costfactor
Python Script to solve the nearest neighbour problem.
https://github.com/wichopy/finding_nearest_costfactor
Last synced: over 1 year ago
JSON representation
Python Script to solve the nearest neighbour problem.
- Host: GitHub
- URL: https://github.com/wichopy/finding_nearest_costfactor
- Owner: wichopy
- Created: 2017-01-16T23:28:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-17T02:35:16.000Z (over 9 years ago)
- Last Synced: 2025-01-22T01:47:06.005Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Finding_Nearest_CostFactor
Python Script to solve the nearest neighbour problem.
I was tasked with catagorizing a list of 800 buildings with a regional cost factor.
This factor corrects the pricing of building assets to better reflect costs in their respective region.
I used cost factors from the RS Means database, which is an industry recognized source for obtaining price estimates for construction.
This cost factors list only had regional factors for major cities and some rural towns.
The method proposed to me to tackle this problem was using 3 digit zip codes.
Not all the buildings in my list corresponded with these factors by 3 digit zip code.
Also 3 digit zip codes are not the most accurate as some zip regions may be very large and have multiple factors within them.
I instead decided to solve this problem using a nearest neighbour approach.
My solutions included was brute force using building long/lat coordinates, finding distances to all cost
factor points and returning the closest factor. The solution did not need to be optimized as with my list of ~400 factors I was able to
specify a cost factor for all 800 buildings in less then a second.
I also tried implementing the sklearn nearest neighbour methods, but got strange results and scrapped the data.