In [66]:
%matplotlib inline
%load_ext ipycache

import pandas as pd
import numpy as np
import scipy
import sklearn as sk
import xgboost as xgb

from eli5 import show_weights

import seaborn as sns
sns.set()

import matplotlib.pyplot as plt


The ipycache extension is already loaded. To reload it, use:
  %reload_ext ipycache

In [77]:
train_raw = pd.read_csv("data/train.csv")
# train_raw = pd.read_csv("data/train_without_noise.csv")
test = pd.read_csv("data/test.csv")
macro = pd.read_csv("data/macro.csv")
train_raw.head()


Out[77]:
id timestamp full_sq life_sq floor max_floor material build_year num_room kitch_sq state product_type sub_area area_m raion_popul green_zone_part indust_part children_preschool preschool_quota preschool_education_centers_raion children_school school_quota school_education_centers_raion school_education_centers_top_20_raion hospital_beds_raion healthcare_centers_raion university_top_20_raion sport_objects_raion additional_education_raion culture_objects_top_25 culture_objects_top_25_raion shopping_centers_raion office_raion thermal_power_plant_raion incineration_raion oil_chemistry_raion radiation_raion railroad_terminal_raion big_market_raion nuclear_reactor_raion detention_facility_raion full_all male_f female_f young_all young_male young_female work_all work_male work_female ekder_all ekder_male ekder_female 0_6_all 0_6_male 0_6_female 7_14_all 7_14_male 7_14_female 0_17_all 0_17_male 0_17_female 16_29_all 16_29_male 16_29_female 0_13_all 0_13_male 0_13_female raion_build_count_with_material_info build_count_block build_count_wood build_count_frame build_count_brick build_count_monolith build_count_panel build_count_foam build_count_slag build_count_mix raion_build_count_with_builddate_info build_count_before_1920 build_count_1921-1945 build_count_1946-1970 build_count_1971-1995 build_count_after_1995 ID_metro metro_min_avto metro_km_avto metro_min_walk metro_km_walk kindergarten_km school_km park_km green_zone_km industrial_km water_treatment_km cemetery_km incineration_km railroad_station_walk_km railroad_station_walk_min ID_railroad_station_walk railroad_station_avto_km railroad_station_avto_min ID_railroad_station_avto public_transport_station_km public_transport_station_min_walk water_km water_1line mkad_km ttk_km sadovoe_km bulvar_ring_km kremlin_km big_road1_km ID_big_road1 big_road1_1line big_road2_km ID_big_road2 railroad_km railroad_1line zd_vokzaly_avto_km ID_railroad_terminal bus_terminal_avto_km ID_bus_terminal oil_chemistry_km nuclear_reactor_km radiation_km power_transmission_line_km thermal_power_plant_km ts_km big_market_km market_shop_km fitness_km swim_pool_km ice_rink_km stadium_km basketball_km hospice_morgue_km detention_facility_km public_healthcare_km university_km workplaces_km shopping_centers_km office_km additional_education_km preschool_km big_church_km church_synagogue_km mosque_km theater_km museum_km exhibition_km catering_km ecology green_part_500 prom_part_500 office_count_500 office_sqm_500 trc_count_500 trc_sqm_500 cafe_count_500 cafe_sum_500_min_price_avg cafe_sum_500_max_price_avg cafe_avg_price_500 cafe_count_500_na_price cafe_count_500_price_500 cafe_count_500_price_1000 cafe_count_500_price_1500 cafe_count_500_price_2500 cafe_count_500_price_4000 cafe_count_500_price_high big_church_count_500 church_count_500 mosque_count_500 leisure_count_500 sport_count_500 market_count_500 green_part_1000 prom_part_1000 office_count_1000 office_sqm_1000 trc_count_1000 trc_sqm_1000 cafe_count_1000 cafe_sum_1000_min_price_avg cafe_sum_1000_max_price_avg cafe_avg_price_1000 cafe_count_1000_na_price cafe_count_1000_price_500 cafe_count_1000_price_1000 cafe_count_1000_price_1500 cafe_count_1000_price_2500 cafe_count_1000_price_4000 cafe_count_1000_price_high big_church_count_1000 church_count_1000 mosque_count_1000 leisure_count_1000 sport_count_1000 market_count_1000 green_part_1500 prom_part_1500 office_count_1500 office_sqm_1500 trc_count_1500 trc_sqm_1500 cafe_count_1500 cafe_sum_1500_min_price_avg cafe_sum_1500_max_price_avg cafe_avg_price_1500 cafe_count_1500_na_price cafe_count_1500_price_500 cafe_count_1500_price_1000 cafe_count_1500_price_1500 cafe_count_1500_price_2500 cafe_count_1500_price_4000 cafe_count_1500_price_high big_church_count_1500 church_count_1500 mosque_count_1500 leisure_count_1500 sport_count_1500 market_count_1500 green_part_2000 prom_part_2000 office_count_2000 office_sqm_2000 trc_count_2000 trc_sqm_2000 cafe_count_2000 cafe_sum_2000_min_price_avg cafe_sum_2000_max_price_avg cafe_avg_price_2000 cafe_count_2000_na_price cafe_count_2000_price_500 cafe_count_2000_price_1000 cafe_count_2000_price_1500 cafe_count_2000_price_2500 cafe_count_2000_price_4000 cafe_count_2000_price_high big_church_count_2000 church_count_2000 mosque_count_2000 leisure_count_2000 sport_count_2000 market_count_2000 green_part_3000 prom_part_3000 office_count_3000 office_sqm_3000 trc_count_3000 trc_sqm_3000 cafe_count_3000 cafe_sum_3000_min_price_avg cafe_sum_3000_max_price_avg cafe_avg_price_3000 cafe_count_3000_na_price cafe_count_3000_price_500 cafe_count_3000_price_1000 cafe_count_3000_price_1500 cafe_count_3000_price_2500 cafe_count_3000_price_4000 cafe_count_3000_price_high big_church_count_3000 church_count_3000 mosque_count_3000 leisure_count_3000 sport_count_3000 market_count_3000 green_part_5000 prom_part_5000 office_count_5000 office_sqm_5000 trc_count_5000 trc_sqm_5000 cafe_count_5000 cafe_sum_5000_min_price_avg cafe_sum_5000_max_price_avg cafe_avg_price_5000 cafe_count_5000_na_price cafe_count_5000_price_500 cafe_count_5000_price_1000 cafe_count_5000_price_1500 cafe_count_5000_price_2500 cafe_count_5000_price_4000 cafe_count_5000_price_high big_church_count_5000 church_count_5000 mosque_count_5000 leisure_count_5000 sport_count_5000 market_count_5000 price_doc
0 1 2011-08-20 43 27.0 4.0 NaN NaN NaN NaN NaN NaN Investment Bibirevo 6.407578e+06 155572 0.189727 0.000070 9576 5001.0 5 10309 11065.0 5 0 240.0 1 0 7 3 no 0 16 1 no no no no no no no no 86206 40477 45729 21154 11007 10147 98207 52277 45930 36211 10580 25631 9576 4899 4677 10309 5463 4846 23603 12286 11317 17508 9425 8083 18654 9709 8945 211.0 25.0 0.0 0.0 0.0 2.0 184.0 0.0 0.0 0.0 211.0 0.0 0.0 0.0 206.0 5.0 1 2.590241 1.131260 13.575119 1.131260 0.145700 0.177975 2.158587 0.600973 1.080934 23.683460 1.804127 3.633334 5.419893 65.038716 1.0 5.419893 6.905893 1 0.274985 3.299822 0.992631 no 1.422391 10.918587 13.100618 13.675657 15.156211 1.422391 1 no 3.830951 5 1.305159 no 14.231961 101 24.292406 1 18.152338 5.718519 1.210027 1.062513 5.814135 4.308127 10.814172 1.676258 0.485841 3.065047 1.107594 8.148591 3.516513 2.392353 4.248036 0.974743 6.715026 0.884350 0.648488 0.637189 0.947962 0.177975 0.625783 0.628187 3.932040 14.053047 7.389498 7.023705 0.516838 good 0.00 0.00 0 0 0 0 0 NaN NaN NaN 0 0 0 0 0 0 0 0 0 0 0 1 0 7.36 0.00 1 30500 3 55600 19 527.78 888.89 708.33 1 10 4 3 1 0 0 1 2 0 0 6 1 14.27 6.92 3 39554 9 171420 34 566.67 969.70 768.18 1 14 11 6 2 0 0 1 2 0 0 7 1 11.77 15.97 9 188854 19 1244891 36 614.29 1042.86 828.57 1 15 11 6 2 1 0 1 2 0 0 10 1 11.98 13.55 12 251554 23 1419204 68 639.68 1079.37 859.52 5 21 22 16 3 1 0 2 4 0 0 21 1 13.09 13.31 29 807385 52 4036616 152 708.57 1185.71 947.14 12 39 48 40 9 4 0 13 22 1 0 52 4 5850000
1 2 2011-08-23 34 19.0 3.0 NaN NaN NaN NaN NaN NaN Investment Nagatinskij Zaton 9.589337e+06 115352 0.372602 0.049637 6880 3119.0 5 7759 6237.0 8 0 229.0 1 0 6 1 yes 1 3 0 no no no no no no no no 76284 34200 42084 15727 7925 7802 70194 35622 34572 29431 9266 20165 6880 3466 3414 7759 3909 3850 17700 8998 8702 15164 7571 7593 13729 6929 6800 245.0 83.0 1.0 0.0 67.0 4.0 90.0 0.0 0.0 0.0 244.0 1.0 1.0 143.0 84.0 15.0 2 0.936700 0.647337 7.620630 0.635053 0.147754 0.273345 0.550690 0.065321 0.966479 1.317476 4.655004 8.648587 3.411993 40.943917 2.0 3.641773 4.679745 2 0.065263 0.783160 0.698081 no 9.503405 3.103996 6.444333 8.132640 8.698054 2.887377 2 no 3.103996 4 0.694536 no 9.242586 32 5.706113 2 9.034642 3.489954 2.724295 1.246149 3.419574 0.725560 6.910568 3.424716 0.668364 2.000154 8.972823 6.127073 1.161579 2.543747 12.649879 1.477723 1.852560 0.686252 0.519311 0.688796 1.072315 0.273345 0.967821 0.471447 4.841544 6.829889 0.709260 2.358840 0.230287 excellent 25.14 0.00 0 0 0 0 5 860.00 1500.00 1180.00 0 1 3 0 0 1 0 0 1 0 0 0 0 26.66 0.07 2 86600 5 94065 13 615.38 1076.92 846.15 0 5 6 1 0 1 0 1 2 0 4 2 0 21.53 7.71 3 102910 7 127065 17 694.12 1205.88 950.00 0 6 7 1 2 1 0 1 5 0 4 9 0 22.37 19.25 4 165510 8 179065 21 695.24 1190.48 942.86 0 7 8 3 2 1 0 1 5 0 4 11 0 18.07 27.32 12 821986 14 491565 30 631.03 1086.21 858.62 1 11 11 4 2 1 0 1 7 0 6 19 1 10.26 27.47 66 2690465 40 2034942 177 673.81 1148.81 911.31 9 49 65 36 15 3 0 15 29 1 10 66 14 6000000
2 3 2011-08-27 43 29.0 2.0 NaN NaN NaN NaN NaN NaN Investment Tekstil'shhiki 4.808270e+06 101708 0.112560 0.118537 5879 1463.0 4 6207 5580.0 7 0 1183.0 1 0 5 1 no 0 0 1 no no no yes no no no no 101982 46076 55906 13028 6835 6193 63388 31813 31575 25292 7609 17683 5879 3095 2784 6207 3269 2938 14884 7821 7063 19401 9045 10356 11252 5916 5336 330.0 59.0 0.0 0.0 206.0 4.0 60.0 0.0 1.0 0.0 330.0 1.0 0.0 246.0 63.0 20.0 3 2.120999 1.637996 17.351515 1.445960 0.049102 0.158072 0.374848 0.453172 0.939275 4.912660 3.381083 11.996480 1.277658 15.331896 3.0 1.277658 1.701420 3 0.328756 3.945073 0.468265 no 5.604800 2.927487 6.963403 8.054252 9.067885 0.647250 3 no 2.927487 4 0.700691 no 9.540544 5 6.710302 3 5.777394 7.506612 0.772216 1.602183 3.682455 3.562188 5.752368 1.375443 0.733101 1.239304 1.978517 0.767569 1.952771 0.621357 7.682303 0.097144 0.841254 1.510089 1.486533 1.543049 0.391957 0.158072 3.178751 0.755946 7.922152 4.273200 3.156423 4.958214 0.190462 poor 1.67 0.00 0 0 0 0 3 666.67 1166.67 916.67 0 0 2 1 0 0 0 0 0 0 0 0 0 4.99 0.29 0 0 0 0 9 642.86 1142.86 892.86 2 0 5 2 0 0 0 0 1 0 0 5 3 9.92 6.73 0 0 1 2600 14 516.67 916.67 716.67 2 4 6 2 0 0 0 0 4 0 0 6 5 12.99 12.75 4 100200 7 52550 24 563.64 977.27 770.45 2 8 9 4 1 0 0 0 4 0 0 8 5 12.14 26.46 8 110856 7 52550 41 697.44 1192.31 944.87 2 9 17 9 3 1 0 0 11 0 0 20 6 13.69 21.58 43 1478160 35 1572990 122 702.68 1196.43 949.55 10 29 45 25 10 3 0 11 27 0 4 67 10 5700000
3 4 2011-09-01 89 50.0 9.0 NaN NaN NaN NaN NaN NaN Investment Mitino 1.258354e+07 178473 0.194703 0.069753 13087 6839.0 9 13670 17063.0 10 0 NaN 1 0 17 6 no 0 11 4 no no no no no no no no 21155 9828 11327 28563 14680 13883 120381 60040 60341 29529 9083 20446 13087 6645 6442 13670 7126 6544 32063 16513 15550 3292 1450 1842 24934 12782 12152 458.0 9.0 51.0 12.0 124.0 50.0 201.0 0.0 9.0 2.0 459.0 13.0 24.0 40.0 130.0 252.0 4 1.489049 0.984537 11.565624 0.963802 0.179441 0.236455 0.078090 0.106125 0.451173 15.623710 2.017080 14.317640 4.291432 51.497190 4.0 3.816045 5.271136 4 0.131597 1.579164 1.200336 no 2.677824 14.606501 17.457198 18.309433 19.487005 2.677824 1 no 2.780449 17 1.999265 no 17.478380 83 6.734618 1 27.667863 9.522538 6.348716 1.767612 11.178333 0.583025 27.892717 0.811275 0.623484 1.950317 6.483172 7.385521 4.923843 3.549558 8.789894 2.163735 10.903161 0.622272 0.599914 0.934273 0.892674 0.236455 1.031777 1.561505 15.300449 16.990677 16.041521 5.029696 0.465820 good 17.36 0.57 0 0 0 0 2 1000.00 1500.00 1250.00 0 0 0 2 0 0 0 0 0 0 0 0 0 19.25 10.35 1 11000 6 80780 12 658.33 1083.33 870.83 0 3 4 5 0 0 0 0 0 0 0 3 1 28.38 6.57 2 11000 7 89492 23 673.91 1130.43 902.17 0 5 9 8 1 0 0 1 0 0 0 9 2 32.29 5.73 2 11000 7 89492 25 660.00 1120.00 890.00 0 5 11 8 1 0 0 1 1 0 0 13 2 20.79 3.57 4 167000 12 205756 32 718.75 1218.75 968.75 0 5 14 10 3 0 0 1 2 0 0 18 3 14.18 3.89 8 244166 22 942180 61 931.58 1552.63 1242.11 4 7 21 15 11 2 1 4 4 0 0 26 3 13100000
4 5 2011-09-05 77 77.0 4.0 NaN NaN NaN NaN NaN NaN Investment Basmannoe 8.398461e+06 108171 0.015234 0.037316 5706 3240.0 7 6748 7770.0 9 0 562.0 4 2 25 2 no 0 10 93 no no no yes yes no no no 28179 13522 14657 13368 7159 6209 68043 34236 33807 26760 8563 18197 5706 2982 2724 6748 3664 3084 15237 8113 7124 5164 2583 2581 11631 6223 5408 746.0 48.0 0.0 0.0 643.0 16.0 35.0 0.0 3.0 1.0 746.0 371.0 114.0 146.0 62.0 53.0 5 1.257186 0.876620 8.266305 0.688859 0.247901 0.376838 0.258289 0.236214 0.392871 10.683540 2.936581 11.903910 0.853960 10.247521 5.0 1.595898 2.156284 113 0.071480 0.857764 0.820294 no 11.616653 1.721834 0.046810 0.787593 2.578671 1.721834 4 no 3.133531 10 0.084113 yes 1.595898 113 1.423428 4 6.515857 8.671016 1.638318 3.632640 4.587917 2.609420 9.155057 1.969738 0.220288 2.544696 3.975401 3.610754 0.307915 1.864637 3.779781 1.121703 0.991683 0.892668 0.429052 0.077901 0.810801 0.376838 0.378756 0.121681 2.584370 1.112486 1.800125 1.339652 0.026102 excellent 3.56 4.44 15 293699 1 45000 48 702.22 1166.67 934.44 3 17 10 11 7 0 0 1 4 0 2 3 0 3.34 8.29 46 420952 3 158200 153 763.45 1272.41 1017.93 8 39 45 39 19 2 1 7 12 0 6 7 0 4.12 4.83 93 1195735 9 445900 272 766.80 1272.73 1019.76 19 70 74 72 30 6 1 18 30 0 10 14 2 4.53 5.02 149 1625130 17 564843 483 765.93 1269.23 1017.58 28 130 129 131 50 14 1 35 61 0 17 21 3 5.06 8.62 305 3420907 60 2296870 1068 853.03 1410.45 1131.74 63 266 267 262 149 57 4 70 121 1 40 77 5 8.38 10.92 689 8404624 114 3503058 2283 853.88 1411.45 1132.66 143 566 578 552 319 108 17 135 236 2 91 195 14 16331452

In [14]:
def preprocess_anomaly(df):
    df["full_sq"] = map(lambda x: x if x > 10 else float("NaN"), df["full_sq"])
    df["life_sq"] = map(lambda x: x if x > 5 else float("NaN"), df["life_sq"])
    df["kitch_sq"] = map(lambda x: x if x > 2 else float("NaN"), df["kitch_sq"])
    
    # superclean
    # https://www.kaggle.com/keremt/very-extensive-cleaning-by-sberbank-discussions
    df.ix[df[df.life_sq > df.full_sq].index, "life_sq"] = np.NaN
    df.ix[df[df.kitch_sq >= df.life_sq].index, "kitch_sq"] = np.NaN

    df.ix[df[df.kitch_sq == 0].index, "kitch_sq"] = np.NaN
    df.ix[df[df.kitch_sq == 1].index, "kitch_sq"] = np.NaN

    df.ix[df[df.num_room == 0].index, "num_room"] = np.NaN
    
    df.ix[df[df.floor == 0].index, "floor"] = np.NaN
    df.ix[df[df.max_floor == 0].index, "max_floor"] = np.NaN
    
    df.ix[df[df.floor > df.max_floor].index, "max_floor"] = np.NaN
    
    df.ix[df[df.state == 33].index, "state"] = np.NaN
    
    df.ix[df[df.build_year == 20052009].index, "build_year"] = 2005
    df.ix[df[df.build_year == 20].index, "build_year"] = 2000
    df.ix[df[df.build_year == 215].index, "build_year"] = 2015

    df.ix[df[df.build_year < 1500].index, "build_year"] = np.NaN
    df.ix[df[df.build_year > 2022].index, "build_year"] = np.NaN

    return df

train = preprocess_anomaly(train_raw)
train["material"] = train.material.fillna(0).astype(int).astype(str)
train["state"] = train.state.fillna(0).astype(int).astype(str)

In [17]:
cnts = []
for c in list(train.columns):
    cnts.append((c, len(train[c].value_counts())))

sorted(cnts, key=lambda x: x[1])[:50]


Out[17]:
[('product_type', 2),
 ('culture_objects_top_25', 2),
 ('thermal_power_plant_raion', 2),
 ('incineration_raion', 2),
 ('oil_chemistry_raion', 2),
 ('radiation_raion', 2),
 ('railroad_terminal_raion', 2),
 ('big_market_raion', 2),
 ('nuclear_reactor_raion', 2),
 ('detention_facility_raion', 2),
 ('water_1line', 2),
 ('big_road1_1line', 2),
 ('railroad_1line', 2),
 ('mosque_count_500', 2),
 ('mosque_count_1000', 2),
 ('mosque_count_1500', 2),
 ('mosque_count_2000', 2),
 ('school_education_centers_top_20_raion', 3),
 ('mosque_count_3000', 3),
 ('mosque_count_5000', 3),
 ('university_top_20_raion', 4),
 ('build_count_foam', 4),
 ('cafe_count_500_price_high', 4),
 ('state', 5),
 ('ecology', 5),
 ('market_count_500', 5),
 ('culture_objects_top_25_raion', 6),
 ('material', 7),
 ('healthcare_centers_raion', 7),
 ('market_count_1000', 7),
 ('ID_railroad_terminal', 8),
 ('cafe_count_1000_price_high', 8),
 ('market_count_1500', 8),
 ('build_count_mix', 9),
 ('trc_count_500', 9),
 ('market_count_2000', 9),
 ('leisure_count_500', 10),
 ('big_church_count_500', 11),
 ('market_count_3000', 11),
 ('additional_education_raion', 12),
 ('sport_count_500', 12),
 ('num_room', 13),
 ('preschool_education_centers_raion', 13),
 ('cafe_count_500_na_price', 13),
 ('cafe_count_1500_price_high', 13),
 ('school_education_centers_raion', 14),
 ('ID_bus_terminal', 14),
 ('cafe_count_500_price_4000', 14),
 ('church_count_500', 15),
 ('shopping_centers_raion', 16)]

In [24]:
train.build_count_mix.value_counts()


Out[24]:
0.0    20422
1.0     2066
2.0      999
5.0      872
4.0      518
9.0      237
3.0      173
8.0      149
6.0       44
Name: build_count_mix, dtype: int64

In [22]:
len(train)


Out[22]:
30471

In [62]:
from sklearn.utils import shuffle

folds = np.array_split(shuffle(train), 3)

def smoothed_likelihood(targ_mean, nrows, globalmean, alpha=10):
    try:
        return (targ_mean * nrows + globalmean * alpha) / (nrows + alpha)
    except Exception:
        return float("NaN")
    

def mess_y_categorial(fold_raw, other_fold, cols=None, y_col="price_doc", alpha=10):
    fold = fold_raw.copy()
    if not cols:
        cols = list(fold.select_dtypes(include=["object"]).columns)
    globalmean = other_fold[y_col].mean()
    for c in cols:
        print c

        target_mean = other_fold[[c, y_col]].groupby(c).mean().to_dict()[y_col]
        nrows = other_fold[c].value_counts().to_dict()

        fold[c + "_sll"] = fold[c].apply(
            lambda x: smoothed_likelihood(target_mean.get(x), nrows.get(x), globalmean, alpha)
        )
    return fold

mess_y_categorial(folds[0], pd.concat(folds[1:]))[["sub_area", "sub_area_sll"]]


timestamp
material
product_type
sub_area
culture_objects_top_25
thermal_power_plant_raion
incineration_raion
oil_chemistry_raion
radiation_raion
railroad_terminal_raion
big_market_raion
nuclear_reactor_raion
detention_facility_raion
water_1line
big_road1_1line
railroad_1line
ecology
Out[62]:
sub_area sub_area_sll
12280 Poselenie Krasnopahorskoe 4.653535e+06
11161 Sokolinaja Gora 7.391695e+06
12415 Golovinskoe 6.294542e+06
26337 Poselenie Desjonovskoe 4.458138e+06
19729 Juzhnoe Butovo 6.730091e+06
14234 Severnoe Butovo 7.753506e+06
9771 Vostochnoe Izmajlovo 5.770759e+06
16199 Nekrasovka 5.489649e+06
1218 Birjulevo Vostochnoe 5.543824e+06
19990 Poselenie Filimonkovskoe 3.466832e+06
27768 Hovrino 8.338999e+06
21472 Matushkino 5.306373e+06
15993 Ochakovo-Matveevskoe 7.364254e+06
24264 Presnenskoe 1.345882e+07
20495 Poselenie Novofedorovskoe 3.152466e+06
4582 Poselenie Sosenskoe 5.313860e+06
22652 Birjulevo Zapadnoe 5.459305e+06
14953 Jaroslavskoe 6.487776e+06
7449 Nekrasovka 5.489649e+06
25488 Vyhino-Zhulebino 6.724186e+06
21002 Caricyno 5.932586e+06
14572 Kuz'minki 6.142139e+06
9613 Birjulevo Vostochnoe 5.543824e+06
20020 Severnoe Butovo 7.753506e+06
16054 Izmajlovo 8.997227e+06
10386 Caricyno 5.932586e+06
22904 Tverskoe 7.000162e+06
23175 Chertanovo Juzhnoe 6.936418e+06
21615 Presnenskoe 1.345882e+07
22729 Tverskoe 7.000162e+06
... ... ...
1392 Lianozovo 6.462309e+06
23372 Krjukovo 5.978716e+06
28985 Poselenie Sosenskoe 5.313860e+06
4436 Poselenie Sosenskoe 5.313860e+06
24829 Poselenie Vnukovskoe 6.167100e+06
6611 Jasenevo 8.259826e+06
16704 Nagornoe 9.523601e+06
19242 Poselenie Vnukovskoe 6.167100e+06
16177 Nekrasovka 5.489649e+06
3181 Babushkinskoe 7.910514e+06
9266 Vnukovo 5.458270e+06
15521 Levoberezhnoe 8.899299e+06
10587 Jakimanka 1.223120e+07
20988 Severnoe Medvedkovo 6.739320e+06
5116 Nagatinskij Zaton 8.431953e+06
1239 Jasenevo 8.259826e+06
16545 Savelovskoe 8.100778e+06
6542 Severnoe Izmajlovo 6.050553e+06
23049 Butyrskoe 7.102266e+06
25563 Strogino 9.093722e+06
8336 Poselenie Sosenskoe 5.313860e+06
18889 Tverskoe 7.000162e+06
13008 Otradnoe 7.144612e+06
29599 Krjukovo 5.978716e+06
6322 Poselenie Moskovskij 5.655976e+06
20429 Krjukovo 5.978716e+06
23541 Golovinskoe 6.294542e+06
526 Severnoe Tushino 7.670261e+06
7186 Ochakovo-Matveevskoe 7.364254e+06
15114 Sviblovo 8.261867e+06

10157 rows × 2 columns


In [36]:
len(folds)


Out[36]:
3

In [ ]: