Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Load libraries
import numpy as np
import pandas as pd
import random
from math import sqrt
import math
from sklearn.cluster import KMeans
random.seed(10)
# Generate point within a circle
def generate_points(radius, center_x, center_y):
r = radius * sqrt(random.random())
theta = random.random() * 2 * math.pi
x = center_x + r * math.cos(theta)
y = center_y + r * math.sin(theta)
return x, y
# Define the clusters
areas = [{'_price_per_room': {'mean': 181580, 'std': 59497.0}, '_bedrooms': {'mean': 3.02, 'std': 0.93}, '_bathrooms': {'mean': 1.77, 'std': 0.93}, '_time_to_work_seconds_transit': {'mean': 2726.48, 'std': 490.97}, '_time_to_work_seconds_walking': {'mean': 5083.1, 'std': 491.48}, 'type_int': {'parameter': 0.21}, 'size': 52, 'boundaries': {'x': 53.36878201326923, 'y': -6.198360976288462, 'radius': 0.0196}, '_d_code': 'D14'}, {'_price_per_room': {'mean': 493528, 'std': 383131.0}, '_bedrooms': {'mean': 3.8, 'std': 1.17}, '_bathrooms': {'mean': 2.93, 'std': 1.21}, '_time_to_work_seconds_transit': {'mean': 3676.03, 'std': 221.51}, '_time_to_work_seconds_walking': {'mean': 9761.77, 'std': 413.35}, 'type_int': {'parameter': 0.13}, 'size': 30, 'boundaries': {'x': 53.275352686333335, 'y': -6.1017622094, 'radius': 0.0137}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 302377, 'std': 152401.0}, '_bedrooms': {'mean': 2.92, 'std': 1.35}, '_bathrooms': {'mean': 2.07, 'std': 0.99}, '_time_to_work_seconds_transit': {'mean': 819.15, 'std': 293.66}, '_time_to_work_seconds_walking': {'mean': 1072.49, 'std': 520.9}, 'type_int': {'parameter': 0.39}, 'size': 74, 'boundaries': {'x': 53.3272285236, 'y': -6.251122482213333, 'radius': 0.0145}, '_d_code': 'D02'}, {'_price_per_room': {'mean': 152296, 'std': 221922.0}, '_bedrooms': {'mean': 3.15, 'std': 1.23}, '_bathrooms': {'mean': 2.85, 'std': 1.49}, '_time_to_work_seconds_transit': {'mean': 4553.04, 'std': 927.86}, '_time_to_work_seconds_walking': {'mean': 16816.73, 'std': 601.84}, 'type_int': {'parameter': 0.23}, 'size': 26, 'boundaries': {'x': 53.491635155, 'y': -6.1508104698846156, 'radius': 0.0272}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 217294, 'std': 100059.0}, '_bedrooms': {'mean': 2.35, 'std': 1.12}, '_bathrooms': {'mean': 1.54, 'std': 1.0}, '_time_to_work_seconds_transit': {'mean': 1433.79, 'std': 374.57}, '_time_to_work_seconds_walking': {'mean': 1449.84, 'std': 371.54}, 'type_int': {'parameter': 0.43}, 'size': 97, 'boundaries': {'x': 53.33345832052632, 'y': -6.271580169547368, 'radius': 0.0136}, '_d_code': 'D14'}, {'_price_per_room': {'mean': 157620, 'std': 83354.0}, '_bedrooms': {'mean': 2.7, 'std': 1.16}, '_bathrooms': {'mean': 1.55, 'std': 1.03}, '_time_to_work_seconds_transit': {'mean': 2246.11, 'std': 344.74}, '_time_to_work_seconds_walking': {'mean': 3937.0, 'std': 768.92}, 'type_int': {'parameter': 0.18}, 'size': 56, 'boundaries': {'x': 53.364246895178574, 'y': -6.2904937281607145, 'radius': 0.016}, '_d_code': 'D8'}, {'_price_per_room': {'mean': 159297, 'std': 62719.0}, '_bedrooms': {'mean': 2.82, 'std': 1.15}, '_bathrooms': {'mean': 1.67, 'std': 1.08}, '_time_to_work_seconds_transit': {'mean': 2520.29, 'std': 277.55}, '_time_to_work_seconds_walking': {'mean': 4353.49, 'std': 658.73}, 'type_int': {'parameter': 0.2}, 'size': 51, 'boundaries': {'x': 53.37188705647059, 'y': -6.221420613470588, 'radius': 0.0144}, '_d_code': 'D05'}, {'_price_per_room': {'mean': 135498, 'std': 47558.0}, '_bedrooms': {'mean': 3.23, 'std': 0.9}, '_bathrooms': {'mean': 2.27, 'std': 1.12}, '_time_to_work_seconds_transit': {'mean': 3438.98, 'std': 445.33}, '_time_to_work_seconds_walking': {'mean': 8290.68, 'std': 622.65}, 'type_int': {'parameter': 0.25}, 'size': 44, 'boundaries': {'x': 53.38304020295455, 'y': -6.3740143982727275, 'radius': 0.0187}, '_d_code': 'D11'}, {'_price_per_room': {'mean': 100000, 'std': 25040.0}, '_bedrooms': {'mean': 2.78, 'std': 0.82}, '_bathrooms': {'mean': 2.2, 'std': 0.68}, '_time_to_work_seconds_transit': {'mean': 5970.12, 'std': 664.03}, '_time_to_work_seconds_walking': {'mean': 25644.85, 'std': 908.49}, 'type_int': {'parameter': 0.2}, 'size': 40, 'boundaries': {'x': 53.60742486675, 'y': -6.20196567895, 'radius': 0.0512}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 110042, 'std': 54977.0}, '_bedrooms': {'mean': 4.33, 'std': 0.47}, '_bathrooms': {'mean': 2.17, 'std': 1.34}, '_time_to_work_seconds_transit': {'mean': 5929.5, 'std': 4348.27}, '_time_to_work_seconds_walking': {'mean': 18652.67, 'std': 688.22}, 'type_int': {'parameter': 0.0}, 'size': 6, 'boundaries': {'x': 53.52650013, 'y': -6.2558044058333335, 'radius': 0.0243}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 107126, 'std': 42503.0}, '_bedrooms': {'mean': 2.81, 'std': 1.04}, '_bathrooms': {'mean': 2.11, 'std': 0.98}, '_time_to_work_seconds_transit': {'mean': 4220.84, 'std': 304.7}, '_time_to_work_seconds_walking': {'mean': 12065.92, 'std': 487.31}, 'type_int': {'parameter': 0.27}, 'size': 37, 'boundaries': {'x': 53.39624228054054, 'y': -6.434955248675676, 'radius': 0.0219}, '_d_code': 'D15'}, {'_price_per_room': {'mean': 100000, 'std': 46102.0}, '_bedrooms': {'mean': 3.35, 'std': 1.03}, '_bathrooms': {'mean': 2.88, 'std': 0.68}, '_time_to_work_seconds_transit': {'mean': 4508.59, 'std': 226.07}, '_time_to_work_seconds_walking': {'mean': 11981.35, 'std': 950.55}, 'type_int': {'parameter': 0.12}, 'size': 17, 'boundaries': {'x': 53.42940654764706, 'y': -6.382530850823529, 'radius': 0.0379}, '_d_code': 'D15'}, {'_price_per_room': {'mean': 267059, 'std': 139842.0}, '_bedrooms': {'mean': 3.62, 'std': 1.13}, '_bathrooms': {'mean': 2.14, 'std': 1.08}, '_time_to_work_seconds_transit': {'mean': 2333.58, 'std': 305.86}, '_time_to_work_seconds_walking': {'mean': 5640.54, 'std': 620.6}, 'type_int': {'parameter': 0.16}, 'size': 50, 'boundaries': {'x': 53.2976774958, 'y': -6.17410500264, 'radius': 0.0173}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 114412, 'std': 30277.0}, '_bedrooms': {'mean': 3.62, 'std': 0.82}, '_bathrooms': {'mean': 2.49, 'std': 1.27}, '_time_to_work_seconds_transit': {'mean': 5202.41, 'std': 539.76}, '_time_to_work_seconds_walking': {'mean': 21777.03, 'std': 728.29}, 'type_int': {'parameter': 0.03}, 'size': 37, 'boundaries': {'x': 53.52542595594595, 'y': -6.097874553216216, 'radius': 0.0206}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 244139, 'std': 124990.0}, '_bedrooms': {'mean': 3.15, 'std': 1.18}, '_bathrooms': {'mean': 2.23, 'std': 1.04}, '_time_to_work_seconds_transit': {'mean': 1861.53, 'std': 278.88}, '_time_to_work_seconds_walking': {'mean': 5923.0, 'std': 667.55}, 'type_int': {'parameter': 0.27}, 'size': 60, 'boundaries': {'x': 53.28258909983333, 'y': -6.1906663307, 'radius': 0.0163}, '_d_code': 'D18'}, {'_price_per_room': {'mean': 321679, 'std': 168930.0}, '_bedrooms': {'mean': 3.22, 'std': 1.64}, '_bathrooms': {'mean': 2.28, 'std': 1.32}, '_time_to_work_seconds_transit': {'mean': 1249.33, 'std': 284.67}, '_time_to_work_seconds_walking': {'mean': 1849.0, 'std': 502.21}, 'type_int': {'parameter': 0.4}, 'size': 58, 'boundaries': {'x': 53.32252559137931, 'y': -6.2283092662413795, 'radius': 0.0142}, '_d_code': 'D4'}, {'_price_per_room': {'mean': 102004, 'std': 32122.0}, '_bedrooms': {'mean': 3.11, 'std': 0.79}, '_bathrooms': {'mean': 2.37, 'std': 0.74}, '_time_to_work_seconds_transit': {'mean': 4264.21, 'std': 296.05}, '_time_to_work_seconds_walking': {'mean': 12987.0, 'std': 516.68}, 'type_int': {'parameter': 0.16}, 'size': 19, 'boundaries': {'x': 53.46912453631579, 'y': -6.2415537288421055, 'radius': 0.0169}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 180248, 'std': 106493.0}, '_bedrooms': {'mean': 3.31, 'std': 1.26}, '_bathrooms': {'mean': 2.2, 'std': 1.24}, '_time_to_work_seconds_transit': {'mean': 2727.09, 'std': 283.37}, '_time_to_work_seconds_walking': {'mean': 10962.4, 'std': 694.27}, 'type_int': {'parameter': 0.16}, 'size': 45, 'boundaries': {'x': 53.23805219822222, 'y': -6.124351165266667, 'radius': 0.0162}, '_d_code': 'D15'}, {'_price_per_room': {'mean': 119633, 'std': 21097.0}, '_bedrooms': {'mean': 2.68, 'std': 0.64}, '_bathrooms': {'mean': 1.26, 'std': 0.47}, '_time_to_work_seconds_transit': {'mean': 2658.49, 'std': 200.8}, '_time_to_work_seconds_walking': {'mean': 4102.52, 'std': 319.73}, 'type_int': {'parameter': 0.06}, 'size': 65, 'boundaries': {'x': 53.32943174030769, 'y': -6.320801841184616, 'radius': 0.0155}, '_d_code': 'D10'}, {'_price_per_room': {'mean': 181010, 'std': 184192.0}, '_bedrooms': {'mean': 3.9, 'std': 1.29}, '_bathrooms': {'mean': 2.73, 'std': 1.6}, '_time_to_work_seconds_transit': {'mean': 4448.25, 'std': 601.77}, '_time_to_work_seconds_walking': {'mean': 11768.08, 'std': 669.51}, 'type_int': {'parameter': 0.06}, 'size': 48, 'boundaries': {'x': 53.44914861833333, 'y': -6.187428273854167, 'radius': 0.0248}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 205936, 'std': 76572.0}, '_bedrooms': {'mean': 3.47, 'std': 1.12}, '_bathrooms': {'mean': 2.47, 'std': 0.96}, '_time_to_work_seconds_transit': {'mean': 4397.5, 'std': 1290.38}, '_time_to_work_seconds_walking': {'mean': 12060.8, 'std': 794.14}, 'type_int': {'parameter': 0.27}, 'size': 30, 'boundaries': {'x': 53.43821645166667, 'y': -6.137963991966666, 'radius': 0.0167}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 205350, 'std': 192493.0}, '_bedrooms': {'mean': 1.94, 'std': 1.02}, '_bathrooms': {'mean': 1.32, 'std': 0.57}, '_time_to_work_seconds_transit': {'mean': 1565.82, 'std': 288.57}, '_time_to_work_seconds_walking': {'mean': 2023.29, 'std': 513.75}, 'type_int': {'parameter': 0.8}, 'size': 80, 'boundaries': {'x': 53.34927853888889, 'y': -6.272312565530864, 'radius': 0.0142}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 126478, 'std': 47046.0}, '_bedrooms': {'mean': 3.04, 'std': 0.92}, '_bathrooms': {'mean': 1.65, 'std': 0.85}, '_time_to_work_seconds_transit': {'mean': 2402.75, 'std': 355.81}, '_time_to_work_seconds_walking': {'mean': 5099.21, 'std': 934.51}, 'type_int': {'parameter': 0.13}, 'size': 52, 'boundaries': {'x': 53.382757924423075, 'y': -6.269996948384615, 'radius': 0.0152}, '_d_code': 'D6'}, {'_price_per_room': {'mean': 254245, 'std': 134936.0}, '_bedrooms': {'mean': 3.14, 'std': 1.22}, '_bathrooms': {'mean': 2.16, 'std': 1.46}, '_time_to_work_seconds_transit': {'mean': 1731.41, 'std': 413.78}, '_time_to_work_seconds_walking': {'mean': 2802.3, 'std': 1025.96}, 'type_int': {'parameter': 0.18}, 'size': 56, 'boundaries': {'x': 53.30932471714286, 'y': -6.26258024675, 'radius': 0.0172}, '_d_code': 'D14'}, {'_price_per_room': {'mean': 239910, 'std': 81105.0}, '_bedrooms': {'mean': 2.94, 'std': 1.1}, '_bathrooms': {'mean': 1.78, 'std': 0.68}, '_time_to_work_seconds_transit': {'mean': 1627.52, 'std': 295.12}, '_time_to_work_seconds_walking': {'mean': 4033.13, 'std': 649.55}, 'type_int': {'parameter': 0.39}, 'size': 54, 'boundaries': {'x': 53.30438228018519, 'y': -6.20359709762963, 'radius': 0.0168}, '_d_code': 'D4'}, {'_price_per_room': {'mean': 111801, 'std': 30941.0}, '_bedrooms': {'mean': 3.07, 'std': 0.61}, '_bathrooms': {'mean': 1.38, 'std': 0.61}, '_time_to_work_seconds_transit': {'mean': 3000.09, 'std': 444.27}, '_time_to_work_seconds_walking': {'mean': 6066.98, 'std': 797.13}, 'type_int': {'parameter': 0.07}, 'size': 45, 'boundaries': {'x': 53.39145203222222, 'y': -6.2130442404, 'radius': 0.0232}, '_d_code': 'D8'}, {'_price_per_room': {'mean': 157007, 'std': 42370.0}, '_bedrooms': {'mean': 3.1, 'std': 1.14}, '_bathrooms': {'mean': 1.99, 'std': 1.38}, '_time_to_work_seconds_transit': {'mean': 2311.18, 'std': 311.77}, '_time_to_work_seconds_walking': {'mean': 3733.76, 'std': 873.1}, 'type_int': {'parameter': 0.15}, 'size': 68, 'boundaries': {'x': 53.37181934529412, 'y': -6.245134858985294, 'radius': 0.0128}, '_d_code': 'D1'}, {'_price_per_room': {'mean': 103036, 'std': 32531.0}, '_bedrooms': {'mean': 3.0, 'std': 0.67}, '_bathrooms': {'mean': 1.67, 'std': 0.75}, '_time_to_work_seconds_transit': {'mean': 3081.28, 'std': 340.35}, '_time_to_work_seconds_walking': {'mean': 6634.56, 'std': 604.81}, 'type_int': {'parameter': 0.17}, 'size': 18, 'boundaries': {'x': 53.39454147944444, 'y': -6.190675070888889, 'radius': 0.0165}, '_d_code': 'D17'}, {'_price_per_room': {'mean': 100000, 'std': 39962.0}, '_bedrooms': {'mean': 2.68, 'std': 0.69}, '_bathrooms': {'mean': 2.19, 'std': 0.96}, '_time_to_work_seconds_transit': {'mean': 4748.39, 'std': 522.06}, '_time_to_work_seconds_walking': {'mean': 10746.03, 'std': 427.41}, 'type_int': {'parameter': 0.39}, 'size': 31, 'boundaries': {'x': 53.2843762216129, 'y': -6.418018998354839, 'radius': 0.0186}, '_d_code': 'D4'}, {'_price_per_room': {'mean': 130623, 'std': 21035.0}, '_bedrooms': {'mean': 3.04, 'std': 0.71}, '_bathrooms': {'mean': 1.87, 'std': 0.73}, '_time_to_work_seconds_transit': {'mean': 2931.66, 'std': 348.49}, '_time_to_work_seconds_walking': {'mean': 5431.94, 'std': 821.12}, 'type_int': {'parameter': 0.17}, 'size': 47, 'boundaries': {'x': 53.389734147234044, 'y': -6.238867422042553, 'radius': 0.0187}, '_d_code': 'D11'}, {'_price_per_room': {'mean': 125362, 'std': 34038.0}, '_bedrooms': {'mean': 2.97, 'std': 1.1}, '_bathrooms': {'mean': 1.87, 'std': 1.09}, '_time_to_work_seconds_transit': {'mean': 3662.03, 'std': 279.08}, '_time_to_work_seconds_walking': {'mean': 11727.03, 'std': 507.03}, 'type_int': {'parameter': 0.13}, 'size': 39, 'boundaries': {'x': 53.451389704358974, 'y': -6.228989974358974, 'radius': 0.0234}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 163528, 'std': 49942.0}, '_bedrooms': {'mean': 2.39, 'std': 1.06}, '_bathrooms': {'mean': 1.9, 'std': 0.88}, '_time_to_work_seconds_transit': {'mean': 2750.76, 'std': 540.0}, '_time_to_work_seconds_walking': {'mean': 6897.54, 'std': 803.18}, 'type_int': {'parameter': 0.63}, 'size': 41, 'boundaries': {'x': 53.26477144585366, 'y': -6.222676830292683, 'radius': 0.016}, '_d_code': 'D16'}, {'_price_per_room': {'mean': 122129, 'std': 31115.0}, '_bedrooms': {'mean': 2.91, 'std': 0.57}, '_bathrooms': {'mean': 1.55, 'std': 0.82}, '_time_to_work_seconds_transit': {'mean': 3017.36, 'std': 229.67}, '_time_to_work_seconds_walking': {'mean': 5031.21, 'std': 408.46}, 'type_int': {'parameter': 0.0}, 'size': 33, 'boundaries': {'x': 53.31887038090909, 'y': -6.3333658639393935, 'radius': 0.0127}, '_d_code': 'D6'}, {'_price_per_room': {'mean': 285038, 'std': 127303.0}, '_bedrooms': {'mean': 3.54, 'std': 1.11}, '_bathrooms': {'mean': 2.44, 'std': 1.57}, '_time_to_work_seconds_transit': {'mean': 3374.08, 'std': 262.38}, '_time_to_work_seconds_walking': {'mean': 8499.49, 'std': 417.35}, 'type_int': {'parameter': 0.13}, 'size': 39, 'boundaries': {'x': 53.28325383512821, 'y': -6.121285375358974, 'radius': 0.0136}, '_d_code': 'D1'}, {'_price_per_room': {'mean': 272500, 'std': 96209.0}, '_bedrooms': {'mean': 3.12, 'std': 1.17}, '_bathrooms': {'mean': 2.38, 'std': 0.99}, '_time_to_work_seconds_transit': {'mean': 4473.62, 'std': 440.09}, '_time_to_work_seconds_walking': {'mean': 11166.88, 'std': 504.81}, 'type_int': {'parameter': 0.38}, 'size': 8, 'boundaries': {'x': 53.37703105625, 'y': -6.090451587125, 'radius': 0.022}, '_d_code': 'D13'}, {'_price_per_room': {'mean': 278131, 'std': 157421.0}, '_bedrooms': {'mean': 3.7, 'std': 1.27}, '_bathrooms': {'mean': 2.59, 'std': 1.37}, '_time_to_work_seconds_transit': {'mean': 2891.63, 'std': 531.47}, '_time_to_work_seconds_walking': {'mean': 8620.11, 'std': 998.41}, 'type_int': {'parameter': 0.19}, 'size': 27, 'boundaries': {'x': 53.2551756537037, 'y': -6.178460152370371, 'radius': 0.0321}, '_d_code': 'D18'}, {'_price_per_room': {'mean': 155476, 'std': 29559.0}, '_bedrooms': {'mean': 3.26, 'std': 0.8}, '_bathrooms': {'mean': 1.98, 'std': 0.8}, '_time_to_work_seconds_transit': {'mean': 2982.59, 'std': 567.88}, '_time_to_work_seconds_walking': {'mean': 6004.46, 'std': 890.24}, 'type_int': {'parameter': 0.11}, 'size': 54, 'boundaries': {'x': 53.28107386462963, 'y': -6.303488775185185, 'radius': 0.0352}, '_d_code': 'D6'}, {'_price_per_room': {'mean': 165795, 'std': 58042.0}, '_bedrooms': {'mean': 3.8, 'std': 1.24}, '_bathrooms': {'mean': 2.34, 'std': 1.19}, '_time_to_work_seconds_transit': {'mean': 5053.71, 'std': 1200.28}, '_time_to_work_seconds_walking': {'mean': 23721.37, 'std': 436.0}, 'type_int': {'parameter': 0.06}, 'size': 35, 'boundaries': {'x': 53.57480886571429, 'y': -6.1091961588285715, 'radius': 0.0273}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 259220, 'std': 122544.0}, '_bedrooms': {'mean': 3.83, 'std': 1.13}, '_bathrooms': {'mean': 2.91, 'std': 1.44}, '_time_to_work_seconds_transit': {'mean': 3910.17, 'std': 528.5}, '_time_to_work_seconds_walking': {'mean': 9803.83, 'std': 565.2}, 'type_int': {'parameter': 0.09}, 'size': 23, 'boundaries': {'x': 53.26500451478261, 'y': -6.1204850282173915, 'radius': 0.0118}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 126235, 'std': 44798.0}, '_bedrooms': {'mean': 3.28, 'std': 0.8}, '_bathrooms': {'mean': 2.67, 'std': 1.05}, '_time_to_work_seconds_transit': {'mean': 6492.67, 'std': 976.43}, '_time_to_work_seconds_walking': {'mean': 24571.17, 'std': 478.74}, 'type_int': {'parameter': 0.11}, 'size': 18, 'boundaries': {'x': 53.583048337777775, 'y': -6.133048517888889, 'radius': 0.0258}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 223871, 'std': 154009.0}, '_bedrooms': {'mean': 3.03, 'std': 1.15}, '_bathrooms': {'mean': 1.77, 'std': 1.2}, '_time_to_work_seconds_transit': {'mean': 2047.99, 'std': 309.09}, '_time_to_work_seconds_walking': {'mean': 2641.2, 'std': 625.15}, 'type_int': {'parameter': 0.16}, 'size': 79, 'boundaries': {'x': 53.3164880778481, 'y': -6.280329812063291, 'radius': 0.013}, '_d_code': 'D14'}, {'_price_per_room': {'mean': 187452, 'std': 76530.0}, '_bedrooms': {'mean': 2.95, 'std': 1.03}, '_bathrooms': {'mean': 1.81, 'std': 0.76}, '_time_to_work_seconds_transit': {'mean': 2474.63, 'std': 309.85}, '_time_to_work_seconds_walking': {'mean': 4159.98, 'std': 661.11}, 'type_int': {'parameter': 0.33}, 'size': 43, 'boundaries': {'x': 53.299003382790694, 'y': -6.291321697325581, 'radius': 0.0126}, '_d_code': 'D16'}, {'_price_per_room': {'mean': 146668, 'std': 88310.0}, '_bedrooms': {'mean': 3.23, 'std': 0.99}, '_bathrooms': {'mean': 2.51, 'std': 1.38}, '_time_to_work_seconds_transit': {'mean': 3835.17, 'std': 332.58}, '_time_to_work_seconds_walking': {'mean': 9287.0, 'std': 483.06}, 'type_int': {'parameter': 0.23}, 'size': 35, 'boundaries': {'x': 53.37372573571429, 'y': -6.395636042457143, 'radius': 0.0211}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 127079, 'std': 89292.0}, '_bedrooms': {'mean': 3.21, 'std': 0.96}, '_bathrooms': {'mean': 2.55, 'std': 1.04}, '_time_to_work_seconds_transit': {'mean': 3946.83, 'std': 375.49}, '_time_to_work_seconds_walking': {'mean': 11657.52, 'std': 610.25}, 'type_int': {'parameter': 0.24}, 'size': 29, 'boundaries': {'x': 53.35260093862069, 'y': -6.456694613793103, 'radius': 0.0243}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 117193, 'std': 67854.0}, '_bedrooms': {'mean': 3.25, 'std': 0.72}, '_bathrooms': {'mean': 2.75, 'std': 0.83}, '_time_to_work_seconds_transit': {'mean': 4233.92, 'std': 1894.21}, '_time_to_work_seconds_walking': {'mean': 14399.5, 'std': 664.38}, 'type_int': {'parameter': 0.0}, 'size': 12, 'boundaries': {'x': 53.29506923333334, 'y': -6.497236821916667, 'radius': 0.0337}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 113533, 'std': 41211.0}, '_bedrooms': {'mean': 3.05, 'std': 1.05}, '_bathrooms': {'mean': 2.4, 'std': 0.98}, '_time_to_work_seconds_transit': {'mean': 3562.48, 'std': 248.15}, '_time_to_work_seconds_walking': {'mean': 8090.36, 'std': 658.09}, 'type_int': {'parameter': 0.29}, 'size': 42, 'boundaries': {'x': 53.408687602142855, 'y': -6.172195257, 'radius': 0.022}, '_d_code': 'D1'}, {'_price_per_room': {'mean': 128068, 'std': 69378.0}, '_bedrooms': {'mean': 2.7, 'std': 0.97}, '_bathrooms': {'mean': 2.33, 'std': 1.06}, '_time_to_work_seconds_transit': {'mean': 3623.97, 'std': 331.84}, '_time_to_work_seconds_walking': {'mean': 9314.61, 'std': 459.46}, 'type_int': {'parameter': 0.42}, 'size': 33, 'boundaries': {'x': 53.4096528369697, 'y': -6.148733842090909, 'radius': 0.0147}, '_d_code': 'D13'}, {'_price_per_room': {'mean': 238202, 'std': 113135.0}, '_bedrooms': {'mean': 2.27, 'std': 0.93}, '_bathrooms': {'mean': 1.61, 'std': 0.93}, '_time_to_work_seconds_transit': {'mean': 1423.35, 'std': 535.8}, '_time_to_work_seconds_walking': {'mean': 1422.17, 'std': 482.15}, 'type_int': {'parameter': 0.58}, 'size': 84, 'boundaries': {'x': 53.34119207142857, 'y': -6.235079578607143, 'radius': 0.0154}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 105268, 'std': 31201.0}, '_bedrooms': {'mean': 3.02, 'std': 0.54}, '_bathrooms': {'mean': 2.14, 'std': 0.92}, '_time_to_work_seconds_transit': {'mean': 3970.25, 'std': 294.98}, '_time_to_work_seconds_walking': {'mean': 10880.18, 'std': 472.96}, 'type_int': {'parameter': 0.14}, 'size': 44, 'boundaries': {'x': 53.39452600204545, 'y': -6.4123222908863635, 'radius': 0.0192}, '_d_code': 'D1'}, {'_price_per_room': {'mean': 199232, 'std': 93314.0}, '_bedrooms': {'mean': 3.27, 'std': 1.39}, '_bathrooms': {'mean': 2.0, 'std': 1.35}, '_time_to_work_seconds_transit': {'mean': 1771.39, 'std': 352.78}, '_time_to_work_seconds_walking': {'mean': 4704.8, 'std': 697.57}, 'type_int': {'parameter': 0.3}, 'size': 44, 'boundaries': {'x': 53.28673962568182, 'y': -6.242478358545455, 'radius': 0.0141}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 242338, 'std': 83282.0}, '_bedrooms': {'mean': 2.27, 'std': 0.83}, '_bathrooms': {'mean': 1.92, 'std': 0.97}, '_time_to_work_seconds_transit': {'mean': 3737.37, 'std': 575.51}, '_time_to_work_seconds_walking': {'mean': 11922.96, 'std': 271.5}, 'type_int': {'parameter': 0.69}, 'size': 49, 'boundaries': {'x': 53.45030300489796, 'y': -6.157002229571429, 'radius': 0.016}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 138620, 'std': 41501.0}, '_bedrooms': {'mean': 2.62, 'std': 0.93}, '_bathrooms': {'mean': 1.59, 'std': 0.72}, '_time_to_work_seconds_transit': {'mean': 2919.28, 'std': 283.35}, '_time_to_work_seconds_walking': {'mean': 5658.48, 'std': 435.33}, 'type_int': {'parameter': 0.38}, 'size': 29, 'boundaries': {'x': 53.37475455827586, 'y': -6.317347138517241, 'radius': 0.0133}, '_d_code': 'D15'}, {'_price_per_room': {'mean': 137374, 'std': 60630.0}, '_bedrooms': {'mean': 3.17, 'std': 0.97}, '_bathrooms': {'mean': 1.67, 'std': 1.07}, '_time_to_work_seconds_transit': {'mean': 3050.0, 'std': 347.06}, '_time_to_work_seconds_walking': {'mean': 6682.63, 'std': 484.29}, 'type_int': {'parameter': 0.07}, 'size': 30, 'boundaries': {'x': 53.379892428333335, 'y': -6.173089724133334, 'radius': 0.0212}, '_d_code': 'D13'}, {'_price_per_room': {'mean': 235794, 'std': 65594.0}, '_bedrooms': {'mean': 2.64, 'std': 0.95}, '_bathrooms': {'mean': 1.89, 'std': 0.77}, '_time_to_work_seconds_transit': {'mean': 1444.97, 'std': 274.91}, '_time_to_work_seconds_walking': {'mean': 2788.64, 'std': 753.71}, 'type_int': {'parameter': 0.39}, 'size': 36, 'boundaries': {'x': 53.30728368277778, 'y': -6.244447355861111, 'radius': 0.0113}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 191470, 'std': 55281.0}, '_bedrooms': {'mean': 3.15, 'std': 0.98}, '_bathrooms': {'mean': 1.9, 'std': 0.73}, '_time_to_work_seconds_transit': {'mean': 1651.39, 'std': 322.24}, '_time_to_work_seconds_walking': {'mean': 4354.2, 'std': 766.69}, 'type_int': {'parameter': 0.24}, 'size': 41, 'boundaries': {'x': 53.2936195102439, 'y': -6.225523675756097, 'radius': 0.0185}, '_d_code': 'D4'}, {'_price_per_room': {'mean': 164859, 'std': 45343.0}, '_bedrooms': {'mean': 2.1, 'std': 0.86}, '_bathrooms': {'mean': 1.27, 'std': 0.56}, '_time_to_work_seconds_transit': {'mean': 2025.0, 'std': 214.09}, '_time_to_work_seconds_walking': {'mean': 2442.93, 'std': 368.41}, 'type_int': {'parameter': 0.46}, 'size': 70, 'boundaries': {'x': 53.341052158888886, 'y': -6.288921612819444, 'radius': 0.0124}, '_d_code': 'D6'}, {'_price_per_room': {'mean': 142951, 'std': 25583.0}, '_bedrooms': {'mean': 3.25, 'std': 0.7}, '_bathrooms': {'mean': 1.72, 'std': 0.83}, '_time_to_work_seconds_transit': {'mean': 2849.13, 'std': 273.05}, '_time_to_work_seconds_walking': {'mean': 4780.17, 'std': 652.05}, 'type_int': {'parameter': 0.02}, 'size': 53, 'boundaries': {'x': 53.30552290716981, 'y': -6.318972913660377, 'radius': 0.0199}, '_d_code': 'D16'}, {'_price_per_room': {'mean': 174349, 'std': 56414.0}, '_bedrooms': {'mean': 2.89, 'std': 0.91}, '_bathrooms': {'mean': 2.29, 'std': 1.1}, '_time_to_work_seconds_transit': {'mean': 2870.53, 'std': 633.59}, '_time_to_work_seconds_walking': {'mean': 8311.37, 'std': 940.59}, 'type_int': {'parameter': 0.26}, 'size': 38, 'boundaries': {'x': 53.25440384473684, 'y': -6.205868782368421, 'radius': 0.0392}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 169685, 'std': 55648.0}, '_bedrooms': {'mean': 2.47, 'std': 1.26}, '_bathrooms': {'mean': 1.66, 'std': 1.2}, '_time_to_work_seconds_transit': {'mean': 1671.71, 'std': 516.12}, '_time_to_work_seconds_walking': {'mean': 1934.34, 'std': 705.85}, 'type_int': {'parameter': 0.6}, 'size': 85, 'boundaries': {'x': 53.35247101482353, 'y': -6.2467232369294114, 'radius': 0.0126}, '_d_code': 'D01'}, {'_price_per_room': {'mean': 100000, 'std': 20890.0}, '_bedrooms': {'mean': 2.72, 'std': 0.84}, '_bathrooms': {'mean': 1.47, 'std': 0.71}, '_time_to_work_seconds_transit': {'mean': 3803.62, 'std': 260.41}, '_time_to_work_seconds_walking': {'mean': 8199.53, 'std': 347.88}, 'type_int': {'parameter': 0.34}, 'size': 32, 'boundaries': {'x': 53.3253788159375, 'y': -6.39445760121875, 'radius': 0.0194}, '_d_code': 'D10'}, {'_price_per_room': {'mean': 107169, 'std': 27254.0}, '_bedrooms': {'mean': 3.17, 'std': 0.8}, '_bathrooms': {'mean': 2.5, 'std': 0.8}, '_time_to_work_seconds_transit': {'mean': 3445.53, 'std': 274.48}, '_time_to_work_seconds_walking': {'mean': 9825.17, 'std': 597.18}, 'type_int': {'parameter': 0.17}, 'size': 36, 'boundaries': {'x': 53.35104868472222, 'y': -6.421809637111111, 'radius': 0.026}, '_d_code': 'D1'}, {'_price_per_room': {'mean': 149158, 'std': 47277.0}, '_bedrooms': {'mean': 2.17, 'std': 0.61}, '_bathrooms': {'mean': 1.31, 'std': 0.46}, '_time_to_work_seconds_transit': {'mean': 2286.0, 'std': 218.33}, '_time_to_work_seconds_walking': {'mean': 3404.63, 'std': 362.05}, 'type_int': {'parameter': 0.57}, 'size': 35, 'boundaries': {'x': 53.34304605848485, 'y': -6.309297791606061, 'radius': 0.0135}, '_d_code': 'D12'}, {'_price_per_room': {'mean': 128410, 'std': 16700.0}, '_bedrooms': {'mean': 3.07, 'std': 0.73}, '_bathrooms': {'mean': 2.17, 'std': 0.73}, '_time_to_work_seconds_transit': {'mean': 3517.7, 'std': 371.14}, '_time_to_work_seconds_walking': {'mean': 7509.43, 'std': 596.49}, 'type_int': {'parameter': 0.23}, 'size': 30, 'boundaries': {'x': 53.274341387, 'y': -6.3318785748333335, 'radius': 0.0211}, '_d_code': 'D16'}, {'_price_per_room': {'mean': 257632, 'std': 145781.0}, '_bedrooms': {'mean': 3.29, 'std': 1.32}, '_bathrooms': {'mean': 2.19, 'std': 1.44}, '_time_to_work_seconds_transit': {'mean': 2691.1, 'std': 381.12}, '_time_to_work_seconds_walking': {'mean': 7438.23, 'std': 517.42}, 'type_int': {'parameter': 0.23}, 'size': 48, 'boundaries': {'x': 53.28913310666667, 'y': -6.141768924958333, 'radius': 0.0143}, '_d_code': 'd36'}, {'_price_per_room': {'mean': 185685, 'std': 63628.0}, '_bedrooms': {'mean': 3.5, 'std': 0.78}, '_bathrooms': {'mean': 1.75, 'std': 0.8}, '_time_to_work_seconds_transit': {'mean': 2318.89, 'std': 304.62}, '_time_to_work_seconds_walking': {'mean': 6965.36, 'std': 483.49}, 'type_int': {'parameter': 0.05}, 'size': 44, 'boundaries': {'x': 53.28121570068182, 'y': -6.162574233136364, 'radius': 0.0149}, '_d_code': 'D18'}, {'_price_per_room': {'mean': 127736, 'std': 33176.0}, '_bedrooms': {'mean': 2.73, 'std': 0.93}, '_bathrooms': {'mean': 1.5, 'std': 0.85}, '_time_to_work_seconds_transit': {'mean': 3243.77, 'std': 317.59}, '_time_to_work_seconds_walking': {'mean': 8291.23, 'std': 574.62}, 'type_int': {'parameter': 0.27}, 'size': 30, 'boundaries': {'x': 53.392120878, 'y': -6.153929733333333, 'radius': 0.014}, '_d_code': 'D5'}, {'_price_per_room': {'mean': 153166, 'std': 58935.0}, '_bedrooms': {'mean': 2.72, 'std': 0.84}, '_bathrooms': {'mean': 1.51, 'std': 0.71}, '_time_to_work_seconds_transit': {'mean': 2000.11, 'std': 289.04}, '_time_to_work_seconds_walking': {'mean': 2415.85, 'std': 611.86}, 'type_int': {'parameter': 0.32}, 'size': 47, 'boundaries': {'x': 53.355785805957446, 'y': -6.233518464361702, 'radius': 0.0153}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 111719, 'std': 29066.0}, '_bedrooms': {'mean': 2.82, 'std': 0.74}, '_bathrooms': {'mean': 1.6, 'std': 0.57}, '_time_to_work_seconds_transit': {'mean': 2877.84, 'std': 222.55}, '_time_to_work_seconds_walking': {'mean': 5881.24, 'std': 655.46}, 'type_int': {'parameter': 0.26}, 'size': 50, 'boundaries': {'x': 53.386374613, 'y': -6.29098917982, 'radius': 0.0128}, '_d_code': 'D7'}, {'_price_per_room': {'mean': 138648, 'std': 46001.0}, '_bedrooms': {'mean': 2.92, 'std': 0.97}, '_bathrooms': {'mean': 1.52, 'std': 0.79}, '_time_to_work_seconds_transit': {'mean': 2345.77, 'std': 288.67}, '_time_to_work_seconds_walking': {'mean': 3219.03, 'std': 515.41}, 'type_int': {'parameter': 0.05}, 'size': 60, 'boundaries': {'x': 53.318776918, 'y': -6.299010927816667, 'radius': 0.0129}, '_d_code': 'D8'}, {'_price_per_room': {'mean': 104882, 'std': 41665.0}, '_bedrooms': {'mean': 2.68, 'std': 0.97}, '_bathrooms': {'mean': 1.48, 'std': 0.57}, '_time_to_work_seconds_transit': {'mean': 3379.36, 'std': 301.61}, '_time_to_work_seconds_walking': {'mean': 7146.36, 'std': 463.53}, 'type_int': {'parameter': 0.36}, 'size': 25, 'boundaries': {'x': 53.3317131684, 'y': -6.37453396888, 'radius': 0.0149}, '_d_code': 'D7'}, {'_price_per_room': {'mean': 176799, 'std': 205730.0}, '_bedrooms': {'mean': 2.29, 'std': 0.85}, '_bathrooms': {'mean': 1.37, 'std': 0.83}, '_time_to_work_seconds_transit': {'mean': 2623.49, 'std': 404.33}, '_time_to_work_seconds_walking': {'mean': 5677.8, 'std': 352.68}, 'type_int': {'parameter': 0.23}, 'size': 35, 'boundaries': {'x': 53.347217352, 'y': -6.349983095028572, 'radius': 0.0167}, '_d_code': 'D7'}, {'_price_per_room': {'mean': 283129, 'std': 118778.0}, '_bedrooms': {'mean': 2.97, 'std': 1.12}, '_bathrooms': {'mean': 1.92, 'std': 1.1}, '_time_to_work_seconds_transit': {'mean': 1844.97, 'std': 311.88}, '_time_to_work_seconds_walking': {'mean': 2472.48, 'std': 419.77}, 'type_int': {'parameter': 0.28}, 'size': 60, 'boundaries': {'x': 53.327576461999996, 'y': -6.2140085217, 'radius': 0.0125}, '_d_code': 'D8'}, {'_price_per_room': {'mean': 100000, 'std': 55575.0}, '_bedrooms': {'mean': 2.82, 'std': 0.98}, '_bathrooms': {'mean': 2.24, 'std': 0.97}, '_time_to_work_seconds_transit': {'mean': 6069.38, 'std': 479.51}, '_time_to_work_seconds_walking': {'mean': 26061.24, 'std': 343.05}, 'type_int': {'parameter': 0.29}, 'size': 34, 'boundaries': {'x': 53.619330837647055, 'y': -6.207048932411765, 'radius': 0.0226}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 100000, 'std': 20888.0}, '_bedrooms': {'mean': 3.24, 'std': 1.02}, '_bathrooms': {'mean': 2.38, 'std': 1.13}, '_time_to_work_seconds_transit': {'mean': 4087.76, 'std': 315.62}, '_time_to_work_seconds_walking': {'mean': 10552.71, 'std': 968.89}, 'type_int': {'parameter': 0.05}, 'size': 21, 'boundaries': {'x': 53.407912532380955, 'y': -6.382105882095238, 'radius': 0.0146}, '_d_code': 'D15'}, {'_price_per_room': {'mean': 165356, 'std': 39624.0}, '_bedrooms': {'mean': 3.1, 'std': 0.82}, '_bathrooms': {'mean': 1.77, 'std': 0.75}, '_time_to_work_seconds_transit': {'mean': 2856.84, 'std': 719.6}, '_time_to_work_seconds_walking': {'mean': 6189.23, 'std': 858.67}, 'type_int': {'parameter': 0.23}, 'size': 31, 'boundaries': {'x': 53.27250940516129, 'y': -6.254081261935484, 'radius': 0.017}, '_d_code': 'D18'}, {'_price_per_room': {'mean': 100000, 'std': 32522.0}, '_bedrooms': {'mean': 2.89, 'std': 1.37}, '_bathrooms': {'mean': 1.79, 'std': 0.82}, '_time_to_work_seconds_transit': {'mean': 4326.11, 'std': 914.24}, '_time_to_work_seconds_walking': {'mean': 9342.75, 'std': 690.96}, 'type_int': {'parameter': 0.43}, 'size': 28, 'boundaries': {'x': 53.276378674285716, 'y': -6.3789493413928575, 'radius': 0.0403}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 108756, 'std': 29636.0}, '_bedrooms': {'mean': 2.5, 'std': 0.94}, '_bathrooms': {'mean': 1.87, 'std': 0.76}, '_time_to_work_seconds_transit': {'mean': 3194.53, 'std': 233.07}, '_time_to_work_seconds_walking': {'mean': 7177.45, 'std': 1017.49}, 'type_int': {'parameter': 0.47}, 'size': 60, 'boundaries': {'x': 53.404495611499996, 'y': -6.289518895383333, 'radius': 0.0145}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 195928, 'std': 158612.0}, '_bedrooms': {'mean': 2.83, 'std': 1.89}, '_bathrooms': {'mean': 2.02, 'std': 1.64}, '_time_to_work_seconds_transit': {'mean': 1729.8, 'std': 328.3}, '_time_to_work_seconds_walking': {'mean': 2835.61, 'std': 687.21}, 'type_int': {'parameter': 0.38}, 'size': 82, 'boundaries': {'x': 53.361824455121955, 'y': -6.25867816907317, 'radius': 0.0114}, '_d_code': 'D2'}, {'_price_per_room': {'mean': 172672, 'std': 52155.0}, '_bedrooms': {'mean': 2.87, 'std': 1.01}, '_bathrooms': {'mean': 1.74, 'std': 0.99}, '_time_to_work_seconds_transit': {'mean': 2558.23, 'std': 640.88}, '_time_to_work_seconds_walking': {'mean': 4919.91, 'std': 850.02}, 'type_int': {'parameter': 0.3}, 'size': 53, 'boundaries': {'x': 53.289755161886795, 'y': -6.279864871037736, 'radius': 0.022}, '_d_code': 'D6'}, {'_price_per_room': {'mean': 100553, 'std': 30787.0}, '_bedrooms': {'mean': 3.16, 'std': 0.93}, '_bathrooms': {'mean': 2.47, 'std': 1.04}, '_time_to_work_seconds_transit': {'mean': 5315.89, 'std': 371.81}, '_time_to_work_seconds_walking': {'mean': 18101.68, 'std': 307.91}, 'type_int': {'parameter': 0.05}, 'size': 19, 'boundaries': {'x': 53.52470816894737, 'y': -6.166661727631579, 'radius': 0.0174}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 177244, 'std': 88405.0}, '_bedrooms': {'mean': 3.5, 'std': 1.17}, '_bathrooms': {'mean': 2.21, 'std': 1.13}, '_time_to_work_seconds_transit': {'mean': 2841.44, 'std': 598.63}, '_time_to_work_seconds_walking': {'mean': 8951.94, 'std': 695.7}, 'type_int': {'parameter': 0.24}, 'size': 34, 'boundaries': {'x': 53.26098593411765, 'y': -6.142789054352941, 'radius': 0.0284}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 105168, 'std': 35023.0}, '_bedrooms': {'mean': 2.6, 'std': 0.66}, '_bathrooms': {'mean': 1.55, 'std': 0.67}, '_time_to_work_seconds_transit': {'mean': 3253.05, 'std': 254.34}, '_time_to_work_seconds_walking': {'mean': 6642.0, 'std': 336.06}, 'type_int': {'parameter': 0.15}, 'size': 20, 'boundaries': {'x': 53.390788689, 'y': -6.3149123638, 'radius': 0.0136}, '_d_code': 'D15'}, {'_price_per_room': {'mean': 201417, 'std': 64197.0}, '_bedrooms': {'mean': 3.56, 'std': 1.07}, '_bathrooms': {'mean': 2.19, 'std': 1.06}, '_time_to_work_seconds_transit': {'mean': 3545.63, 'std': 309.39}, '_time_to_work_seconds_walking': {'mean': 9474.44, 'std': 352.34}, 'type_int': {'parameter': 0.07}, 'size': 27, 'boundaries': {'x': 53.38818985666666, 'y': -6.117645433185185, 'radius': 0.0213}, '_d_code': 'D13'}, {'_price_per_room': {'mean': 137609, 'std': 227217.0}, '_bedrooms': {'mean': 2.63, 'std': 0.8}, '_bathrooms': {'mean': 1.5, 'std': 0.72}, '_time_to_work_seconds_transit': {'mean': 4115.5, 'std': 356.54}, '_time_to_work_seconds_walking': {'mean': 9294.83, 'std': 510.6}, 'type_int': {'parameter': 0.17}, 'size': 30, 'boundaries': {'x': 53.31766093033333, 'y': -6.4143013933, 'radius': 0.0187}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 108578, 'std': 23024.0}, '_bedrooms': {'mean': 2.91, 'std': 0.78}, '_bathrooms': {'mean': 1.71, 'std': 0.75}, '_time_to_work_seconds_transit': {'mean': 3987.26, 'std': 258.71}, '_time_to_work_seconds_walking': {'mean': 7895.53, 'std': 490.2}, 'type_int': {'parameter': 0.24}, 'size': 34, 'boundaries': {'x': 53.301727749117646, 'y': -6.372091950323529, 'radius': 0.0175}, '_d_code': 'D12'}, {'_price_per_room': {'mean': 100000, 'std': 23901.0}, '_bedrooms': {'mean': 3.07, 'std': 1.11}, '_bathrooms': {'mean': 1.97, 'std': 0.76}, '_time_to_work_seconds_transit': {'mean': 5092.48, 'std': 592.51}, '_time_to_work_seconds_walking': {'mean': 24681.28, 'std': 837.95}, 'type_int': {'parameter': 0.28}, 'size': 29, 'boundaries': {'x': 53.60510866586207, 'y': -6.18288146137931, 'radius': 0.0224}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 113748, 'std': 43590.0}, '_bedrooms': {'mean': 3.61, 'std': 1.01}, '_bathrooms': {'mean': 2.89, 'std': 1.29}, '_time_to_work_seconds_transit': {'mean': 3598.11, 'std': 1772.73}, '_time_to_work_seconds_walking': {'mean': 13760.94, 'std': 879.42}, 'type_int': {'parameter': 0.11}, 'size': 18, 'boundaries': {'x': 53.275140385, 'y': -6.477469862555555, 'radius': 0.0247}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 107598, 'std': 27981.0}, '_bedrooms': {'mean': 3.07, 'std': 0.78}, '_bathrooms': {'mean': 1.69, 'std': 0.65}, '_time_to_work_seconds_transit': {'mean': 3983.69, 'std': 268.06}, '_time_to_work_seconds_walking': {'mean': 7737.24, 'std': 402.11}, 'type_int': {'parameter': 0.17}, 'size': 29, 'boundaries': {'x': 53.28440508931035, 'y': -6.354526419965517, 'radius': 0.0148}, '_d_code': 'D12'}, {'_price_per_room': {'mean': 170186, 'std': 85432.0}, '_bedrooms': {'mean': 2.88, 'std': 1.18}, '_bathrooms': {'mean': 2.18, 'std': 0.86}, '_time_to_work_seconds_transit': {'mean': 2847.65, 'std': 140.46}, '_time_to_work_seconds_walking': {'mean': 6255.18, 'std': 177.09}, 'type_int': {'parameter': 0.53}, 'size': 17, 'boundaries': {'x': 53.374552982941175, 'y': -6.340101195882353, 'radius': 0.0159}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 127190, 'std': 42527.0}, '_bedrooms': {'mean': 2.4, 'std': 0.62}, '_bathrooms': {'mean': 1.7, 'std': 0.63}, '_time_to_work_seconds_transit': {'mean': 3123.72, 'std': 503.93}, '_time_to_work_seconds_walking': {'mean': 6658.37, 'std': 602.93}, 'type_int': {'parameter': 0.58}, 'size': 43, 'boundaries': {'x': 53.40274232860465, 'y': -6.254956442116279, 'radius': 0.0166}, '_d_code': 'D6'}, {'_price_per_room': {'mean': 155530, 'std': 57500.0}, '_bedrooms': {'mean': 3.03, 'std': 0.97}, '_bathrooms': {'mean': 2.06, 'std': 1.01}, '_time_to_work_seconds_transit': {'mean': 3322.85, 'std': 433.99}, '_time_to_work_seconds_walking': {'mean': 7382.58, 'std': 493.01}, 'type_int': {'parameter': 0.27}, 'size': 33, 'boundaries': {'x': 53.36507595878788, 'y': -6.367282491878788, 'radius': 0.0163}, '_d_code': 'D10'}, {'_price_per_room': {'mean': 230971, 'std': 125177.0}, '_bedrooms': {'mean': 3.47, 'std': 1.38}, '_bathrooms': {'mean': 2.47, 'std': 1.85}, '_time_to_work_seconds_transit': {'mean': 4272.0, 'std': 273.2}, '_time_to_work_seconds_walking': {'mean': 12713.94, 'std': 614.29}, 'type_int': {'parameter': 0.24}, 'size': 17, 'boundaries': {'x': 53.38113781352941, 'y': -6.062266432176471, 'radius': 0.0151}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 104375, 'std': 42701.0}, '_bedrooms': {'mean': 4.5, 'std': 1.12}, '_bathrooms': {'mean': 2.25, 'std': 0.83}, '_time_to_work_seconds_transit': {'mean': 7911.25, 'std': 1366.23}, '_time_to_work_seconds_walking': {'mean': 22451.75, 'std': 51.0}, 'type_int': {'parameter': 0.0}, 'size': 4, 'boundaries': {'x': 53.566743110000004, 'y': -6.3842268857499995, 'radius': 0.008}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 125386, 'std': 39780.0}, '_bedrooms': {'mean': 2.23, 'std': 0.73}, '_bathrooms': {'mean': 2.27, 'std': 1.01}, '_time_to_work_seconds_transit': {'mean': 4839.05, 'std': 180.08}, '_time_to_work_seconds_walking': {'mean': 11904.64, 'std': 394.97}, 'type_int': {'parameter': 0.68}, 'size': 22, 'boundaries': {'x': 53.28109051772727, 'y': -6.442903180590909, 'radius': 0.017}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 296343, 'std': 130985.0}, '_bedrooms': {'mean': 3.93, 'std': 1.29}, '_bathrooms': {'mean': 3.13, 'std': 1.45}, '_time_to_work_seconds_transit': {'mean': 3086.4, 'std': 962.54}, '_time_to_work_seconds_walking': {'mean': 12478.33, 'std': 1038.18}, 'type_int': {'parameter': 0.13}, 'size': 15, 'boundaries': {'x': 53.21759484933333, 'y': -6.1301172068000005, 'radius': 0.0299}, '_d_code': 'D18'}, {'_price_per_room': {'mean': 550000, 'std': 0.0}, '_bedrooms': {'mean': 3.0, 'std': 0.0}, '_bathrooms': {'mean': 3.0, 'std': 0.0}, '_time_to_work_seconds_transit': {'mean': 0.0, 'std': 0.0}, '_time_to_work_seconds_walking': {'mean': 174015.0, 'std': 0.0}, 'type_int': {'parameter': 0.0}, 'size': 1, 'boundaries': {'x': 53.24997124, 'y': -9.465317061, 'radius': 0.0}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 100000, 'std': 35269.0}, '_bedrooms': {'mean': 3.67, 'std': 0.94}, '_bathrooms': {'mean': 2.33, 'std': 1.89}, '_time_to_work_seconds_transit': {'mean': 5157.33, 'std': 1742.78}, '_time_to_work_seconds_walking': {'mean': 11909.0, 'std': 135.76}, 'type_int': {'parameter': 0.0}, 'size': 3, 'boundaries': {'x': 53.45187424, 'y': -6.289212940333333, 'radius': 0.0081}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 117125, 'std': 42698.0}, '_bedrooms': {'mean': 3.5, 'std': 0.87}, '_bathrooms': {'mean': 2.25, 'std': 0.43}, '_time_to_work_seconds_transit': {'mean': 7046.5, 'std': 74.56}, '_time_to_work_seconds_walking': {'mean': 23884.25, 'std': 126.94}, 'type_int': {'parameter': 0.0}, 'size': 4, 'boundaries': {'x': 53.5826920975, 'y': -6.288651285, 'radius': 0.01}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 210000, 'std': 0.0}, '_bedrooms': {'mean': 2.0, 'std': 0.0}, '_bathrooms': {'mean': 1.0, 'std': 0.0}, '_time_to_work_seconds_transit': {'mean': 6075.0, 'std': 0.0}, '_time_to_work_seconds_walking': {'mean': 32382.0, 'std': 0.0}, 'type_int': {'parameter': 1.0}, 'size': 1, 'boundaries': {'x': 53.26616934, 'y': -6.819461205, 'radius': 0.0}, '_d_code': 'Unknown'}, {'_price_per_room': {'mean': 100000, 'std': 0.0}, '_bedrooms': {'mean': 2.0, 'std': 0.0}, '_bathrooms': {'mean': 0.0, 'std': 0.0}, '_time_to_work_seconds_transit': {'mean': 19945.0, 'std': 0.0}, '_time_to_work_seconds_walking': {'mean': 130264.0, 'std': 0.0}, 'type_int': {'parameter': 1.0}, 'size': 1, 'boundaries': {'x': 53.55166743, 'y': -8.647154298, 'radius': 0.0}, '_d_code': 'D15'}]
points = []
centers = []
cl = 0
# Generate properties
for a in areas:
size = a["size"]
centers.append([a["boundaries"]["x"],a["boundaries"]["y"]])
for i in range(0, size):
lat, lng = generate_points(a["boundaries"]["radius"], a["boundaries"]["x"], a["boundaries"]["y"])
point = [lat, lng]
points.append(point)
kmeans = KMeans(n_clusters=len(areas),init=np.array(centers), max_iter=1)
kmeans.fit(points)
kmeans_df = pd.DataFrame(points,columns=["lat","lng"])
kmeans_df["labels"] = kmeans.labels_
# Generate properties
properties = []
for a in areas:
area_center = [a["boundaries"]["x"],a["boundaries"]["y"]]
area_cluster = kmeans.predict([area_center])[0]
cluster_data = kmeans_df.loc[kmeans_df["labels"] == area_cluster]
for _,d in cluster_data.iterrows():
lat = d["lat"]
lng = d["lng"]
property = []
price_per_room = abs(np.random.uniform(a["_price_per_room"]["mean"] * .9, a["_price_per_room"]["mean"] * 1.2))
bedrooms = max(1, int(abs((np.random.normal(a["_bedrooms"]["mean"], a["_bedrooms"]["std"])))))
bathrooms = max(1, abs(int(np.random.normal(a["_bathrooms"]["mean"], a["_bathrooms"]["std"]))))
ttw_transit = abs(int(
np.random.normal(a["_time_to_work_seconds_transit"]["mean"], a["_time_to_work_seconds_transit"]["std"])))
ttw_walking = abs(int(
np.random.normal(a["_time_to_work_seconds_walking"]["mean"], a["_time_to_work_seconds_walking"]["std"])))
type_int = int(np.random.binomial(1, a["type_int"]["parameter"]))
type = "HOUSE"
if type_int == 1:
type = "APARTMENTS"
d_code = a["_d_code"]
property.append(bedrooms * price_per_room)
property.append(type)
property.append(bedrooms)
property.append(bathrooms)
property.append(lat)
property.append(lng)
property.append(ttw_transit)
property.append(ttw_walking)
property.append(cl)
property.append(d_code)
properties.append(property)
cl += 1
df = pd.DataFrame(properties,
columns=["_price", "type", "_bedrooms", "_bathrooms", "lat", "lng", "_time_to_work_seconds_transit",
"_time_to_work_seconds_walking", "cluster", "_d_code"])
df.to_csv("generated.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment