Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
Last active May 5, 2016 16:25
Show Gist options
  • Select an option

  • Save primaryobjects/d2b32191774760c3c30dfb9d44ef8420 to your computer and use it in GitHub Desktop.

Select an option

Save primaryobjects/d2b32191774760c3c30dfb9d44ef8420 to your computer and use it in GitHub Desktop.
Analysis of Boston real-estate prices using linear regression, CART, and regression tree models.
TOWN TRACT LON LAT MEDV CRIM ZN INDUS CHAS NOX RM AGE DIS RAD TAX PTRATIO
Nahant 2011 -70.955 42.255 24 0.00632 18 2.31 0 0.538 6.575 65.2 4.09 1 296 15.3
Swampscott 2021 -70.95 42.2875 21.6 0.02731 0 7.07 0 0.469 6.421 78.9 4.9671 2 242 17.8
Swampscott 2022 -70.936 42.283 34.7 0.02729 0 7.07 0 0.469 7.185 61.1 4.9671 2 242 17.8
Marblehead 2031 -70.928 42.293 33.4 0.03237 0 2.18 0 0.458 6.998 45.8 6.0622 3 222 18.7
Marblehead 2032 -70.922 42.298 36.2 0.06905 0 2.18 0 0.458 7.147 54.2 6.0622 3 222 18.7
Marblehead 2033 -70.9165 42.304 28.7 0.02985 0 2.18 0 0.458 6.43 58.7 6.0622 3 222 18.7
Salem 2041 -70.936 42.297 22.9 0.08829 12.5 7.87 0 0.524 6.012 66.6 5.5605 5 311 15.2
Salem 2042 -70.9375 42.31 22.1 0.14455 12.5 7.87 0 0.524 6.172 96.1 5.9505 5 311 15.2
Salem 2043 -70.933 42.312 16.5 0.21124 12.5 7.87 0 0.524 5.631 100 6.0821 5 311 15.2
Salem 2044 -70.929 42.316 18.9 0.17004 12.5 7.87 0 0.524 6.004 85.9 6.5921 5 311 15.2
Salem 2045 -70.935 42.316 15 0.22489 12.5 7.87 0 0.524 6.377 94.3 6.3467 5 311 15.2
Salem 2046 -70.944 42.317 18.9 0.11747 12.5 7.87 0 0.524 6.009 82.9 6.2267 5 311 15.2
Salem 2047 -70.951 42.306 21.7 0.09378 12.5 7.87 0 0.524 5.889 39 5.4509 5 311 15.2
Lynn 2051 -70.9645 42.292 20.4 0.62976 0 8.14 0 0.538 5.949 61.8 4.7075 4 307 21
Lynn 2052 -70.972 42.287 18.2 0.63796 0 8.14 0 0.538 6.096 84.5 4.4619 4 307 21
Lynn 2053 -70.9765 42.294 19.9 0.62739 0 8.14 0 0.538 5.834 56.5 4.4986 4 307 21
Lynn 2054 -70.987 42.2985 23.1 1.05393 0 8.14 0 0.538 5.935 29.3 4.4986 4 307 21
Lynn 2055 -70.978 42.285 17.5 0.7842 0 8.14 0 0.538 5.99 81.7 4.2579 4 307 21
Lynn 2056 -70.9925 42.2825 20.2 0.80271 0 8.14 0 0.538 5.456 36.6 3.7965 4 307 21
Lynn 2057 -70.988 42.2776 18.2 0.7258 0 8.14 0 0.538 5.727 69.5 3.7965 4 307 21
Lynn 2058 -70.9835 42.277 13.6 1.25179 0 8.14 0 0.538 5.57 98.1 3.7979 4 307 21
Lynn 2059 -70.982 42.281 19.6 0.85204 0 8.14 0 0.538 5.965 89.2 4.0123 4 307 21
Lynn 2060 -70.9775 42.279 15.2 1.23247 0 8.14 0 0.538 6.142 91.7 3.9769 4 307 21
Lynn 2061 -70.973 42.279 14.5 0.98843 0 8.14 0 0.538 5.813 100 4.0952 4 307 21
Lynn 2062 -70.9693 42.2816 15.6 0.75026 0 8.14 0 0.538 5.924 94.1 4.3996 4 307 21
Lynn 2063 -70.964 42.284 13.9 0.84054 0 8.14 0 0.538 5.599 85.7 4.4546 4 307 21
Lynn 2064 -70.9597 42.287 16.6 0.67191 0 8.14 0 0.538 5.813 90.3 4.682 4 307 21
Lynn 2065 -70.9597 42.2825 14.8 0.95577 0 8.14 0 0.538 6.047 88.8 4.4534 4 307 21
Lynn 2066 -70.957 42.28 18.4 0.77299 0 8.14 0 0.538 6.495 94.4 4.4547 4 307 21
Lynn 2067 -70.951 42.278 21 1.00245 0 8.14 0 0.538 6.674 87.3 4.239 4 307 21
Lynn 2068 -70.967 42.279 12.7 1.13081 0 8.14 0 0.538 5.713 94.1 4.233 4 307 21
Lynn 2069 -70.964 42.2765 14.5 1.35472 0 8.14 0 0.538 6.072 100 4.175 4 307 21
Lynn 2070 -70.972 42.2765 13.2 1.38799 0 8.14 0 0.538 5.95 82 3.99 4 307 21
Lynn 2071 -70.9795 42.276 13.1 1.15172 0 8.14 0 0.538 5.701 95 3.7872 4 307 21
Lynn 2072 -70.9775 42.272 13.5 1.61282 0 8.14 0 0.538 6.096 96.9 3.7598 4 307 21
Sargus 2081 -71 42.27 18.9 0.06417 0 5.96 0 0.499 5.933 68.2 3.3603 5 279 19.2
Sargus 2082 -71.008 42.2745 20 0.09744 0 5.96 0 0.499 5.841 61.4 3.3779 5 279 19.2
Sargus 2083 -71.004 42.2865 21 0.08014 0 5.96 0 0.499 5.85 41.5 3.9342 5 279 19.2
Sargus 2084 -71.02 42.2875 24.2 0.17505 0 5.96 0 0.499 5.966 30.2 3.8473 5 279 19.2
Lynnfield 2091 -71.013 42.313 30.8 0.02763 75 2.95 0 0.428 6.595 21.8 5.4011 3 252 18.3
Lynnfield 2092 -71.03 42.324 34.9 0.03359 75 2.95 0 0.428 7.024 15.8 5.4011 3 252 18.3
Peabody 2101 -71.004 42.335 26.6 0.12744 0 6.91 0 0.448 6.77 2.9 5.7209 3 233 17.9
Peabody 2102 -71.003 42.3235 25.3 0.1415 0 6.91 0 0.448 6.169 6.6 5.7209 3 233 17.9
Peabody 2103 -70.9775 42.3237 24.7 0.15936 0 6.91 0 0.448 6.211 6.5 5.7209 3 233 17.9
Peabody 2104 -70.9675 42.317 21.2 0.12269 0 6.91 0 0.448 6.069 40 5.7209 3 233 17.9
Peabody 2105 -70.9725 42.3075 19.3 0.17142 0 6.91 0 0.448 5.682 33.8 5.1004 3 233 17.9
Peabody 2106 -70.965 42.3075 20 0.18836 0 6.91 0 0.448 5.786 33.3 5.1004 3 233 17.9
Peabody 2107 -70.956 42.3125 16.6 0.22927 0 6.91 0 0.448 6.03 85.5 5.6894 3 233 17.9
Peabody 2108 -70.955 42.3165 14.4 0.25387 0 6.91 0 0.448 5.399 95.3 5.87 3 233 17.9
Peabody 2109 -70.9525 42.3208 19.4 0.21977 0 6.91 0 0.448 5.602 62 6.0877 3 233 17.9
Danvers 2111 -70.951 42.334 19.7 0.08873 21 5.64 0 0.439 5.963 45.7 6.8147 4 243 16.8
Danvers 2112 -70.963 42.3382 20.5 0.04337 21 5.64 0 0.439 6.115 63 6.8147 4 243 16.8
Danvers 2113 -70.958 42.346 25 0.0536 21 5.64 0 0.439 6.511 21.1 6.8147 4 243 16.8
Danvers 2114 -70.978 42.3425 23.4 0.04981 21 5.64 0 0.439 5.998 21.4 6.8147 4 243 16.8
Middleton 2121 -71.0175 42.3715 18.9 0.0136 75 4 0 0.41 5.888 47.6 7.3197 3 469 21.1
Topsfield 2141 -70.9625 42.381 35.4 0.01311 90 1.22 0 0.403 7.249 21.9 8.6966 5 226 17.9
Hamilton 2151 -70.93 42.374 24.7 0.02055 85 0.74 0 0.41 6.383 35.7 9.1876 2 313 17.3
Wenham 2161 -70.9295 42.3715 31.6 0.01432 100 1.32 0 0.411 6.816 40.5 8.3248 5 256 15.1
Beverly 2171 -70.9385 42.346 23.3 0.15445 25 5.13 0 0.453 6.145 29.2 7.8148 8 284 19.7
Beverly 2172 -70.94 42.332 19.6 0.10328 25 5.13 0 0.453 5.927 47.2 6.932 8 284 19.7
Beverly 2173 -70.93 42.337 18.7 0.14932 25 5.13 0 0.453 5.741 66.2 7.2254 8 284 19.7
Beverly 2174 -70.93 42.3275 16 0.17171 25 5.13 0 0.453 5.966 93.4 6.8185 8 284 19.7
Beverly 2175 -70.9215 42.332 22.2 0.11027 25 5.13 0 0.453 6.456 67.8 7.2255 8 284 19.7
Beverly 2176 -70.9075 42.339 25 0.1265 25 5.13 0 0.453 6.762 43.4 7.9809 8 284 19.7
Manchester 2181 -70.86 42.345 33 0.01951 17.5 1.38 0 0.4161 7.104 59.5 9.2229 3 216 18.6
North Reading 3301 -71.045 42.345 23.5 0.03584 80 3.37 0 0.398 6.29 17.8 6.6115 4 337 16.1
North Reading 3302 -71.069 42.3525 19.4 0.04379 80 3.37 0 0.398 5.787 31.1 6.6115 4 337 16.1
Wilmington 3311 -71.09 42.3362 22 0.05789 12.5 6.07 0 0.409 5.878 21.4 6.498 4 345 18.9
Wilmington 3312 -71.108 42.34 17.4 0.13554 12.5 6.07 0 0.409 5.594 36.8 6.498 4 345 18.9
Wilmington 3313 -71.111 42.327 20.9 0.12816 12.5 6.07 0 0.409 5.885 33 6.498 4 345 18.9
Burlington 3321 -71.121 42.316 24.2 0.08826 0 10.81 0 0.413 6.417 6.6 5.2873 4 305 19.2
Burlington 3322 -71.1095 42.3008 21.7 0.15876 0 10.81 0 0.413 5.961 17.5 5.2873 4 305 19.2
Burlington 3323 -71.13 42.305 22.8 0.09164 0 10.81 0 0.413 6.065 7.8 5.2873 4 305 19.2
Burlington 3324 -71.123 42.292 23.4 0.19539 0 10.81 0 0.413 6.245 6.2 5.2873 4 305 19.2
Woburn 3331 -71.1105 42.289 24.1 0.07896 0 12.83 0 0.437 6.273 6 4.2515 5 398 18.7
Woburn 3332 -71.1 42.2875 21.4 0.09512 0 12.83 0 0.437 6.286 45 4.5026 5 398 18.7
Woburn 3333 -71.09 42.2835 20 0.10153 0 12.83 0 0.437 6.279 74.5 4.0522 5 398 18.7
Woburn 3334 -71.076 42.2895 20.8 0.08707 0 12.83 0 0.437 6.14 45.8 4.0905 5 398 18.7
Woburn 3335 -71.0905 42.295 21.2 0.05646 0 12.83 0 0.437 6.232 53.7 5.0141 5 398 18.7
Woburn 3336 -71.091 42.305 20.3 0.08387 0 12.83 0 0.437 5.874 36.6 4.5026 5 398 18.7
Reading 3341 -71.0685 42.308 28 0.04113 25 4.86 0 0.426 6.727 33.5 5.4007 4 281 19
Reading 3342 -71.069 42.315 23.9 0.04462 25 4.86 0 0.426 6.619 70.4 5.4007 4 281 19
Reading 3343 -71.0675 42.326 24.8 0.03659 25 4.86 0 0.426 6.302 32.2 5.4007 4 281 19
Reading 3344 -71.0575 42.317 22.9 0.03551 25 4.86 0 0.426 6.167 46.7 5.4007 4 281 19
Wakefield 3351 -71.043 42.3075 23.9 0.05059 0 4.49 0 0.449 6.389 48 4.7794 3 247 18.5
Wakefield 3352 -71.05 42.3 26.6 0.05735 0 4.49 0 0.449 6.63 56.1 4.4377 3 247 18.5
Wakefield 3353 -71.033 42.305 22.5 0.05188 0 4.49 0 0.449 6.015 45.1 4.4272 3 247 18.5
Wakefield 3354 -71.039 42.2885 22.2 0.07151 0 4.49 0 0.449 6.121 56.8 3.7476 3 247 18.5
Melrose 3361 -71.042 42.2796 23.6 0.0566 0 3.41 0 0.489 7.007 86.3 3.4217 2 270 17.8
Melrose 3362 -71.0345 42.2785 28.7 0.05302 0 3.41 0 0.489 7.079 63.1 3.4145 2 270 17.8
Melrose 3363 -71.03 42.272 22.6 0.04684 0 3.41 0 0.489 6.417 66.1 3.0923 2 270 17.8
Melrose 3364 -71.0425 42.2715 22 0.03932 0 3.41 0 0.489 6.405 73.9 3.0921 2 270 17.8
Stoneham 3371 -71.053 42.283 22.9 0.04203 28 15.04 0 0.464 6.442 53.6 3.6659 4 270 18.2
Stoneham 3372 -71.062 42.296 25 0.02875 28 15.04 0 0.464 6.211 28.9 3.6659 4 270 18.2
Stoneham 3373 -71.0615 42.284 20.6 0.04294 28 15.04 0 0.464 6.249 77.3 3.615 4 270 18.2
Winchester 3381 -71.076 42.2775 28.4 0.12204 0 2.89 0 0.445 6.625 57.8 3.4952 2 276 18
Winchester 3382 -71.085 42.2775 21.4 0.11504 0 2.89 0 0.445 6.163 69.6 3.4952 2 276 18
Winchester 3383 -71.089 42.2715 38.7 0.12083 0 2.89 0 0.445 8.069 76 3.4952 2 276 18
Winchester 3384 -71.0982 42.2685 43.8 0.08187 0 2.89 0 0.445 7.82 36.9 3.4952 2 276 18
Winchester 3385 -71.08 42.268 33.2 0.0686 0 2.89 0 0.445 7.416 62.5 3.4952 2 276 18
Medford 3391 -71.0668 42.2545 27.5 0.14866 0 8.56 0 0.52 6.727 79.9 2.7778 5 384 20.9
Medford 3392 -71.081 42.245 26.5 0.11432 0 8.56 0 0.52 6.781 71.3 2.8561 5 384 20.9
Medford 3393 -71.0812 42.2515 18.6 0.22876 0 8.56 0 0.52 6.405 85.4 2.7147 5 384 20.9
Medford 3394 -71.077 42.249 19.3 0.21161 0 8.56 0 0.52 6.137 87.4 2.7147 5 384 20.9
Medford 3395 -71.069 42.248 20.1 0.1396 0 8.56 0 0.52 6.167 90 2.421 5 384 20.9
Medford 3396 -71.0662 42.2425 19.5 0.13262 0 8.56 0 0.52 5.851 96.7 2.1069 5 384 20.9
Medford 3397 -71.0622 42.2431 19.5 0.1712 0 8.56 0 0.52 5.836 91.9 2.211 5 384 20.9
Medford 3398 -71.0553 42.2465 20.4 0.13117 0 8.56 0 0.52 6.127 85.2 2.1224 5 384 20.9
Medford 3399 -71.055 42.2505 19.8 0.12802 0 8.56 0 0.52 6.474 97.1 2.4329 5 384 20.9
Medford 3400 -71.06 42.254 19.4 0.26363 0 8.56 0 0.52 6.229 91.2 2.5451 5 384 20.9
Medford 3401 -71.056 42.2605 21.7 0.10793 0 8.56 0 0.52 6.195 54.4 2.7778 5 384 20.9
Malden 3411 -71.0475 42.261 22.8 0.10084 0 10.01 0 0.547 6.715 81.6 2.6775 6 432 17.8
Malden 3412 -71.049 42.253 18.8 0.12329 0 10.01 0 0.547 5.913 92.9 2.3534 6 432 17.8
Malden 3413 -71.0428 42.258 18.7 0.22212 0 10.01 0 0.547 6.092 95.4 2.548 6 432 17.8
Malden 3414 -71.0396 42.2512 18.5 0.14231 0 10.01 0 0.547 6.254 84.2 2.2565 6 432 17.8
Malden 3415 -71.0355 42.2545 18.3 0.17134 0 10.01 0 0.547 5.928 88.2 2.4631 6 432 17.8
Malden 3416 -71.036 42.2608 21.2 0.13158 0 10.01 0 0.547 6.176 72.5 2.7301 6 432 17.8
Malden 3417 -71.0285 42.262 19.2 0.15098 0 10.01 0 0.547 6.021 82.6 2.7474 6 432 17.8
Malden 3418 -71.0285 42.258 20.4 0.13058 0 10.01 0 0.547 5.872 73.1 2.4775 6 432 17.8
Malden 3419 -71.019 42.2605 19.3 0.14476 0 10.01 0 0.547 5.731 65.2 2.7592 6 432 17.8
Everett 3421 -71.0243 42.2483 22 0.06899 0 25.65 0 0.581 5.87 69.7 2.2577 2 188 19.1
Everett 3422 -71.0312 42.2505 20.3 0.07165 0 25.65 0 0.581 6.004 84.1 2.1974 2 188 19.1
Everett 3423 -71.0377 42.247 20.5 0.09299 0 25.65 0 0.581 5.961 92.9 2.0869 2 188 19.1
Everett 3424 -71.037 42.2435 17.3 0.15038 0 25.65 0 0.581 5.856 97 1.9444 2 188 19.1
Everett 3425 -71.0308 42.245 18.8 0.09849 0 25.65 0 0.581 5.879 95.8 2.0063 2 188 19.1
Everett 3426 -71.0262 42.2431 21.4 0.16902 0 25.65 0 0.581 5.986 88.4 1.9929 2 188 19.1
Everett 3427 -71.0333 42.2395 15.7 0.38735 0 25.65 0 0.581 5.613 95.6 1.7572 2 188 19.1
Somerville 3501 -71.053 42.2355 16.2 0.25915 0 21.89 0 0.624 5.693 96 1.7883 4 437 21.2
Somerville 3502 -71.058 42.235 18 0.32543 0 21.89 0 0.624 6.431 98.8 1.8125 4 437 21.2
Somerville 3503 -71.0638 42.2368 14.3 0.88125 0 21.89 0 0.624 5.637 94.7 1.9799 4 437 21.2
Somerville 3504 -71.0692 42.239 19.2 0.34006 0 21.89 0 0.624 6.458 98.9 2.1185 4 437 21.2
Somerville 3505 -71.075 42.24 19.6 1.19294 0 21.89 0 0.624 6.326 97.7 2.271 4 437 21.2
Somerville 3506 -71.0745 42.2405 23 0.59005 0 21.89 0 0.624 6.372 97.9 2.3274 4 437 21.2
Somerville 3507 -71.079 42.245 18.4 0.32982 0 21.89 0 0.624 5.822 95.4 2.4699 4 437 21.2
Somerville 3508 -71.076 42.2405 15.6 0.97617 0 21.89 0 0.624 5.757 98.4 2.346 4 437 21.2
Somerville 3509 -71.075 42.2362 18.1 0.55778 0 21.89 0 0.624 6.335 98.2 2.1107 4 437 21.2
Somerville 3510 -71.0677 42.2335 17.4 0.32264 0 21.89 0 0.624 5.942 93.5 1.9669 4 437 21.2
Somerville 3511 -71.063 42.2325 17.1 0.35233 0 21.89 0 0.624 6.454 98.4 1.8498 4 437 21.2
Somerville 3512 -71.062 42.2275 13.3 0.2498 0 21.89 0 0.624 5.857 98.2 1.6686 4 437 21.2
Somerville 3513 -71.0568 42.23 17.8 0.54452 0 21.89 0 0.624 6.151 97.9 1.6687 4 437 21.2
Somerville 3514 -71.0518 42.2312 14 0.2909 0 21.89 0 0.624 6.174 93.6 1.6119 4 437 21.2
Somerville 3515 -71.0543 42.2265 14.4 1.62864 0 21.89 0 0.624 5.019 100 1.4394 4 437 21.2
Cambridge 3521 -71.048 42.2222 13.4 3.32105 0 19.58 1 0.871 5.403 100 1.3216 5 403 14.7
Cambridge 3522 -71.0519 42.223 15.6 4.0974 0 19.58 0 0.871 5.468 100 1.4118 5 403 14.7
Cambridge 3523 -71.051 42.2205 11.8 2.77974 0 19.58 0 0.871 4.903 97.8 1.3459 5 403 14.7
Cambridge 3524 -71.054 42.219 13.8 2.37934 0 19.58 0 0.871 6.13 100 1.4191 5 403 14.7
Cambridge 3525 -71.059 42.221 15.6 2.15505 0 19.58 0 0.871 5.628 100 1.5166 5 403 14.7
Cambridge 3526 -71.0555 42.2222 14.6 2.36862 0 19.58 0 0.871 4.926 95.7 1.4608 5 403 14.7
Cambridge 3527 -71.0567 42.224 17.8 2.33099 0 19.58 0 0.871 5.186 93.8 1.5296 5 403 14.7
Cambridge 3528 -71.058 42.223 15.4 2.73397 0 19.58 0 0.871 5.597 94.9 1.5257 5 403 14.7
Cambridge 3529 -71.062 42.2236 21.5 1.6566 0 19.58 0 0.871 6.122 97.3 1.618 5 403 14.7
Cambridge 3530 -71.0622 42.2205 19.6 1.49632 0 19.58 0 0.871 5.404 100 1.5916 5 403 14.7
Cambridge 3531 -71.059 42.217 15.3 1.12658 0 19.58 1 0.871 5.012 88 1.6102 5 403 14.7
Cambridge 3532 -71.0645 42.215 19.4 2.14918 0 19.58 0 0.871 5.709 98.5 1.6232 5 403 14.7
Cambridge 3533 -71.0662 42.2162 17 1.41385 0 19.58 1 0.871 6.129 96 1.7494 5 403 14.7
Cambridge 3534 -71.068 42.215 15.6 3.53501 0 19.58 1 0.871 6.152 82.6 1.7455 5 403 14.7
Cambridge 3535 -71.0667 42.22 13.1 2.44668 0 19.58 0 0.871 5.272 94 1.7364 5 403 14.7
Cambridge 3536 -71.069 42.2285 41.3 1.22358 0 19.58 0 0.605 6.943 97.4 1.8773 5 403 14.7
Cambridge 3537 -71.067 42.2245 24.3 1.34284 0 19.58 0 0.605 6.066 100 1.7573 5 403 14.7
Cambridge 3538 -71.065 42.2223 23.3 1.42502 0 19.58 0 0.871 6.51 100 1.7659 5 403 14.7
Cambridge 3539 -71.07 42.2214 27 1.27346 0 19.58 1 0.605 6.25 92.6 1.7984 5 403 14.7
Cambridge 3540 -71.0735 42.2282 50 1.46336 0 19.58 0 0.605 7.489 90.8 1.9709 5 403 14.7
Cambridge 3541 -71.077 42.225 50 1.83377 0 19.58 1 0.605 7.802 98.2 2.0407 5 403 14.7
Cambridge 3542 -71.0815 42.225 50 1.51902 0 19.58 1 0.605 8.375 93.9 2.162 5 403 14.7
Cambridge 3543 -71.0918 42.2265 22.7 2.24236 0 19.58 0 0.605 5.854 91.8 2.422 5 403 14.7
Cambridge 3544 -71.082 42.2295 25 2.924 0 19.58 0 0.605 6.101 93 2.2834 5 403 14.7
Cambridge 3545 -71.077 42.2305 50 2.01019 0 19.58 0 0.605 7.929 96.2 2.0459 5 403 14.7
Cambridge 3546 -71.0866 42.2345 23.8 1.80028 0 19.58 0 0.605 5.877 79.2 2.4259 5 403 14.7
Cambridge 3547 -71.074 42.2331 23.8 2.3004 0 19.58 0 0.605 6.319 96.1 2.1 5 403 14.7
Cambridge 3548 -71.0775 42.2351 22.3 2.44953 0 19.58 0 0.605 6.402 95.2 2.2625 5 403 14.7
Cambridge 3549 -71.081 42.2368 17.4 1.20742 0 19.58 0 0.605 5.875 94.6 2.4259 5 403 14.7
Cambridge 3550 -71.0792 42.239 19.1 2.3139 0 19.58 0 0.605 5.88 97.3 2.3887 5 403 14.7
Arlington 3561 -71.087 42.2416 23.1 0.13914 0 4.05 0 0.51 5.572 88.5 2.5961 5 296 16.6
Arlington 3562 -71.0855 42.245 23.6 0.09178 0 4.05 0 0.51 6.416 84.1 2.6463 5 296 16.6
Arlington 3563 -71.0833 42.2475 22.6 0.08447 0 4.05 0 0.51 5.859 68.7 2.7019 5 296 16.6
Arlington 3564 -71.094 42.2575 29.4 0.06664 0 4.05 0 0.51 6.546 33.1 3.1323 5 296 16.6
Arlington 3565 -71.1125 42.255 23.2 0.07022 0 4.05 0 0.51 6.02 47.2 3.5549 5 296 16.6
Arlington 3566 -71.106 42.2512 24.6 0.05425 0 4.05 0 0.51 6.315 73.4 3.3175 5 296 16.6
Arlington 3567 -71.0965 42.247 29.9 0.06642 0 4.05 0 0.51 6.86 74.4 2.9153 5 296 16.6
Belmont 3571 -71.1 42.2408 37.2 0.0578 0 2.46 0 0.488 6.98 58.4 2.829 3 193 17.8
Belmont 3572 -71.0995 42.2345 39.8 0.06588 0 2.46 0 0.488 7.765 83.3 2.741 3 193 17.8
Belmont 3573 -71.0966 42.2282 36.2 0.06888 0 2.46 0 0.488 6.144 62.2 2.5979 3 193 17.8
Belmont 3574 -71.1005 42.2287 37.9 0.09103 0 2.46 0 0.488 7.155 92.2 2.7006 3 193 17.8
Belmont 3575 -71.1065 42.23 32.5 0.10008 0 2.46 0 0.488 6.563 95.6 2.847 3 193 17.8
Belmont 3576 -71.112 42.23 26.4 0.08308 0 2.46 0 0.488 5.604 89.8 2.9879 3 193 17.8
Belmont 3577 -71.1175 42.235 29.6 0.06047 0 2.46 0 0.488 6.153 68.8 3.2797 3 193 17.8
Belmont 3578 -71.1115 42.2442 50 0.05602 0 2.46 0 0.488 7.831 53.6 3.1992 3 193 17.8
Lexington 3581 -71.122 42.2565 32 0.07875 45 3.44 0 0.437 6.782 41.1 3.7886 5 398 15.2
Lexington 3583 -71.1408 42.255 29.8 0.12579 45 3.44 0 0.437 6.556 29.1 4.5667 5 398 15.2
Lexington 3584 -71.145 42.2651 34.9 0.0837 45 3.44 0 0.437 7.185 38.9 4.5667 5 398 15.2
Lexington 3585 -71.1216 42.27 33 0.09068 45 3.44 0 0.437 6.951 21.5 6.4798 5 398 15.2
Lexington 3586 -71.1485 42.2765 30.5 0.06911 45 3.44 0 0.437 6.739 30.8 6.4798 5 398 15.2
Lexington 3587 -71.134 42.2785 36.4 0.08664 45 3.44 0 0.437 7.178 26.3 6.4798 5 398 15.2
Bedford 3591 -71.1525 42.3 31.1 0.02187 60 2.93 0 0.401 6.8 9.9 6.2196 1 265 15.6
Bedford 3592 -71.1633 42.303 29.1 0.01439 60 2.93 0 0.401 6.604 18.8 6.2196 1 265 15.6
Lincoln 3602 -71.189 42.2525 50 0.01381 80 0.46 0 0.422 7.875 32 5.6484 4 255 14.4
Concord 3611 -71.22 42.2715 33.3 0.04011 80 1.52 0 0.404 7.287 34.1 7.309 2 329 12.6
Concord 3612 -71.24 42.2725 30.3 0.04666 80 1.52 0 0.404 7.107 36.6 7.309 2 329 12.6
Concord 3613 -71.222 42.289 34.6 0.03768 80 1.52 0 0.404 7.274 38.3 7.309 2 329 12.6
Sudbury 3651 -71.244 42.2425 34.9 0.0315 95 1.47 0 0.403 6.975 15.3 7.6534 3 402 17
Sudbury 3652 -71.263 42.2225 32.9 0.01778 95 1.47 0 0.403 7.135 13.9 7.6534 3 402 17
Wayland 3661 -71.2185 42.1955 24.1 0.03445 82.5 2.03 0 0.415 6.162 38.4 6.27 2 348 14.7
Wayland 3662 -71.214 42.218 42.3 0.02177 82.5 2.03 0 0.415 7.61 15.7 6.27 2 348 14.7
Weston 3671 -71.199 42.232 48.5 0.0351 95 2.68 0 0.4161 7.853 33.2 5.118 4 224 14.7
Weston 3672 -71.199 42.2058 50 0.02009 95 2.68 0 0.4161 8.034 31.9 5.118 4 224 14.7
Waltham 3681 -71.1475 42.2445 22.6 0.13642 0 10.59 0 0.489 5.891 22.3 3.9454 4 277 18.6
Waltham 3682 -71.15 42.2308 24.4 0.22969 0 10.59 0 0.489 6.326 52.5 4.3549 4 277 18.6
Waltham 3683 -71.149 42.2268 22.5 0.25199 0 10.59 0 0.489 5.783 72.7 4.3549 4 277 18.6
Waltham 3684 -71.1503 42.222 24.4 0.13587 0 10.59 1 0.489 6.064 59.1 4.2392 4 277 18.6
Waltham 3685 -71.143 42.2217 20 0.43571 0 10.59 1 0.489 5.344 100 3.875 4 277 18.6
Waltham 3686 -71.1435 42.2177 21.7 0.17446 0 10.59 1 0.489 5.96 92.1 3.8771 4 277 18.6
Waltham 3687 -71.138 42.2216 19.3 0.37578 0 10.59 1 0.489 5.404 88.6 3.665 4 277 18.6
Waltham 3688 -71.1335 42.225 22.4 0.21719 0 10.59 1 0.489 5.807 53.8 3.6526 4 277 18.6
Waltham 3689 -71.1375 42.2355 28.1 0.14052 0 10.59 0 0.489 6.375 32.3 3.9454 4 277 18.6
Waltham 3690 -71.127 42.235 23.7 0.28955 0 10.59 0 0.489 5.412 9.8 3.5875 4 277 18.6
Waltham 3691 -71.1245 42.2277 25 0.19802 0 10.59 0 0.489 6.182 42.4 3.9454 4 277 18.6
Watertown 3701 -71.1166 42.223 23.3 0.0456 0 13.89 1 0.55 5.888 56 3.1121 5 276 16.4
Watertown 3702 -71.105 42.2235 28.7 0.07013 0 13.89 0 0.55 6.642 85.1 3.4211 5 276 16.4
Watertown 3703 -71.0933 42.222 21.5 0.11069 0 13.89 1 0.55 5.951 93.8 2.8893 5 276 16.4
Watertown 3704 -71.106 42.2185 23 0.11425 0 13.89 1 0.55 6.373 92.4 3.3633 5 276 16.4
Newton 3731 -71.11 42.2137 26.7 0.35809 0 6.2 1 0.507 6.951 88.5 2.8617 8 307 17.4
Newton 3732 -71.121 42.2166 21.7 0.40771 0 6.2 1 0.507 6.164 91.3 3.048 8 307 17.4
Newton 3733 -71.125 42.2134 27.5 0.62356 0 6.2 1 0.507 6.879 77.7 3.2721 8 307 17.4
Newton 3734 -71.1208 42.2183 30.1 0.6147 0 6.2 0 0.507 6.618 80.8 3.2721 8 307 17.4
Newton 3735 -71.11 42.206 44.8 0.31533 0 6.2 0 0.504 8.266 78.3 2.8944 8 307 17.4
Newton 3736 -71.1012 42.1975 50 0.52693 0 6.2 0 0.504 8.725 83 2.8944 8 307 17.4
Newton 3737 -71.1215 42.2025 37.6 0.38214 0 6.2 0 0.504 8.04 86.5 3.2157 8 307 17.4
Newton 3738 -71.116 42.1947 31.6 0.41238 0 6.2 0 0.504 7.163 79.9 3.2157 8 307 17.4
Newton 3739 -71.11 42.185 46.7 0.29819 0 6.2 0 0.504 7.686 17 3.3751 8 307 17.4
Newton 3740 -71.119 42.1807 31.5 0.44178 0 6.2 0 0.504 6.552 21.4 3.3751 8 307 17.4
Newton 3741 -71.13 42.188 24.3 0.537 0 6.2 0 0.504 5.981 68.1 3.6715 8 307 17.4
Newton 3742 -71.1285 42.193 31.7 0.46296 0 6.2 0 0.504 7.412 76.9 3.6715 8 307 17.4
Newton 3743 -71.14 42.1946 41.7 0.57529 0 6.2 0 0.507 8.337 73.3 3.8384 8 307 17.4
Newton 3744 -71.134 42.204 48.3 0.33147 0 6.2 0 0.507 8.247 70.4 3.6519 8 307 17.4
Newton 3745 -71.132 42.2142 29 0.44791 0 6.2 1 0.507 6.726 66.5 3.6519 8 307 17.4
Newton 3746 -71.138 42.2141 24 0.33045 0 6.2 0 0.507 6.086 61.5 3.6519 8 307 17.4
Newton 3747 -71.1485 42.211 25.1 0.52058 0 6.2 1 0.507 6.631 76.5 4.148 8 307 17.4
Newton 3748 -71.1491 42.203 31.5 0.51183 0 6.2 0 0.507 7.358 71.6 4.148 8 307 17.4
Natick 3821 -71.2055 42.1875 23.7 0.08244 30 4.93 0 0.428 6.481 18.5 6.1899 6 300 16.6
Natick 3822 -71.2035 42.187 23.3 0.09252 30 4.93 0 0.428 6.606 42.2 6.1899 6 300 16.6
Natick 3823 -71.1966 42.164 27 0.11329 30 4.93 0 0.428 6.897 54.3 6.3361 6 300 16.6
Natick 3824 -71.2138 42.1645 20.1 0.10612 30 4.93 0 0.428 6.095 65.1 6.3361 6 300 16.6
Natick 3825 -71.22 42.1782 22.2 0.1029 30 4.93 0 0.428 6.358 52.9 7.0355 6 300 16.6
Natick 3826 -71.232 42.1725 23.7 0.12757 30 4.93 0 0.428 6.393 7.8 7.0355 6 300 16.6
Framingham 3831 -71.2435 42.163 17.6 0.20608 22 5.86 0 0.431 5.593 76.5 7.9549 7 330 19.1
Framingham 3832 -71.2575 42.1618 18.5 0.19133 22 5.86 0 0.431 5.605 70.2 7.9549 7 330 19.1
Framingham 3833 -71.262 42.169 24.3 0.33983 22 5.86 0 0.431 6.108 34.9 8.0555 7 330 19.1
Framingham 3834 -71.247 42.1703 20.5 0.19657 22 5.86 0 0.431 6.226 79.2 8.0555 7 330 19.1
Framingham 3835 -71.255 42.1767 24.5 0.16439 22 5.86 0 0.431 6.433 49.1 7.8265 7 330 19.1
Framingham 3836 -71.2475 42.1825 26.2 0.19073 22 5.86 0 0.431 6.718 17.5 7.8265 7 330 19.1
Framingham 3837 -71.238 42.191 24.4 0.1403 22 5.86 0 0.431 6.487 13 7.3967 7 330 19.1
Framingham 3838 -71.2435 42.1982 24.8 0.21409 22 5.86 0 0.431 6.438 8.9 7.3967 7 330 19.1
Framingham 3839 -71.2685 42.1935 29.6 0.08221 22 5.86 0 0.431 6.957 6.8 8.9067 7 330 19.1
Framingham 3840 -71.2807 42.1727 42.8 0.36894 22 5.86 0 0.431 8.259 8.4 8.9067 7 330 19.1
Ashland 3851 -71.2895 42.1575 21.9 0.04819 80 3.64 0 0.392 6.108 32 9.2203 1 315 16.4
Ashland 3852 -71.269 42.1482 20.9 0.03548 80 3.64 0 0.392 5.876 19.1 9.2203 1 315 16.4
Sherborn 3861 -71.223 42.145 44 0.01538 90 3.75 0 0.394 7.454 34.2 6.3361 3 244 15.9
Brookline 4001 -71.0679 42.2073 50 0.61154 20 3.97 0 0.647 8.704 86.9 1.801 5 264 13
Brookline 4002 -71.0727 42.2077 36 0.66351 20 3.97 0 0.647 7.333 100 1.8946 5 264 13
Brookline 4003 -71.0765 42.2075 30.1 0.65665 20 3.97 0 0.647 6.842 100 2.0107 5 264 13
Brookline 4004 -71.08 42.204 33.8 0.54011 20 3.97 0 0.647 7.203 81.8 2.1121 5 264 13
Brookline 4005 -71.079 42.202 43.1 0.53412 20 3.97 0 0.647 7.52 89.4 2.1398 5 264 13
Brookline 4006 -71.0835 42.2 48.8 0.52014 20 3.97 0 0.647 8.398 91.5 2.2885 5 264 13
Brookline 4007 -71.075 42.198 31 0.82526 20 3.97 0 0.647 7.327 94.5 2.0788 5 264 13
Brookline 4008 -71.071 42.203 36.5 0.55007 20 3.97 0 0.647 7.206 91.6 1.9301 5 264 13
Brookline 4009 -71.07 42.2 22.8 0.76162 20 3.97 0 0.647 5.56 62.8 1.9865 5 264 13
Brookline 4010 -71.0725 42.1965 30.7 0.7857 20 3.97 0 0.647 7.014 84.6 2.1329 5 264 13
Brookline 4011 -71.085 42.1925 50 0.57834 20 3.97 0 0.575 8.297 67 2.4216 5 264 13
Brookline 4012 -71.0925 42.2075 43.5 0.5405 20 3.97 0 0.575 7.47 52.6 2.872 5 264 13
Dedham 4021 -71.098 42.154 20.7 0.09065 20 6.96 1 0.464 5.92 61.5 3.9175 3 223 18.6
Dedham 4022 -71.087 42.141 21.1 0.29916 20 6.96 0 0.464 5.856 42.1 4.429 3 223 18.6
Dedham 4023 -71.094 42.1355 25.2 0.16211 20 6.96 0 0.464 6.24 16.3 4.429 3 223 18.6
Dedham 4024 -71.0982 42.1445 24.4 0.1146 20 6.96 0 0.464 6.538 58.7 3.9175 3 223 18.6
Dedham 4025 -71.117 42.151 35.2 0.22188 20 6.96 1 0.464 7.691 51.8 4.3665 3 223 18.6
Needham 4031 -71.1305 42.1675 32.4 0.05644 40 6.41 1 0.447 6.758 32.9 4.0776 4 254 17.6
Needham 4032 -71.138 42.1733 32 0.09604 40 6.41 0 0.447 6.854 42.8 4.2673 4 254 17.6
Needham 4033 -71.1405 42.1632 33.2 0.10469 40 6.41 1 0.447 7.267 49 4.7872 4 254 17.6
Needham 4034 -71.1495 42.173 33.1 0.06127 40 6.41 1 0.447 6.826 27.6 4.8628 4 254 17.6
Needham 4035 -71.1395 42.1813 29.1 0.07978 40 6.41 0 0.447 6.482 32.1 4.1403 4 254 17.6
Wellesley 4041 -71.148 42.188 35.1 0.21038 20 3.33 0 0.4429 6.812 32.2 4.1007 5 216 14.9
Wellesley 4042 -71.166 42.187 45.4 0.03578 20 3.33 0 0.4429 7.82 64.5 4.6947 5 216 14.9
Wellesley 4043 -71.185 42.1848 35.4 0.03705 20 3.33 0 0.4429 6.968 37.2 5.2447 5 216 14.9
Wellesley 4044 -71.1775 42.1735 46 0.06129 20 3.33 1 0.4429 7.645 49.7 5.2119 5 216 14.9
Dover 4051 -71.173 42.1475 50 0.01501 90 1.21 1 0.401 7.923 24.8 5.885 1 198 13.6
Medfield 4061 -71.18 42.1105 32.2 0.00906 90 2.97 0 0.4 7.088 20.8 7.3073 1 285 15.3
Millis 4071 -71.2135 42.1 22 0.01096 55 2.25 0 0.389 6.453 31.9 7.3073 1 300 15.3
Norfolk 4091 -71.195 42.0675 20.1 0.01965 80 1.76 0 0.385 6.23 31.5 9.0892 1 241 18.2
Walpole 4111 -71.148 42.0775 23.2 0.03871 52.5 5.32 0 0.405 6.209 31.3 7.3172 6 293 16.6
Walpole 4112 -71.1325 42.094 22.3 0.0459 52.5 5.32 0 0.405 6.315 45.6 7.3172 6 293 16.6
Walpole 4113 -71.155 42.098 24.8 0.04297 52.5 5.32 0 0.405 6.565 22.9 7.3172 6 293 16.6
Westwood 4121 -71.1385 42.1235 28.5 0.03502 80 4.95 0 0.411 6.861 27.9 5.1167 4 245 19.2
Westwood 4122 -71.133 42.1408 37.3 0.07886 80 4.95 0 0.411 7.148 27.7 5.1167 4 245 19.2
Westwood 4123 -71.107 42.1307 27.9 0.03615 80 4.95 0 0.411 6.63 23.4 5.1167 4 245 19.2
Norwood 4131 -71.109 42.11 23.9 0.08265 0 13.92 0 0.437 6.127 18.4 5.5027 4 289 16
Norwood 4132 -71.118 42.1217 21.7 0.08199 0 13.92 0 0.437 6.009 42.3 5.5027 4 289 16
Norwood 4133 -71.1309 42.1166 28.6 0.12932 0 13.92 0 0.437 6.678 31.1 5.9604 4 289 16
Norwood 4134 -71.128 42.1108 27.1 0.05372 0 13.92 0 0.437 6.549 51 5.9604 4 289 16
Norwood 4135 -71.121 42.1025 20.3 0.14103 0 13.92 0 0.437 5.79 58 6.32 4 289 16
Sharon 4141 -71.12 42.0725 22.5 0.06466 70 2.24 0 0.4 6.345 20.1 7.8278 5 358 14.8
Sharon 4142 -71.1 42.059 29 0.05561 70 2.24 0 0.4 7.041 10 7.8278 5 358 14.8
Sharon 4143 -71.1035 42.0735 24.8 0.04417 70 2.24 0 0.4 6.871 47.4 7.8278 5 358 14.8
Canton 4151 -71.0875 42.095 22 0.03537 34 6.09 0 0.433 6.59 40.4 5.4917 7 329 16.1
Canton 4152 -71.0625 42.102 26.4 0.09266 34 6.09 0 0.433 6.495 18.4 5.4917 7 329 16.1
Canton 4153 -71.0865 42.12 33.1 0.1 34 6.09 0 0.433 6.982 17.7 5.4917 7 329 16.1
Milton 4161 -71.0465 42.145 36.1 0.05515 33 2.18 0 0.472 7.236 41.1 4.022 7 222 18.4
Milton 4162 -71.057 42.1525 28.4 0.05479 33 2.18 0 0.472 6.616 58.1 3.37 7 222 18.4
Milton 4163 -71.045 42.159 33.4 0.07503 33 2.18 0 0.472 7.42 71.9 3.0992 7 222 18.4
Milton 4164 -71.028 42.1565 28.2 0.04932 33 2.18 0 0.472 6.849 70.3 3.1827 7 222 18.4
Quincy 4171 -71.0138 42.1555 22.8 0.49298 0 9.9 0 0.544 6.635 82.5 3.3175 4 304 18.4
Quincy 4172 -71.0201 42.16 20.3 0.3494 0 9.9 0 0.544 5.972 76.7 3.1025 4 304 18.4
Quincy 4173 -71.016 42.176 16.1 2.63548 0 9.9 0 0.544 4.973 37.8 2.5194 4 304 18.4
Quincy 4174 -71.0075 42.178 22.1 0.79041 0 9.9 0 0.544 6.122 52.8 2.6403 4 304 18.4
Quincy 4175 -71.015 42.167 19.4 0.26169 0 9.9 0 0.544 6.023 90.4 2.834 4 304 18.4
Quincy 4176 -71.0075 42.1613 21.6 0.26938 0 9.9 0 0.544 6.266 82.8 3.2628 4 304 18.4
Quincy 4177 -71 42.153 23.8 0.3692 0 9.9 0 0.544 6.567 87.3 3.6023 4 304 18.4
Quincy 4178 -70.9795 42.158 16.2 0.25356 0 9.9 0 0.544 5.705 77.7 3.945 4 304 18.4
Quincy 4179 -70.988 42.1485 17.8 0.31827 0 9.9 0 0.544 5.914 83.2 3.9986 4 304 18.4
Quincy 4180 -71.004 42.1425 19.8 0.24522 0 9.9 0 0.544 5.782 71.7 4.0317 4 304 18.4
Quincy 4181 -71.01 42.15 23.1 0.40202 0 9.9 0 0.544 6.382 67.2 3.5325 4 304 18.4
Quincy 4182 -71.02 42.151 21 0.47547 0 9.9 0 0.544 6.113 58.8 4.0019 4 304 18.4
Braintree 4191 -71.0085 42.129 23.8 0.1676 0 7.38 0 0.493 6.426 52.3 4.5404 5 287 19.6
Braintree 4192 -70.9975 42.134 23.1 0.18159 0 7.38 0 0.493 6.376 54.3 4.5404 5 287 19.6
Braintree 4193 -70.99 42.1367 20.4 0.35114 0 7.38 0 0.493 6.041 49.9 4.7211 5 287 19.6
Braintree 4194 -70.9834 42.1375 18.5 0.28392 0 7.38 0 0.493 5.708 74.3 4.7211 5 287 19.6
Braintree 4195 -70.9895 42.1265 25 0.34109 0 7.38 0 0.493 6.415 40.1 4.7211 5 287 19.6
Braintree 4196 -71 42.1066 24.6 0.19186 0 7.38 0 0.493 6.431 14.7 5.4159 5 287 19.6
Braintree 4197 -70.9995 42.1175 23 0.30347 0 7.38 0 0.493 6.312 28.9 5.4159 5 287 19.6
Braintree 4198 -71.01 42.1215 22.2 0.24103 0 7.38 0 0.493 6.083 43.7 5.4159 5 287 19.6
Randolph 4201 -71.0275 42.113 19.3 0.06617 0 3.24 0 0.46 5.868 25.8 5.2146 4 430 16.9
Randolph 4202 -71.0415 42.115 22.6 0.06724 0 3.24 0 0.46 6.333 17.2 5.2146 4 430 16.9
Randolph 4203 -71.025 42.098 19.8 0.04544 0 3.24 0 0.46 6.144 32.2 5.8736 4 430 16.9
Holbrook 4211 -71.0115 42.0865 17.1 0.05023 35 6.06 0 0.4379 5.706 28.4 6.6407 1 304 16.9
Holbrook 4212 -70.996 42.0895 19.4 0.03466 35 6.06 0 0.4379 6.031 23.3 6.6407 1 304 16.9
Weymouth 4221 -70.9795 42.0995 22.2 0.05083 0 5.19 0 0.515 6.316 38.1 6.4584 5 224 20.2
Weymouth 4222 -70.965 42.101 20.7 0.03738 0 5.19 0 0.515 6.31 38.5 6.4584 5 224 20.2
Weymouth 4223 -70.97 42.115 21.1 0.03961 0 5.19 0 0.515 6.037 34.5 5.9853 5 224 20.2
Weymouth 4224 -70.976 42.128 19.5 0.03427 0 5.19 0 0.515 5.869 46.3 5.2311 5 224 20.2
Weymouth 4225 -70.9602 42.127 18.5 0.03041 0 5.19 0 0.515 5.895 59.6 5.615 5 224 20.2
Weymouth 4226 -70.9633 42.1374 20.6 0.03306 0 5.19 0 0.515 6.059 37.3 4.8122 5 224 20.2
Weymouth 4227 -70.9675 42.144 19 0.05497 0 5.19 0 0.515 5.985 45.4 4.8122 5 224 20.2
Weymouth 4228 -70.965 42.1503 18.7 0.06151 0 5.19 0 0.515 5.968 58.5 4.8122 5 224 20.2
Cohasset 4231 -70.8875 42.1465 32.7 0.01301 35 1.52 0 0.442 7.241 49.3 7.0379 1 284 15.5
Hull 5001 -70.915 42.16 16.5 0.02498 0 1.89 0 0.518 6.54 59.7 6.2669 1 422 15.9
Hingham 5011 -70.937 42.1475 23.9 0.02543 55 3.78 0 0.484 6.696 56.4 5.7321 5 370 17.6
Hingham 5012 -70.9325 42.123 31.2 0.03049 55 3.78 0 0.484 6.874 28.1 6.4654 5 370 17.6
Rockland 5021 -70.947 42.0725 17.5 0.03113 0 4.39 0 0.442 6.014 48.5 8.0136 3 352 18.8
Rockland 5022 -70.9501 42.0825 17.2 0.06162 0 4.39 0 0.442 5.898 52.3 8.0136 3 352 18.8
Hanover 5031 -70.9275 42.0795 23.1 0.0187 85 4.15 0 0.429 6.516 27.7 8.5353 4 351 17.9
Norwell 5041 -70.92 42.1016 24.5 0.01501 80 2.01 0 0.435 6.635 29.7 8.344 4 280 17
Scituate 5051 -70.855 42.13 26.6 0.02899 40 1.25 0 0.429 6.939 34.5 8.7921 1 335 19.7
Scituate 5052 -70.833 42.115 22.9 0.06211 40 1.25 0 0.429 6.49 44.4 8.7921 1 335 19.7
Marshfield 5061 -70.83 42.0775 24.1 0.0795 60 1.69 0 0.411 6.579 35.9 10.7103 4 411 18.3
Marshfield 5062 -70.81 42.059 18.6 0.07244 60 1.69 0 0.411 5.884 18.5 10.7103 4 411 18.3
Duxbury 5071 -70.83 42.0485 30.1 0.01709 90 2.02 0 0.41 6.728 36.1 12.1265 5 187 17
Pembroke 5081 -70.853 42.052 18.2 0.04301 80 1.91 0 0.413 5.663 21.9 10.5857 4 334 22
Pembroke 5082 -70.8525 42.03 20.6 0.10659 80 1.91 0 0.413 5.936 19.5 10.5857 4 334 22
Boston Allston-Brighton 1 -71.083 42.2172 17.8 8.98296 0 18.1 1 0.77 6.212 97.4 2.1222 24 666 20.2
Boston Allston-Brighton 2 -71.095 42.212 21.7 3.8497 0 18.1 1 0.77 6.395 91 2.5052 24 666 20.2
Boston Allston-Brighton 3 -71.1007 42.21 22.7 5.20177 0 18.1 1 0.77 6.127 83.4 2.7227 24 666 20.2
Boston Allston-Brighton 4 -71.093 42.207 22.6 4.26131 0 18.1 0 0.77 6.112 81.3 2.5091 24 666 20.2
Boston Allston-Brighton 5 -71.0905 42.2033 25 4.54192 0 18.1 0 0.77 6.398 88 2.5182 24 666 20.2
Boston Allston-Brighton 6 -71.0865 42.21 19.9 3.83684 0 18.1 0 0.77 6.251 91.1 2.2955 24 666 20.2
Boston Allston-Brighton 7 -71.081 42.208 20.8 3.67822 0 18.1 0 0.77 5.362 96.2 2.1036 24 666 20.2
Boston Allston-Brighton 8 -71.0865 42.215 16.8 4.22239 0 18.1 1 0.77 5.803 89 1.9047 24 666 20.2
Boston Back Bay 101 -71.059 42.2098 21.9 3.47428 0 18.1 1 0.718 8.78 82.9 1.9047 24 666 20.2
Boston Back Bay 102 -71.0595 42.2075 27.5 4.55587 0 18.1 0 0.718 3.561 87.9 1.6132 24 666 20.2
Boston Back Bay 104 -71.054 42.2052 21.9 3.69695 0 18.1 0 0.718 4.963 91.4 1.7523 24 666 20.2
Boston Back Bay 105 -71.0508 42.207 23.1 13.5222 0 18.1 0 0.631 3.863 100 1.5106 24 666 20.2
Boston Back Bay 107 -71.048 42.2105 50 4.89822 0 18.1 0 0.631 4.97 100 1.3325 24 666 20.2
Boston Back Bay 108 -71.0497 42.2125 50 5.66998 0 18.1 1 0.631 6.683 96.8 1.3567 24 666 20.2
Boston Beacon Hill 201 -71.0422 42.2144 50 6.53876 0 18.1 1 0.631 7.016 97.5 1.2024 24 666 20.2
Boston Beacon Hill 202 -71.0417 42.216 50 9.2323 0 18.1 0 0.631 6.216 100 1.1691 24 666 20.2
Boston Beacon Hill 203 -71.0397 42.2182 50 8.26725 0 18.1 1 0.668 5.875 89.6 1.1296 24 666 20.2
Boston North End 301 -71.0339 42.2207 13.8 11.1081 0 18.1 0 0.668 4.906 100 1.1742 24 666 20.2
Boston North End 302 -71.0346 42.2187 13.8 18.4982 0 18.1 0 0.668 4.138 100 1.137 24 666 20.2
Boston Charlestown 401 -71.0367 42.224 15 19.6091 0 18.1 0 0.671 7.313 97.9 1.3163 24 666 20.2
Boston Charlestown 402 -71.034 42.226 13.9 15.288 0 18.1 0 0.671 6.649 93.3 1.3449 24 666 20.2
Boston Charlestown 403 -71.038 42.2265 13.3 9.82349 0 18.1 0 0.671 6.794 98.8 1.358 24 666 20.2
Boston Charlestown 404 -71.04 42.2248 13.1 23.6482 0 18.1 0 0.671 6.38 96.2 1.3861 24 666 20.2
Boston Charlestown 405 -71.04 42.2275 10.2 17.8667 0 18.1 0 0.671 6.223 100 1.3861 24 666 20.2
Boston Charlestown 406 -71.046 42.23 10.4 88.9762 0 18.1 0 0.671 6.968 91.9 1.4165 24 666 20.2
Boston East Boston 407 -71.041 42.229 10.9 15.8744 0 18.1 0 0.671 6.545 99.1 1.5192 24 666 20.2
Boston East Boston 501 -71.023 42.2287 11.3 9.18702 0 18.1 0 0.7 5.536 100 1.5804 24 666 20.2
Boston East Boston 502 -71.0215 42.227 12.3 7.99248 0 18.1 0 0.7 5.52 100 1.5331 24 666 20.2
Boston East Boston 503 -71.0245 42.2235 8.8 20.0849 0 18.1 0 0.7 4.368 91.2 1.4395 24 666 20.2
Boston East Boston 504 -71.0235 42.2213 7.2 16.8118 0 18.1 0 0.7 5.277 98.1 1.4261 24 666 20.2
Boston East Boston 506 -71.0228 42.2231 10.5 24.3938 0 18.1 0 0.7 4.652 100 1.4672 24 666 20.2
Boston East Boston 507 -71.0215 42.2248 7.4 22.5971 0 18.1 0 0.7 5 89.5 1.5184 24 666 20.2
Boston East Boston 508 -71.0195 42.2255 10.2 14.3337 0 18.1 0 0.7 4.88 100 1.5895 24 666 20.2
Boston East Boston 509 -71.0168 42.2281 11.5 8.15174 0 18.1 0 0.7 5.39 98.9 1.7281 24 666 20.2
Boston East Boston 510 -71.0109 42.23 15.1 6.96215 0 18.1 0 0.7 5.713 97 1.9265 24 666 20.2
Boston East Boston 511 -71.0035 42.233 23.2 5.29305 0 18.1 0 0.7 6.051 82.5 2.1678 24 666 20.2
Boston East Boston 512 -71.02 42.2205 9.7 11.5779 0 18.1 0 0.7 5.036 97 1.77 24 666 20.2
Boston South Boston 601 -71.0167 42.201 13.8 8.64476 0 18.1 0 0.693 6.193 92.6 1.7912 24 666 20.2
Boston South Boston 602 -71.02 42.1993 12.7 13.3598 0 18.1 0 0.693 5.887 94.7 1.7821 24 666 20.2
Boston South Boston 603 -71.022 42.1996 13.1 8.71675 0 18.1 0 0.693 6.471 98.8 1.7257 24 666 20.2
Boston South Boston 604 -71.026 42.1993 12.5 5.87205 0 18.1 0 0.693 6.405 96 1.6768 24 666 20.2
Boston South Boston 605 -71.025 42.2024 8.5 7.67202 0 18.1 0 0.693 5.747 98.9 1.6334 24 666 20.2
Boston South Boston 606 -71.023 42.209 5 38.3518 0 18.1 0 0.693 5.453 100 1.4896 24 666 20.2
Boston South Boston 607 -71.033 42.2032 6.3 9.91655 0 18.1 0 0.693 5.852 77.8 1.5004 24 666 20.2
Boston South Boston 608 -71.0326 42.2011 5.6 25.0461 0 18.1 0 0.693 5.987 100 1.5888 24 666 20.2
Boston South Boston 609 -71.03 42.2015 7.2 14.2362 0 18.1 0 0.693 6.343 100 1.5741 24 666 20.2
Boston South Boston 610 -71.03 42.1988 12.1 9.59571 0 18.1 0 0.693 6.404 100 1.639 24 666 20.2
Boston South Boston 612 -71.0332 42.198 8.3 24.8017 0 18.1 0 0.693 5.349 96 1.7028 24 666 20.2
Boston South Boston 613 -71.0345 42.2001 8.5 41.5292 0 18.1 0 0.693 5.531 85.4 1.6074 24 666 20.2
Boston South Boston 614 -71.032 42.2057 5 67.9208 0 18.1 0 0.693 5.683 100 1.4254 24 666 20.2
Boston Downtown 702 -71.039 42.2198 11.9 20.7162 0 18.1 0 0.659 4.138 100 1.1781 24 666 20.2
Boston Downtown 703 -71.0427 42.209 27.9 11.9511 0 18.1 0 0.659 5.608 100 1.2852 24 666 20.2
Boston Downtown 705 -71.0437 42.205 17.2 7.40389 0 18.1 0 0.597 5.617 97.9 1.4547 24 666 20.2
Boston Downtown 706 -71.0455 42.206 27.5 14.4383 0 18.1 0 0.597 6.852 100 1.4655 24 666 20.2
Boston Downtown 707 -71.0462 42.2075 15 51.1358 0 18.1 0 0.597 5.757 100 1.413 24 666 20.2
Boston Downtown 708 -71.0487 42.2048 17.2 14.0507 0 18.1 0 0.597 6.657 100 1.5275 24 666 20.2
Boston Downtown 709 -71.047 42.203 17.9 18.811 0 18.1 0 0.597 4.628 100 1.5539 24 666 20.2
Boston Downtown 710 -71.0451 42.2015 16.3 28.6558 0 18.1 0 0.597 5.155 100 1.5894 24 666 20.2
Boston Roxbury 801 -71.042 42.1985 7 45.7461 0 18.1 0 0.693 4.519 100 1.6582 24 666 20.2
Boston Roxbury 802 -71.0455 42.1953 7.2 18.0846 0 18.1 0 0.679 6.434 100 1.8347 24 666 20.2
Boston Roxbury 803 -71.0477 42.1965 7.5 10.8342 0 18.1 0 0.679 6.782 90.8 1.8195 24 666 20.2
Boston Roxbury 805 -71.0498 42.2007 10.4 25.9406 0 18.1 0 0.679 5.304 89.1 1.6475 24 666 20.2
Boston Roxbury 807 -71.0525 42.1989 8.8 73.5341 0 18.1 0 0.679 5.957 100 1.8026 24 666 20.2
Boston Roxbury 808 -71.0586 42.1999 8.4 11.8123 0 18.1 0 0.718 6.824 76.5 1.794 24 666 20.2
Boston Roxbury 809 -71.0618 42.199 16.7 11.0874 0 18.1 0 0.718 6.411 100 1.8589 24 666 20.2
Boston Roxbury 810 -71.065 42.2018 14.2 7.02259 0 18.1 0 0.718 6.006 95.3 1.8746 24 666 20.2
Boston Roxbury 811 -71.0665 42.197 20.8 12.0482 0 18.1 0 0.614 5.648 87.6 1.9512 24 666 20.2
Boston Roxbury 812 -71.0619 42.1948 13.4 7.05042 0 18.1 0 0.614 6.103 85.1 2.0218 24 666 20.2
Boston Roxbury 813 -71.059 42.192 11.7 8.79212 0 18.1 0 0.584 5.565 70.6 2.0635 24 666 20.2
Boston Roxbury 814 -71.0577 42.1967 8.3 15.8603 0 18.1 0 0.679 5.896 95.4 1.9096 24 666 20.2
Boston Roxbury 815 -71.0558 42.1937 10.2 12.2472 0 18.1 0 0.584 5.837 59.7 1.9976 24 666 20.2
Boston Roxbury 816 -71.0542 42.1961 10.9 37.6619 0 18.1 0 0.679 6.202 78.7 1.8629 24 666 20.2
Boston Roxbury 817 -71.0521 42.194 11 7.36711 0 18.1 0 0.679 6.193 78.1 1.9356 24 666 20.2
Boston Roxbury 818 -71.0485 42.192 9.5 9.33889 0 18.1 0 0.679 6.38 95.6 1.9682 24 666 20.2
Boston Roxbury 819 -71.0547 42.189 14.5 8.49213 0 18.1 0 0.584 6.348 86.1 2.0527 24 666 20.2
Boston Roxbury 820 -71.0505 42.188 14.1 10.0623 0 18.1 0 0.584 6.833 94.3 2.0882 24 666 20.2
Boston Roxbury 821 -71.052 42.1854 16.1 6.44405 0 18.1 0 0.584 6.425 74.8 2.2004 24 666 20.2
Boston Savin Hill 901 -71.0495 42.1815 14.3 5.58107 0 18.1 0 0.713 6.436 87.9 2.3158 24 666 20.2
Boston Savin Hill 902 -71.0475 42.1842 11.7 13.9134 0 18.1 0 0.713 6.208 95 2.2222 24 666 20.2
Boston Savin Hill 903 -71.046 42.1867 13.4 11.1604 0 18.1 0 0.74 6.629 94.6 2.1247 24 666 20.2
Boston Savin Hill 904 -71.0455 42.1893 9.6 14.4208 0 18.1 0 0.74 6.461 93.3 2.0026 24 666 20.2
Boston Savin Hill 905 -71.0445 42.1917 8.2 15.1772 0 18.1 0 0.74 6.152 100 1.9142 24 666 20.2
Boston Savin Hill 906 -71.0445 42.1938 8.4 13.6781 0 18.1 0 0.74 5.935 87.9 1.8206 24 666 20.2
Boston Savin Hill 907 -71.037 42.194 12.8 9.39063 0 18.1 0 0.74 5.627 93.9 1.8172 24 666 20.2
Boston Savin Hill 908 -71.0321 42.1925 10.5 22.0511 0 18.1 0 0.74 5.818 92.4 1.8662 24 666 20.2
Boston Savin Hill 910 -71.0345 42.185 17.1 9.72418 0 18.1 0 0.74 6.406 97.2 2.0651 24 666 20.2
Boston Savin Hill 911 -71.034 42.189 14.8 5.66637 0 18.1 0 0.74 6.219 100 2.0048 24 666 20.2
Boston Savin Hill 912 -71.0378 42.1892 15.4 9.96654 0 18.1 0 0.74 6.485 100 1.9784 24 666 20.2
Boston Savin Hill 913 -71.0405 42.192 10.8 12.8023 0 18.1 0 0.74 5.854 96.6 1.8956 24 666 20.2
Boston Savin Hill 914 -71.0425 42.189 11.8 10.6718 0 18.1 0 0.74 6.459 94.8 1.9879 24 666 20.2
Boston Savin Hill 915 -71.039 42.1868 14.9 6.28807 0 18.1 0 0.74 6.341 96.4 2.072 24 666 20.2
Boston Savin Hill 916 -71.037 42.184 12.6 9.92485 0 18.1 0 0.74 6.251 96.6 2.198 24 666 20.2
Boston Savin Hill 917 -71.04 42.182 14.1 9.32909 0 18.1 0 0.713 6.185 98.7 2.2616 24 666 20.2
Boston Savin Hill 918 -71.0428 42.1845 13 7.52601 0 18.1 0 0.713 6.417 98.3 2.185 24 666 20.2
Boston Savin Hill 919 -71.046 42.181 13.4 6.71772 0 18.1 0 0.713 6.749 92.6 2.3236 24 666 20.2
Boston Savin Hill 920 -71.041 42.1795 15.2 5.44114 0 18.1 0 0.713 6.655 98.2 2.3552 24 666 20.2
Boston Savin Hill 921 -71.034 42.179 16.1 5.09017 0 18.1 0 0.713 6.297 91.8 2.3682 24 666 20.2
Boston Savin Hill 922 -71.04 42.177 17.8 8.24809 0 18.1 0 0.713 7.393 99.3 2.4527 24 666 20.2
Boston Savin Hill 923 -71.0455 42.1768 14.4 9.51363 0 18.1 0 0.713 6.728 94.1 2.4961 24 666 20.2
Boston Savin Hill 924 -71.051 42.178 14.1 4.75237 0 18.1 0 0.713 6.525 86.5 2.4358 24 666 20.2
Boston Dorchester 1001 -71.0517 42.1735 12.7 4.66883 0 18.1 0 0.713 5.976 87.9 2.5806 24 666 20.2
Boston Dorchester 1002 -71.0515 42.17 13.5 8.20058 0 18.1 0 0.713 5.936 80.3 2.7792 24 666 20.2
Boston Dorchester 1003 -71.0475 42.169 14.9 7.75223 0 18.1 0 0.713 6.301 83.7 2.7831 24 666 20.2
Boston Dorchester 1004 -71.043 42.169 20 6.80117 0 18.1 0 0.713 6.081 84.4 2.7175 24 666 20.2
Boston Dorchester 1005 -71.043 42.1728 16.4 4.81213 0 18.1 0 0.713 6.701 90 2.5975 24 666 20.2
Boston Dorchester 1006 -71.035 42.1745 17.7 3.69311 0 18.1 0 0.713 6.376 88.4 2.5671 24 666 20.2
Boston Dorchester 1007 -71.031 42.1695 19.5 6.65492 0 18.1 0 0.713 6.317 83 2.7344 24 666 20.2
Boston Dorchester 1008 -71.0358 42.1675 20.2 5.82115 0 18.1 0 0.713 6.513 89.9 2.8016 24 666 20.2
Boston Dorchester 1009 -71.045 42.164 21.4 7.83932 0 18.1 0 0.655 6.209 65.4 2.9634 24 666 20.2
Boston Dorchester 1010 -71.055 42.165 19.9 3.1636 0 18.1 0 0.655 5.759 48.2 3.0665 24 666 20.2
Boston Dorchester 1011 -71.055 42.1685 19 3.77498 0 18.1 0 0.655 5.952 84.7 2.8715 24 666 20.2
Boston Mattapan 1101 -71.066 42.178 19.1 4.42228 0 18.1 0 0.584 6.003 94.5 2.5403 24 666 20.2
Boston Mattapan 1102 -71.07 42.168 19.1 15.5757 0 18.1 0 0.58 5.926 71 2.9084 24 666 20.2
Boston Mattapan 1103 -71.069 42.1725 20.1 13.0751 0 18.1 0 0.58 5.713 56.7 2.8237 24 666 20.2
Boston Mattapan 1104 -71.074 42.168 19.9 4.34879 0 18.1 0 0.58 6.167 84 3.0334 24 666 20.2
Boston Mattapan 1105 -71.0825 42.1698 19.6 4.03841 0 18.1 0 0.532 6.229 90.7 3.0993 24 666 20.2
Boston Mattapan 1106 -71.0833 42.175 23.2 3.56868 0 18.1 0 0.58 6.437 75 2.8965 24 666 20.2
Boston Forest Hills 1201 -71.0732 42.184 29.8 4.64689 0 18.1 0 0.614 6.98 67.6 2.5329 24 666 20.2
Boston Forest Hills 1202 -71.055 42.183 13.8 8.05579 0 18.1 0 0.584 5.427 95.4 2.4298 24 666 20.2
Boston Forest Hills 1203 -71.0511 42.1879 13.3 6.39312 0 18.1 0 0.584 6.162 97.4 2.206 24 666 20.2
Boston Forest Hills 1204 -71.0565 42.188 16.7 4.87141 0 18.1 0 0.614 6.484 93.6 2.3053 24 666 20.2
Boston Forest Hills 1205 -71.0528 42.192 12 15.0234 0 18.1 0 0.614 5.304 97.3 2.1007 24 666 20.2
Boston Forest Hills 1206 -71.0558 42.1913 14.6 10.233 0 18.1 0 0.614 6.185 96.7 2.1705 24 666 20.2
Boston Forest Hills 1207 -71.067 42.1945 21.4 14.3337 0 18.1 0 0.614 6.229 88 1.9512 24 666 20.2
Boston West Roxbury 1301 -71.1008 42.174 23 5.82401 0 18.1 0 0.532 6.242 64.7 3.4242 24 666 20.2
Boston West Roxbury 1302 -71.095 42.173 23.7 5.70818 0 18.1 0 0.532 6.75 74.9 3.3317 24 666 20.2
Boston West Roxbury 1303 -71.09 42.1665 25 5.73116 0 18.1 0 0.532 7.061 77 3.4106 24 666 20.2
Boston West Roxbury 1304 -71.0975 42.1608 21.8 2.81838 0 18.1 0 0.532 5.762 40.3 4.0983 24 666 20.2
Boston Hyde Park 1401 -71.0804 42.154 20.6 2.37857 0 18.1 0 0.583 5.871 41.9 3.724 24 666 20.2
Boston Hyde Park 1402 -71.075 42.1455 21.2 3.67367 0 18.1 0 0.583 6.312 51.9 3.9917 24 666 20.2
Boston Hyde Park 1403 -71.0715 42.155 19.1 5.69175 0 18.1 0 0.583 6.114 79.8 3.5459 24 666 20.2
Boston Hyde Park 1404 -71.065 42.161 20.6 4.83567 0 18.1 0 0.583 5.905 53.2 3.1523 24 666 20.2
Chelsea 1601 -71.0189 42.2344 15.2 0.15086 0 27.74 0 0.609 5.454 92.7 1.8209 4 711 20.1
Chelsea 1602 -71.0228 42.2335 7 0.18337 0 27.74 0 0.609 5.414 98.3 1.7554 4 711 20.1
Chelsea 1604 -71.0245 42.2368 8.1 0.20746 0 27.74 0 0.609 5.093 98 1.8226 4 711 20.1
Chelsea 1605 -71.016 42.2382 13.6 0.10574 0 27.74 0 0.609 5.983 98.8 1.8681 4 711 20.1
Chelsea 1606 -71.0297 42.2447 20.1 0.11132 0 27.74 0 0.609 5.983 83.5 2.1099 4 711 20.1
Revere 1701 -71.0125 42.2462 21.8 0.17331 0 9.69 0 0.585 5.707 54 2.3817 6 391 19.2
Revere 1702 -71.0125 42.25 24.5 0.27957 0 9.69 0 0.585 5.926 42.6 2.3817 6 391 19.2
Revere 1703 -71.0105 42.2547 23.1 0.17899 0 9.69 0 0.585 5.67 28.8 2.7986 6 391 19.2
Revere 1704 -71.001 42.2525 19.7 0.2896 0 9.69 0 0.585 5.39 72.9 2.7986 6 391 19.2
Revere 1705 -70.9947 42.2496 18.3 0.26838 0 9.69 0 0.585 5.794 70.6 2.8927 6 391 19.2
Revere 1706 -71.005 42.2455 21.2 0.23912 0 9.69 0 0.585 6.019 65.3 2.4091 6 391 19.2
Revere 1707 -70.9985 42.243 17.5 0.17783 0 9.69 0 0.585 5.569 73.5 2.3999 6 391 19.2
Revere 1708 -70.992 42.238 16.8 0.22438 0 9.69 0 0.585 6.027 79.7 2.4982 6 391 19.2
Winthrop 1801 -70.986 42.2312 22.4 0.06263 0 11.93 0 0.573 6.593 69.1 2.4786 1 273 21
Winthrop 1802 -70.991 42.2275 20.6 0.04527 0 11.93 0 0.573 6.12 76.7 2.2875 1 273 21
Winthrop 1803 -70.9948 42.226 23.9 0.06076 0 11.93 0 0.573 6.976 91 2.1675 1 273 21
Winthrop 1804 -70.9875 42.224 22 0.10959 0 11.93 0 0.573 6.794 89.3 2.3889 1 273 21
Winthrop 1805 -70.9825 42.221 19 0.04741 0 11.93 0 0.573 6.03 80.8 2.505 1 273 21
library(rpart)
library(rpart.plot)
library(caTools)
library(caret)
library(e1071)
boston <- read.csv('boston.csv')
plot(boston$LON, boston$LAT)
# Plot points on map along river.
points(boston$LON[boston$CHAS==1], boston$LAT[boston$CHAS==1], col='blue', pch=19)
# Plot MIT on map.
points(boston$LON[boston$TRACT==3531], boston$LAT[boston$TRACT==3531], col='red', pch=19)
# Plot higher-priced real-estate.
points(boston$LON[boston$MEDV>=21.2], boston$LAT[boston$MEDV>=21.2], col='red', pch=1)
# Try building a linear model to predict house prices by lat and lon.
latlonlm <- lm(MEDV ~ LAT + LON, data=boston)
plot(boston$LON, boston$LAT)
points(boston$LON[boston$MEDV>=21.2], boston$LAT[boston$MEDV>=21.2], col='red', pch=19)
# Where does the linear model think high priced houses are?
# The linear regression model has plotted blue '$' towards the left-side of the map only, missing all the higher priced houses on the right.
# You can see a well defined line where the linear regression cuts off at. This is the problem that using a regression tree can solve.
points(boston$LON[latlonlm$fitted.values>=21.2], boston$LAT[latlonlm$fitted.values>=21.2], col='blue', pch='$')
# Build a regression tree model.
latlontree <- rpart(MEDV ~ LAT + LON, data=boston)
prp(latlontree)
# Plot the original house layout again.
plot(boston$LON, boston$LAT)
points(boston$LON[boston$MEDV>=21.2], boston$LAT[boston$MEDV>=21.2], col='red', pch=19)
# Get the predicted values from the tree.
fittedValues <- predict(latlontree)
# Where does the regression tree think high priced houses are?
# This looks much better. Now the predictions are spread across the map.
points(boston$LON[fittedValues>=21.2], boston$LAT[fittedValues>=21.2], col='blue', pch='$')
# Try simplifying the tree.
latlontree <- rpart(MEDV ~ LAT + LON, data=boston, minbucket=50)
plot(latlontree)
text(latlontree)
# Draw the first few divisions from the tree on the map. Notice how the sections are grouped around thicker clusters.
plot(boston$LON, boston$LAT)
abline(v=-71.07)
abline(h=42.21)
abline(h=42.17)
points(boston$LON[boston$MEDV>=21.2], boston$LAT[boston$MEDV>=21.2], col='red', pch=19)
set.seed(123)
# Build a training and test set.
split <- sample.split(boston$MEDV, SplitRatio=0.7)
train <- subset(boston, split==TRUE)
test <- subset(boston, split==FALSE)
# Build a linear regression model on more features.
linreg <- lm(MEDV ~ LAT + LON + CRIM + ZN + INDUS + CHAS + NOX + RM + AGE + DIS + RAD + TAX + PTRATIO, data=train)
# Calculate sum of squared errors: 3037.088
linreg.pred <- predict(linreg, newdata=test)
linreg.sse <- sum((linreg.pred - test$MEDV)^2)
# Plot this linear regression predicted prices.
plot(test$LON, test$LAT)
points(test$LON[test$MEDV>=21.2], test$LAT[test$MEDV>=21.2], col='red', pch=19)
points(test$LON[linreg.pred>=21.2], test$LAT[linreg.pred>=21.2], col='blue', pch='!')
# Build a regression tree.
tree <- rpart(MEDV ~ LAT + LON + CRIM + ZN + INDUS + CHAS + NOX + RM + AGE + DIS + RAD + TAX + PTRATIO, data=train)
prp(tree)
# Calculate sum of squared errors: 4328.988
# Regression trees are not as good as linear regression for this problem.
tree.pred <- predict(tree, newdata=test)
tree.sse <- sum((tree.pred - test$MEDV)^2)
# Use cross-validation to determine the optimal minimum number of branches for our tree model.
tr.control <- trainControl(method='cv', number=10)
cp.grid <- expand.grid(.cp=(0:10)*0.001)
# Use caret to train the model with cross validation and rpart.
# The result is cp = 0.001 for the best model.
tr <- train(MEDV ~ LAT + LON + CRIM + ZN + INDUS + CHAS + NOX + RM + AGE + DIS + RAD + TAX + PTRATIO, data=train, method='rpart', trControl=tr.control, tuneGrid=cp.grid)
# Notice the best tree is a pretty complex tree.
best.tree <- tr$finalModel
prp(best.tree)
# Calculate sum of squared errors: 3675.766
# This tree is better, but the linear regression model was better.
best.tree.pred <- predict(best.tree, newdata=test)
best.tree.sse <- sum((best.tree.pred - test$MEDV)^2)
# Plot original map with highest house prices.
plot(test$LON, test$LAT)
points(test$LON[test$MEDV>=21.2], test$LAT[test$MEDV>=21.2], col='red', pch=19)
# Plot best tree's predictions for highest house prices (even though not as good as linear regression model).
points(test$LON[best.tree.pred >=21.2], test$LAT[best.tree.pred >=21.2], col='blue', pch='!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment