Add. LinearRegression initialization

pull/2/head
benjas 4 years ago
parent cc5b0cd8c7
commit 73b86afa29

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/第二章——手写线性回归算法.iml" filepath="$PROJECT_DIR$/.idea/第二章——手写线性回归算法.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="pytest" />
<option name="PROJECT_TEST_RUNNER" value="pytest" />
</component>
</module>

@ -0,0 +1,30 @@
import numpy as np
from util.features import prepare_for_training
class LinearRegression:
def __init__(self, data, labels, polynomial_degree=0, sinusoid_degree=0, normalize_data=True):
"""
1.对数据进行预处理操作
2.先得到所有的特征个数
3.初始化参数矩阵
data:数据
polynomial_degree: 是否做额外变换
sinusoid_degree: 是否做额外变换
normalize_data: 是否标准化数据
:return
"""
(data_processed,
features_mean,
features_deviation) = prepare_for_training.prepare_for_training(data, polynomial_degree, sinusoid_degree,
normalize_data)
self.data = data_processed
self.labels = labels
self.features_mean = features_mean
self.features_deviation = features_deviation
self.polynomial_degree = polynomial_degree
self.sinusoid_degree = sinusoid_degree
self.normalize_data = normalize_data

@ -0,0 +1,251 @@
y,x
97.58776,1.000000
97.76344,2.000000
96.56705,3.000000
92.52037,4.000000
91.15097,5.000000
95.21728,6.000000
90.21355,7.000000
89.29235,8.000000
91.51479,9.000000
89.60966,10.000000
86.56187,11.00000
85.55316,12.00000
87.13054,13.00000
85.67940,14.00000
80.04851,15.00000
82.18925,16.00000
87.24081,17.00000
80.79407,18.00000
81.28570,19.00000
81.56940,20.00000
79.22715,21.00000
79.43275,22.00000
77.90195,23.00000
76.75468,24.00000
77.17377,25.00000
74.27348,26.00000
73.11900,27.00000
73.84826,28.00000
72.47870,29.00000
71.92292,30.00000
66.92176,31.00000
67.93835,32.00000
69.56207,33.00000
69.07066,34.00000
66.53983,35.00000
63.87883,36.00000
69.71537,37.00000
63.60588,38.00000
63.37154,39.00000
60.01835,40.00000
62.67481,41.00000
65.80666,42.00000
59.14304,43.00000
56.62951,44.00000
61.21785,45.00000
54.38790,46.00000
62.93443,47.00000
56.65144,48.00000
57.13362,49.00000
58.29689,50.00000
58.91744,51.00000
58.50172,52.00000
55.22885,53.00000
58.30375,54.00000
57.43237,55.00000
51.69407,56.00000
49.93132,57.00000
53.70760,58.00000
55.39712,59.00000
52.89709,60.00000
52.31649,61.00000
53.98720,62.00000
53.54158,63.00000
56.45046,64.00000
51.32276,65.00000
53.11676,66.00000
53.28631,67.00000
49.80555,68.00000
54.69564,69.00000
56.41627,70.00000
54.59362,71.00000
54.38520,72.00000
60.15354,73.00000
59.78773,74.00000
60.49995,75.00000
65.43885,76.00000
60.70001,77.00000
63.71865,78.00000
67.77139,79.00000
64.70934,80.00000
70.78193,81.00000
70.38651,82.00000
77.22359,83.00000
79.52665,84.00000
80.13077,85.00000
85.67823,86.00000
85.20647,87.00000
90.24548,88.00000
93.61953,89.00000
95.86509,90.00000
93.46992,91.00000
105.8137,92.00000
107.8269,93.00000
114.0607,94.00000
115.5019,95.00000
118.5110,96.00000
119.6177,97.00000
122.1940,98.00000
126.9903,99.00000
125.7005,100.00000
123.7447,101.00000
130.6543,102.00000
129.7168,103.00000
131.8240,104.00000
131.8759,105.00000
131.9994,106.0000
132.1221,107.0000
133.4414,108.0000
133.8252,109.0000
133.6695,110.0000
128.2851,111.0000
126.5182,112.0000
124.7550,113.0000
118.4016,114.0000
122.0334,115.0000
115.2059,116.0000
118.7856,117.0000
110.7387,118.0000
110.2003,119.0000
105.17290,120.0000
103.44720,121.0000
94.54280,122.0000
94.40526,123.0000
94.57964,124.0000
88.76605,125.0000
87.28747,126.0000
92.50443,127.0000
86.27997,128.0000
82.44307,129.0000
80.47367,130.0000
78.36608,131.0000
78.74307,132.0000
76.12786,133.0000
79.13108,134.0000
76.76062,135.0000
77.60769,136.0000
77.76633,137.0000
81.28220,138.0000
79.74307,139.0000
81.97964,140.0000
80.02952,141.0000
85.95232,142.0000
85.96838,143.0000
79.94789,144.0000
87.17023,145.0000
90.50992,146.0000
93.23373,147.0000
89.14803,148.0000
93.11492,149.0000
90.34337,150.0000
93.69421,151.0000
95.74256,152.0000
91.85105,153.0000
96.74503,154.0000
87.60996,155.0000
90.47012,156.0000
88.11690,157.0000
85.70673,158.0000
85.01361,159.0000
78.53040,160.0000
81.34148,161.0000
75.19295,162.0000
72.66115,163.0000
69.85504,164.0000
66.29476,165.0000
63.58502,166.0000
58.33847,167.0000
57.50766,168.0000
52.80498,169.0000
50.79319,170.0000
47.03490,171.0000
46.47090,172.0000
43.09016,173.0000
34.11531,174.0000
39.28235,175.0000
32.68386,176.0000
30.44056,177.0000
31.98932,178.0000
23.63330,179.0000
23.69643,180.0000
20.26812,181.0000
19.07074,182.0000
17.59544,183.0000
16.08785,184.0000
18.94267,185.0000
18.61354,186.0000
17.25800,187.0000
16.62285,188.0000
13.48367,189.0000
15.37647,190.0000
13.47208,191.0000
15.96188,192.0000
12.32547,193.0000
16.33880,194.0000
10.438330,195.0000
9.628715,196.0000
13.12268,197.0000
8.772417,198.0000
11.76143,199.0000
12.55020,200.0000
11.33108,201.0000
11.20493,202.0000
7.816916,203.0000
6.800675,204.0000
14.26581,205.0000
10.66285,206.0000
8.911574,207.0000
11.56733,208.0000
11.58207,209.0000
11.59071,210.0000
9.730134,211.0000
11.44237,212.0000
11.22912,213.0000
10.172130,214.0000
12.50905,215.0000
6.201493,216.0000
9.019605,217.0000
10.80607,218.0000
13.09625,219.0000
3.914271,220.0000
9.567886,221.0000
8.038448,222.0000
10.231040,223.0000
9.367410,224.0000
7.695971,225.0000
6.118575,226.0000
8.793207,227.0000
7.796692,228.0000
12.45065,229.0000
10.61601,230.0000
6.001003,231.0000
6.765098,232.0000
8.764653,233.0000
4.586418,234.0000
8.390783,235.0000
7.209202,236.0000
10.012090,237.0000
7.327461,238.0000
6.525136,239.0000
2.840065,240.0000
10.323710,241.0000
4.790035,242.0000
8.376431,243.0000
6.263980,244.0000
2.705892,245.0000
8.362109,246.0000
8.983507,247.0000
3.362469,248.0000
1.182678,249.0000
4.875312,250.0000
1 y x
2 97.58776 1.000000
3 97.76344 2.000000
4 96.56705 3.000000
5 92.52037 4.000000
6 91.15097 5.000000
7 95.21728 6.000000
8 90.21355 7.000000
9 89.29235 8.000000
10 91.51479 9.000000
11 89.60966 10.000000
12 86.56187 11.00000
13 85.55316 12.00000
14 87.13054 13.00000
15 85.67940 14.00000
16 80.04851 15.00000
17 82.18925 16.00000
18 87.24081 17.00000
19 80.79407 18.00000
20 81.28570 19.00000
21 81.56940 20.00000
22 79.22715 21.00000
23 79.43275 22.00000
24 77.90195 23.00000
25 76.75468 24.00000
26 77.17377 25.00000
27 74.27348 26.00000
28 73.11900 27.00000
29 73.84826 28.00000
30 72.47870 29.00000
31 71.92292 30.00000
32 66.92176 31.00000
33 67.93835 32.00000
34 69.56207 33.00000
35 69.07066 34.00000
36 66.53983 35.00000
37 63.87883 36.00000
38 69.71537 37.00000
39 63.60588 38.00000
40 63.37154 39.00000
41 60.01835 40.00000
42 62.67481 41.00000
43 65.80666 42.00000
44 59.14304 43.00000
45 56.62951 44.00000
46 61.21785 45.00000
47 54.38790 46.00000
48 62.93443 47.00000
49 56.65144 48.00000
50 57.13362 49.00000
51 58.29689 50.00000
52 58.91744 51.00000
53 58.50172 52.00000
54 55.22885 53.00000
55 58.30375 54.00000
56 57.43237 55.00000
57 51.69407 56.00000
58 49.93132 57.00000
59 53.70760 58.00000
60 55.39712 59.00000
61 52.89709 60.00000
62 52.31649 61.00000
63 53.98720 62.00000
64 53.54158 63.00000
65 56.45046 64.00000
66 51.32276 65.00000
67 53.11676 66.00000
68 53.28631 67.00000
69 49.80555 68.00000
70 54.69564 69.00000
71 56.41627 70.00000
72 54.59362 71.00000
73 54.38520 72.00000
74 60.15354 73.00000
75 59.78773 74.00000
76 60.49995 75.00000
77 65.43885 76.00000
78 60.70001 77.00000
79 63.71865 78.00000
80 67.77139 79.00000
81 64.70934 80.00000
82 70.78193 81.00000
83 70.38651 82.00000
84 77.22359 83.00000
85 79.52665 84.00000
86 80.13077 85.00000
87 85.67823 86.00000
88 85.20647 87.00000
89 90.24548 88.00000
90 93.61953 89.00000
91 95.86509 90.00000
92 93.46992 91.00000
93 105.8137 92.00000
94 107.8269 93.00000
95 114.0607 94.00000
96 115.5019 95.00000
97 118.5110 96.00000
98 119.6177 97.00000
99 122.1940 98.00000
100 126.9903 99.00000
101 125.7005 100.00000
102 123.7447 101.00000
103 130.6543 102.00000
104 129.7168 103.00000
105 131.8240 104.00000
106 131.8759 105.00000
107 131.9994 106.0000
108 132.1221 107.0000
109 133.4414 108.0000
110 133.8252 109.0000
111 133.6695 110.0000
112 128.2851 111.0000
113 126.5182 112.0000
114 124.7550 113.0000
115 118.4016 114.0000
116 122.0334 115.0000
117 115.2059 116.0000
118 118.7856 117.0000
119 110.7387 118.0000
120 110.2003 119.0000
121 105.17290 120.0000
122 103.44720 121.0000
123 94.54280 122.0000
124 94.40526 123.0000
125 94.57964 124.0000
126 88.76605 125.0000
127 87.28747 126.0000
128 92.50443 127.0000
129 86.27997 128.0000
130 82.44307 129.0000
131 80.47367 130.0000
132 78.36608 131.0000
133 78.74307 132.0000
134 76.12786 133.0000
135 79.13108 134.0000
136 76.76062 135.0000
137 77.60769 136.0000
138 77.76633 137.0000
139 81.28220 138.0000
140 79.74307 139.0000
141 81.97964 140.0000
142 80.02952 141.0000
143 85.95232 142.0000
144 85.96838 143.0000
145 79.94789 144.0000
146 87.17023 145.0000
147 90.50992 146.0000
148 93.23373 147.0000
149 89.14803 148.0000
150 93.11492 149.0000
151 90.34337 150.0000
152 93.69421 151.0000
153 95.74256 152.0000
154 91.85105 153.0000
155 96.74503 154.0000
156 87.60996 155.0000
157 90.47012 156.0000
158 88.11690 157.0000
159 85.70673 158.0000
160 85.01361 159.0000
161 78.53040 160.0000
162 81.34148 161.0000
163 75.19295 162.0000
164 72.66115 163.0000
165 69.85504 164.0000
166 66.29476 165.0000
167 63.58502 166.0000
168 58.33847 167.0000
169 57.50766 168.0000
170 52.80498 169.0000
171 50.79319 170.0000
172 47.03490 171.0000
173 46.47090 172.0000
174 43.09016 173.0000
175 34.11531 174.0000
176 39.28235 175.0000
177 32.68386 176.0000
178 30.44056 177.0000
179 31.98932 178.0000
180 23.63330 179.0000
181 23.69643 180.0000
182 20.26812 181.0000
183 19.07074 182.0000
184 17.59544 183.0000
185 16.08785 184.0000
186 18.94267 185.0000
187 18.61354 186.0000
188 17.25800 187.0000
189 16.62285 188.0000
190 13.48367 189.0000
191 15.37647 190.0000
192 13.47208 191.0000
193 15.96188 192.0000
194 12.32547 193.0000
195 16.33880 194.0000
196 10.438330 195.0000
197 9.628715 196.0000
198 13.12268 197.0000
199 8.772417 198.0000
200 11.76143 199.0000
201 12.55020 200.0000
202 11.33108 201.0000
203 11.20493 202.0000
204 7.816916 203.0000
205 6.800675 204.0000
206 14.26581 205.0000
207 10.66285 206.0000
208 8.911574 207.0000
209 11.56733 208.0000
210 11.58207 209.0000
211 11.59071 210.0000
212 9.730134 211.0000
213 11.44237 212.0000
214 11.22912 213.0000
215 10.172130 214.0000
216 12.50905 215.0000
217 6.201493 216.0000
218 9.019605 217.0000
219 10.80607 218.0000
220 13.09625 219.0000
221 3.914271 220.0000
222 9.567886 221.0000
223 8.038448 222.0000
224 10.231040 223.0000
225 9.367410 224.0000
226 7.695971 225.0000
227 6.118575 226.0000
228 8.793207 227.0000
229 7.796692 228.0000
230 12.45065 229.0000
231 10.61601 230.0000
232 6.001003 231.0000
233 6.765098 232.0000
234 8.764653 233.0000
235 4.586418 234.0000
236 8.390783 235.0000
237 7.209202 236.0000
238 10.012090 237.0000
239 7.327461 238.0000
240 6.525136 239.0000
241 2.840065 240.0000
242 10.323710 241.0000
243 4.790035 242.0000
244 8.376431 243.0000
245 6.263980 244.0000
246 2.705892 245.0000
247 8.362109 246.0000
248 8.983507 247.0000
249 3.362469 248.0000
250 1.182678 249.0000
251 4.875312 250.0000

@ -0,0 +1,156 @@
"Country","Happiness.Rank","Happiness.Score","Whisker.high","Whisker.low","Economy..GDP.per.Capita.","Family","Health..Life.Expectancy.","Freedom","Generosity","Trust..Government.Corruption.","Dystopia.Residual"
"Norway",1,7.53700017929077,7.59444482058287,7.47955553799868,1.61646318435669,1.53352355957031,0.796666502952576,0.635422587394714,0.36201223731041,0.315963834524155,2.27702665328979
"Denmark",2,7.52199983596802,7.58172806486487,7.46227160707116,1.48238301277161,1.55112159252167,0.792565524578094,0.626006722450256,0.355280488729477,0.40077006816864,2.31370735168457
"Iceland",3,7.50400018692017,7.62203047305346,7.38596990078688,1.480633020401,1.6105740070343,0.833552122116089,0.627162635326385,0.475540220737457,0.153526559472084,2.32271528244019
"Switzerland",4,7.49399995803833,7.56177242040634,7.42622749567032,1.56497955322266,1.51691174507141,0.858131289482117,0.620070576667786,0.290549278259277,0.367007285356522,2.2767162322998
"Finland",5,7.4689998626709,7.52754207581282,7.41045764952898,1.44357192516327,1.5402467250824,0.80915766954422,0.617950856685638,0.24548277258873,0.38261154294014,2.4301815032959
"Netherlands",6,7.3769998550415,7.42742584124207,7.32657386884093,1.50394463539124,1.42893922328949,0.810696125030518,0.585384488105774,0.470489829778671,0.282661825418472,2.29480409622192
"Canada",7,7.31599998474121,7.38440283536911,7.24759713411331,1.47920441627502,1.48134899139404,0.83455765247345,0.611100912094116,0.435539722442627,0.287371516227722,2.18726444244385
"New Zealand",8,7.31400012969971,7.3795104418695,7.24848981752992,1.40570604801178,1.54819512367249,0.816759705543518,0.614062130451202,0.500005125999451,0.382816702127457,2.0464563369751
"Sweden",9,7.28399991989136,7.34409487739205,7.22390496239066,1.49438726902008,1.47816216945648,0.830875158309937,0.612924098968506,0.385399252176285,0.384398728609085,2.09753799438477
"Australia",10,7.28399991989136,7.35665122494102,7.2113486148417,1.484414935112,1.51004195213318,0.84388679265976,0.601607382297516,0.477699249982834,0.301183730363846,2.06521081924438
"Israel",11,7.21299982070923,7.27985325649381,7.14614638492465,1.37538242340088,1.37628996372223,0.83840399980545,0.405988603830338,0.330082654953003,0.0852421000599861,2.80175733566284
"Costa Rica",12,7.0789999961853,7.16811166629195,6.98988832607865,1.10970628261566,1.41640365123749,0.759509265422821,0.580131649971008,0.214613229036331,0.100106589496136,2.89863920211792
"Austria",13,7.00600004196167,7.07066981211305,6.94133027181029,1.48709726333618,1.4599449634552,0.815328419208527,0.567766189575195,0.316472321748734,0.221060365438461,2.1385064125061
"United States",14,6.99300003051758,7.07465674757957,6.91134331345558,1.54625928401947,1.41992056369781,0.77428662776947,0.505740523338318,0.392578780651093,0.135638788342476,2.2181134223938
"Ireland",15,6.97700023651123,7.04335166752338,6.91064880549908,1.53570663928986,1.55823111534119,0.80978262424469,0.573110342025757,0.42785832285881,0.29838815331459,1.77386903762817
"Germany",16,6.95100021362305,7.00538156926632,6.89661885797977,1.48792338371277,1.47252035140991,0.798950731754303,0.562511384487152,0.336269170045853,0.276731938123703,2.01576995849609
"Belgium",17,6.89099979400635,6.95582075044513,6.82617883756757,1.46378076076508,1.46231269836426,0.818091869354248,0.539770722389221,0.231503337621689,0.251343131065369,2.12421035766602
"Luxembourg",18,6.86299991607666,6.92368609987199,6.80231373228133,1.74194359779358,1.45758366584778,0.845089495182037,0.59662789106369,0.283180981874466,0.31883442401886,1.61951208114624
"United Kingdom",19,6.71400022506714,6.78379176110029,6.64420868903399,1.44163393974304,1.49646008014679,0.805335938930511,0.508190035820007,0.492774158716202,0.265428066253662,1.70414352416992
"Chile",20,6.65199995040894,6.73925056010485,6.56474934071302,1.25278460979462,1.28402495384216,0.819479703903198,0.376895278692245,0.326662421226501,0.0822879821062088,2.50958585739136
"United Arab Emirates",21,6.64799976348877,6.72204730376601,6.57395222321153,1.62634336948395,1.26641023159027,0.726798236370087,0.60834527015686,0.3609419465065,0.324489563703537,1.734703540802
"Brazil",22,6.63500022888184,6.72546950161457,6.5445309561491,1.10735321044922,1.43130600452423,0.616552352905273,0.437453746795654,0.16234989464283,0.111092761158943,2.76926708221436
"Czech Republic",23,6.60900020599365,6.68386246263981,6.5341379493475,1.35268235206604,1.43388521671295,0.754444003105164,0.490946173667908,0.0881067588925362,0.0368729270994663,2.45186185836792
"Argentina",24,6.59899997711182,6.69008508607745,6.50791486814618,1.18529546260834,1.44045114517212,0.695137083530426,0.494519203901291,0.109457060694695,0.059739887714386,2.61400532722473
"Mexico",25,6.57800006866455,6.67114890769124,6.48485122963786,1.15318381786346,1.210862159729,0.709978997707367,0.412730008363724,0.120990432798862,0.132774114608765,2.83715486526489
"Singapore",26,6.57200002670288,6.63672306910157,6.50727698430419,1.69227766990662,1.35381436347961,0.949492394924164,0.549840569496155,0.345965981483459,0.46430778503418,1.21636199951172
"Malta",27,6.52699995040894,6.59839677289128,6.45560312792659,1.34327983856201,1.48841166496277,0.821944236755371,0.588767051696777,0.574730575084686,0.153066068887711,1.55686283111572
"Uruguay",28,6.4539999961853,6.54590621769428,6.36209377467632,1.21755969524384,1.41222786903381,0.719216823577881,0.57939225435257,0.175096929073334,0.178061872720718,2.17240953445435
"Guatemala",29,6.4539999961853,6.56687397271395,6.34112601965666,0.872001945972443,1.25558519363403,0.540239989757538,0.531310617923737,0.283488392829895,0.0772232785820961,2.89389109611511
"Panama",30,6.4520001411438,6.55713071614504,6.34686956614256,1.23374843597412,1.37319254875183,0.706156134605408,0.550026834011078,0.21055693924427,0.070983923971653,2.30719995498657
"France",31,6.44199991226196,6.51576780244708,6.36823202207685,1.43092346191406,1.38777685165405,0.844465851783752,0.470222115516663,0.129762306809425,0.172502428293228,2.00595474243164
"Thailand",32,6.42399978637695,6.50911685571074,6.33888271704316,1.12786877155304,1.42579245567322,0.647239029407501,0.580200731754303,0.572123110294342,0.0316127352416515,2.03950834274292
"Taiwan Province of China",33,6.42199993133545,6.49459602192044,6.34940384075046,1.43362653255463,1.38456535339355,0.793984234333038,0.361466586589813,0.258360475301743,0.0638292357325554,2.1266074180603
"Spain",34,6.40299987792969,6.4710548453033,6.33494491055608,1.38439786434174,1.53209090232849,0.888960599899292,0.408781230449677,0.190133571624756,0.0709140971302986,1.92775774002075
"Qatar",35,6.375,6.56847681432962,6.18152318567038,1.87076568603516,1.27429687976837,0.710098087787628,0.604130983352661,0.330473870038986,0.439299255609512,1.1454644203186
"Colombia",36,6.35699987411499,6.45202005416155,6.26197969406843,1.07062232494354,1.4021829366684,0.595027923583984,0.477487415075302,0.149014472961426,0.0466687418520451,2.61606812477112
"Saudi Arabia",37,6.3439998626709,6.44416661202908,6.24383311331272,1.53062355518341,1.28667759895325,0.590148329734802,0.449750572443008,0.147616013884544,0.27343225479126,2.0654296875
"Trinidad and Tobago",38,6.16800022125244,6.38153389066458,5.95446655184031,1.36135590076447,1.3802285194397,0.519983291625977,0.518630743026733,0.325296461582184,0.00896481610834599,2.05324745178223
"Kuwait",39,6.10500001907349,6.1919569888711,6.01804304927588,1.63295245170593,1.25969874858856,0.632105708122253,0.496337592601776,0.228289797902107,0.215159550309181,1.64042520523071
"Slovakia",40,6.09800004959106,6.1773484121263,6.01865168705583,1.32539355754852,1.50505924224854,0.712732911109924,0.295817464590073,0.136544480919838,0.0242108516395092,2.09777665138245
"Bahrain",41,6.08699989318848,6.17898906782269,5.99501071855426,1.48841226100922,1.32311046123505,0.653133034706116,0.536746919155121,0.172668486833572,0.257042169570923,1.65614938735962
"Malaysia",42,6.08400011062622,6.17997963652015,5.98802058473229,1.29121541976929,1.28464603424072,0.618784427642822,0.402264982461929,0.416608929634094,0.0656007081270218,2.00444889068604
"Nicaragua",43,6.07100009918213,6.18658360034227,5.95541659802198,0.737299203872681,1.28721570968628,0.653095960617065,0.447551846504211,0.301674216985703,0.130687981843948,2.51393055915833
"Ecuador",44,6.00799989700317,6.10584767535329,5.91015211865306,1.00082039833069,1.28616881370544,0.685636222362518,0.4551981985569,0.150112465023994,0.140134647488594,2.29035258293152
"El Salvador",45,6.00299978256226,6.108635122329,5.89736444279552,0.909784495830536,1.18212509155273,0.596018552780151,0.432452529668808,0.0782579854130745,0.0899809598922729,2.7145938873291
"Poland",46,5.97300004959106,6.05390834122896,5.89209175795317,1.29178786277771,1.44571197032928,0.699475347995758,0.520342111587524,0.158465966582298,0.0593078061938286,1.79772281646729
"Uzbekistan",47,5.97100019454956,6.06553757295012,5.876462816149,0.786441087722778,1.54896914958954,0.498272627592087,0.658248662948608,0.415983647108078,0.246528223156929,1.81691360473633
"Italy",48,5.96400022506714,6.04273690596223,5.88526354417205,1.39506661891937,1.44492328166962,0.853144347667694,0.256450712680817,0.17278964817524,0.0280280914157629,1.81331205368042
"Russia",49,5.96299982070923,6.03027490749955,5.89572473391891,1.28177809715271,1.46928238868713,0.547349333763123,0.373783111572266,0.0522638224065304,0.0329628810286522,2.20560741424561
"Belize",50,5.95599985122681,6.19724231779575,5.71475738465786,0.907975316047668,1.08141779899597,0.450191766023636,0.547509372234344,0.240015640854836,0.0965810716152191,2.63195562362671
"Japan",51,5.92000007629395,5.99071944460273,5.84928070798516,1.41691517829895,1.43633782863617,0.913475871086121,0.505625545978546,0.12057276815176,0.163760736584663,1.36322355270386
"Lithuania",52,5.90199995040894,5.98266964137554,5.82133025944233,1.31458234786987,1.47351610660553,0.62894994020462,0.234231784939766,0.010164656676352,0.0118656428530812,2.22844052314758
"Algeria",53,5.87200021743774,5.97828643366694,5.76571400120854,1.09186446666718,1.1462174654007,0.617584645748138,0.233335807919502,0.0694366469979286,0.146096110343933,2.56760382652283
"Latvia",54,5.84999990463257,5.92026353821158,5.77973627105355,1.26074862480164,1.40471494197845,0.638566970825195,0.325707912445068,0.153074786067009,0.0738427266478539,1.99365520477295
"South Korea",55,5.83799982070923,5.92255902826786,5.7534406131506,1.40167844295502,1.12827444076538,0.900214076042175,0.257921665906906,0.206674367189407,0.0632826685905457,1.88037800788879
"Moldova",56,5.83799982070923,5.90837083846331,5.76762880295515,0.728870630264282,1.25182557106018,0.589465200901031,0.240729048848152,0.208779126405716,0.0100912861526012,2.80780839920044
"Romania",57,5.82499980926514,5.91969415679574,5.73030546173453,1.21768391132355,1.15009129047394,0.685158312320709,0.457003742456436,0.133519917726517,0.00438790069893003,2.17683148384094
"Bolivia",58,5.82299995422363,5.9039769025147,5.74202300593257,0.833756566047668,1.22761905193329,0.473630249500275,0.558732926845551,0.22556072473526,0.0604777261614799,2.44327902793884
"Turkmenistan",59,5.82200002670288,5.88518087550998,5.75881917789578,1.13077676296234,1.49314916133881,0.437726080417633,0.41827192902565,0.24992498755455,0.259270340204239,1.83290982246399
"Kazakhstan",60,5.81899976730347,5.90364177465439,5.73435775995255,1.28455626964569,1.38436901569366,0.606041550636292,0.437454283237457,0.201964423060417,0.119282886385918,1.78489255905151
"North Cyprus",61,5.80999994277954,5.89736646488309,5.72263342067599,1.3469113111496,1.18630337715149,0.834647238254547,0.471203625202179,0.266845703125,0.155353352427483,1.54915761947632
"Slovenia",62,5.75799989700317,5.84222516000271,5.67377463400364,1.3412059545517,1.45251882076263,0.790828227996826,0.572575807571411,0.242649093270302,0.0451289787888527,1.31331729888916
"Peru",63,5.71500015258789,5.81194677859545,5.61805352658033,1.03522527217865,1.21877038478851,0.630166113376617,0.450002878904343,0.126819714903831,0.0470490865409374,2.20726943016052
"Mauritius",64,5.62900018692017,5.72986219167709,5.52813818216324,1.18939554691315,1.20956099033356,0.638007462024689,0.491247326135635,0.360933750867844,0.0421815551817417,1.6975839138031
"Cyprus",65,5.62099981307983,5.71469269931316,5.5273069268465,1.35593807697296,1.13136327266693,0.84471470117569,0.355111539363861,0.271254301071167,0.0412379764020443,1.62124919891357
"Estonia",66,5.61100006103516,5.68813987419009,5.53386024788022,1.32087934017181,1.47667109966278,0.695168316364288,0.479131430387497,0.0988908112049103,0.183248922228813,1.35750865936279
"Belarus",67,5.56899976730347,5.64611424401402,5.49188529059291,1.15655755996704,1.44494521617889,0.637714266777039,0.295400261878967,0.15513750910759,0.156313821673393,1.72323298454285
"Libya",68,5.52500009536743,5.67695380687714,5.37304638385773,1.10180306434631,1.35756433010101,0.520169019699097,0.465733230113983,0.152073666453362,0.0926102101802826,1.83501124382019
"Turkey",69,5.5,5.59486496329308,5.40513503670692,1.19827437400818,1.33775317668915,0.637605607509613,0.300740599632263,0.0466930419206619,0.0996715798974037,1.87927794456482
"Paraguay",70,5.49300003051758,5.57738126963377,5.40861879140139,0.932537317276001,1.50728487968445,0.579250693321228,0.473507791757584,0.224150657653809,0.091065913438797,1.6853334903717
"Hong Kong S.A.R., China",71,5.47200012207031,5.54959417313337,5.39440607100725,1.55167484283447,1.26279091835022,0.943062424659729,0.490968644618988,0.374465793371201,0.293933749198914,0.554633140563965
"Philippines",72,5.42999982833862,5.54533505424857,5.31466460242867,0.85769921541214,1.25391757488251,0.468009054660797,0.585214674472809,0.193513423204422,0.0993318930268288,1.97260475158691
"Serbia",73,5.39499998092651,5.49156965613365,5.29843030571938,1.06931757926941,1.25818979740143,0.65078467130661,0.208715528249741,0.220125883817673,0.0409037806093693,1.94708442687988
"Jordan",74,5.33599996566772,5.44841002240777,5.22358990892768,0.991012394428253,1.23908889293671,0.604590058326721,0.418421149253845,0.172170460224152,0.11980327218771,1.79117655754089
"Hungary",75,5.32399988174438,5.40303970918059,5.24496005430818,1.2860119342804,1.34313309192657,0.687763452529907,0.175863519310951,0.0784016624093056,0.0366369374096394,1.71645927429199
"Jamaica",76,5.31099987030029,5.58139872848988,5.04060101211071,0.925579309463501,1.36821806430817,0.641022384166718,0.474307239055634,0.233818337321281,0.0552677810192108,1.61232566833496
"Croatia",77,5.29300022125244,5.39177720457315,5.19422323793173,1.22255623340607,0.96798300743103,0.701288521289825,0.255772292613983,0.248002976179123,0.0431031100451946,1.85449242591858
"Kosovo",78,5.27899980545044,5.36484799548984,5.19315161541104,0.951484382152557,1.13785350322723,0.541452050209045,0.260287940502167,0.319931447505951,0.0574716180562973,2.01054072380066
"China",79,5.27299976348877,5.31927808977663,5.2267214372009,1.08116579055786,1.16083741188049,0.741415500640869,0.472787708044052,0.0288068410009146,0.0227942746132612,1.76493859291077
"Pakistan",80,5.26900005340576,5.35998364135623,5.17801646545529,0.72688353061676,0.672690689563751,0.402047783136368,0.23521526157856,0.315446019172668,0.124348066747189,2.79248929023743
"Indonesia",81,5.26200008392334,5.35288859814405,5.17111156970263,0.995538592338562,1.27444469928741,0.492345720529556,0.443323463201523,0.611704587936401,0.0153171354904771,1.42947697639465
"Venezuela",82,5.25,5.3700319455564,5.1299680544436,1.12843120098114,1.43133759498596,0.617144227027893,0.153997123241425,0.0650196298956871,0.0644911229610443,1.78946375846863
"Montenegro",83,5.23699998855591,5.34104444056749,5.13295553654432,1.12112903594971,1.23837649822235,0.667464673519135,0.194989055395126,0.197911024093628,0.0881741940975189,1.72919154167175
"Morocco",84,5.2350001335144,5.31834096476436,5.15165930226445,0.878114581108093,0.774864435195923,0.59771066904068,0.408158332109451,0.0322099551558495,0.0877631828188896,2.45618939399719
"Azerbaijan",85,5.23400020599365,5.29928653523326,5.16871387675405,1.15360176563263,1.15240025520325,0.540775775909424,0.398155838251114,0.0452693402767181,0.180987507104874,1.76248168945312
"Dominican Republic",86,5.23000001907349,5.34906088516116,5.11093915298581,1.07937383651733,1.40241670608521,0.574873745441437,0.55258983373642,0.186967849731445,0.113945253193378,1.31946516036987
"Greece",87,5.22700023651123,5.3252461694181,5.12875430360436,1.28948748111725,1.23941457271576,0.810198903083801,0.0957312509417534,0,0.04328977689147,1.74922156333923
"Lebanon",88,5.22499990463257,5.31888228848577,5.13111752077937,1.07498753070831,1.12962424755096,0.735081076622009,0.288515985012054,0.264450758695602,0.037513829767704,1.69507384300232
"Portugal",89,5.19500017166138,5.28504173308611,5.10495861023665,1.3151752948761,1.36704301834106,0.795843541622162,0.498465299606323,0.0951027125120163,0.0158694516867399,1.10768270492554
"Bosnia and Herzegovina",90,5.18200016021729,5.27633568674326,5.08766463369131,0.982409417629242,1.0693359375,0.705186307430267,0.204403176903725,0.328867495059967,0,1.89217257499695
"Honduras",91,5.18100023269653,5.30158279687166,5.0604176685214,0.730573117733002,1.14394497871399,0.582569479942322,0.348079860210419,0.236188873648643,0.0733454525470734,2.06581115722656
"Macedonia",92,5.17500019073486,5.27217263966799,5.07782774180174,1.06457793712616,1.20789301395416,0.644948184490204,0.325905978679657,0.25376096367836,0.0602777935564518,1.6174693107605
"Somalia",93,5.15100002288818,5.24248370990157,5.0595163358748,0.0226431842893362,0.721151351928711,0.113989137113094,0.602126955986023,0.291631311178207,0.282410323619843,3.11748456954956
"Vietnam",94,5.07399988174438,5.14728076457977,5.000718998909,0.788547575473785,1.27749133110046,0.652168989181519,0.571055591106415,0.234968051314354,0.0876332372426987,1.46231865882874
"Nigeria",95,5.07399988174438,5.20950013548136,4.93849962800741,0.783756256103516,1.21577048301697,0.0569157302379608,0.394952565431595,0.230947196483612,0.0261215660721064,2.36539053916931
"Tajikistan",96,5.04099988937378,5.11142559587956,4.970574182868,0.524713635444641,1.27146327495575,0.529235124588013,0.471566706895828,0.248997643589973,0.146377146244049,1.84904932975769
"Bhutan",97,5.01100015640259,5.07933456212282,4.94266575068235,0.885416388511658,1.34012651443481,0.495879292488098,0.501537680625916,0.474054545164108,0.173380389809608,1.14018440246582
"Kyrgyzstan",98,5.00400018692017,5.08991990312934,4.91808047071099,0.596220076084137,1.39423859119415,0.553457796573639,0.454943388700485,0.42858037352562,0.0394391790032387,1.53672313690186
"Nepal",99,4.96199989318848,5.06735607936978,4.85664370700717,0.479820191860199,1.17928326129913,0.504130780696869,0.440305948257446,0.394096165895462,0.0729755461215973,1.8912410736084
"Mongolia",100,4.95499992370605,5.0216795091331,4.88832033827901,1.02723586559296,1.4930112361908,0.557783484458923,0.394143968820572,0.338464230298996,0.0329022891819477,1.11129236221313
"South Africa",101,4.8289999961853,4.92943518772721,4.72856480464339,1.05469870567322,1.38478863239288,0.187080070376396,0.479246735572815,0.139362379908562,0.0725094974040985,1.51090860366821
"Tunisia",102,4.80499982833862,4.88436700701714,4.72563264966011,1.00726580619812,0.868351459503174,0.613212049007416,0.289680689573288,0.0496933571994305,0.0867231488227844,1.89025115966797
"Palestinian Territories",103,4.77500009536743,4.88184834256768,4.66815184816718,0.716249227523804,1.15564715862274,0.565666973590851,0.25471106171608,0.114173173904419,0.0892826020717621,1.8788902759552
"Egypt",104,4.7350001335144,4.82513378962874,4.64486647740006,0.989701807498932,0.997471392154694,0.520187258720398,0.282110154628754,0.128631442785263,0.114381365478039,1.70216107368469
"Bulgaria",105,4.71400022506714,4.80369470641017,4.62430574372411,1.1614590883255,1.43437945842743,0.708217680454254,0.289231717586517,0.113177694380283,0.0110515309497714,0.996139287948608
"Sierra Leone",106,4.70900011062622,4.85064333498478,4.56735688626766,0.36842092871666,0.984136044979095,0.00556475389748812,0.318697690963745,0.293040901422501,0.0710951760411263,2.66845989227295
"Cameroon",107,4.69500017166138,4.79654085725546,4.5934594860673,0.564305365085602,0.946018218994141,0.132892116904259,0.430388748645782,0.236298456788063,0.0513066314160824,2.3336455821991
"Iran",108,4.69199991226196,4.79822470769286,4.58577511683106,1.15687310695648,0.711551249027252,0.639333188533783,0.249322608113289,0.387242913246155,0.048761073499918,1.49873495101929
"Albania",109,4.64400005340576,4.75246400639415,4.53553610041738,0.996192753314972,0.803685247898102,0.731159746646881,0.381498634815216,0.201312944293022,0.0398642159998417,1.49044156074524
"Bangladesh",110,4.60799980163574,4.68982165828347,4.52617794498801,0.586682975292206,0.735131740570068,0.533241033554077,0.478356659412384,0.172255352139473,0.123717859387398,1.97873616218567
"Namibia",111,4.57399988174438,4.77035474091768,4.37764502257109,0.964434325695038,1.0984708070755,0.33861181139946,0.520303547382355,0.0771337449550629,0.0931469723582268,1.4818902015686
"Kenya",112,4.55299997329712,4.65569159060717,4.45030835598707,0.560479462146759,1.06795072555542,0.309988349676132,0.452763766050339,0.444860309362411,0.0646413192152977,1.6519021987915
"Mozambique",113,4.55000019073486,4.77410232633352,4.3258980551362,0.234305649995804,0.870701014995575,0.106654435396194,0.480791091918945,0.322228103876114,0.179436385631561,2.35565090179443
"Myanmar",114,4.54500007629395,4.61473994642496,4.47526020616293,0.367110550403595,1.12323594093323,0.397522568702698,0.514492034912109,0.838075160980225,0.188816204667091,1.11529040336609
"Senegal",115,4.53499984741211,4.6016037812829,4.46839591354132,0.479309022426605,1.17969191074371,0.409362852573395,0.377922266721725,0.183468893170357,0.115460447967052,1.78964614868164
"Zambia",116,4.51399993896484,4.64410550147295,4.38389437645674,0.636406779289246,1.00318729877472,0.257835894823074,0.461603492498398,0.249580144882202,0.0782135501503944,1.82670545578003
"Iraq",117,4.49700021743774,4.62259140968323,4.37140902519226,1.10271048545837,0.978613197803497,0.501180469989777,0.288555532693863,0.19963726401329,0.107215754687786,1.31890726089478
"Gabon",118,4.46500015258789,4.5573617656529,4.37263853952289,1.1982102394104,1.1556202173233,0.356578588485718,0.312328577041626,0.0437853783369064,0.0760467872023582,1.32291626930237
"Ethiopia",119,4.46000003814697,4.54272867664695,4.377271399647,0.339233845472336,0.86466920375824,0.353409707546234,0.408842742443085,0.312650740146637,0.165455713868141,2.01574373245239
"Sri Lanka",120,4.44000005722046,4.55344719231129,4.32655292212963,1.00985014438629,1.25997638702393,0.625130832195282,0.561213254928589,0.490863561630249,0.0736539661884308,0.419389247894287
"Armenia",121,4.37599992752075,4.46673461228609,4.28526524275541,0.900596737861633,1.00748372077942,0.637524425983429,0.198303267359734,0.0834880918264389,0.0266744215041399,1.5214991569519
"India",122,4.31500005722046,4.37152201749384,4.25847809694707,0.792221248149872,0.754372596740723,0.455427616834641,0.469987004995346,0.231538489460945,0.0922268852591515,1.5191171169281
"Mauritania",123,4.29199981689453,4.37716361626983,4.20683601751924,0.648457288742065,1.2720308303833,0.285349279642105,0.0960980430245399,0.201870024204254,0.136957004666328,1.65163731575012
"Congo (Brazzaville)",124,4.29099988937378,4.41005350500345,4.17194627374411,0.808964252471924,0.832044363021851,0.28995743393898,0.435025870800018,0.120852127671242,0.0796181336045265,1.72413563728333
"Georgia",125,4.28599977493286,4.37493396580219,4.19706558406353,0.950612664222717,0.57061493396759,0.649546980857849,0.309410035610199,0.0540088154375553,0.251666635274887,1.50013780593872
"Congo (Kinshasa)",126,4.28000020980835,4.35781083270907,4.20218958690763,0.0921023488044739,1.22902345657349,0.191407024860382,0.235961347818375,0.246455833315849,0.0602413564920425,2.22495865821838
"Mali",127,4.19000005722046,4.26967071101069,4.11032940343022,0.476180493831635,1.28147339820862,0.169365674257278,0.306613743305206,0.183354198932648,0.104970246553421,1.66819095611572
"Ivory Coast",128,4.17999982833862,4.27518256321549,4.08481709346175,0.603048920631409,0.904780030250549,0.0486421696841717,0.447706192731857,0.201237469911575,0.130061775445938,1.84496426582336
"Cambodia",129,4.16800022125244,4.27851781353354,4.05748262897134,0.601765096187592,1.00623834133148,0.429783403873444,0.633375823497772,0.385922968387604,0.0681059509515762,1.04294109344482
"Sudan",130,4.13899993896484,4.34574716508389,3.9322527128458,0.65951669216156,1.21400856971741,0.290920823812485,0.0149958552792668,0.182317450642586,0.089847519993782,1.68706583976746
"Ghana",131,4.11999988555908,4.22270720854402,4.01729256257415,0.667224824428558,0.873664736747742,0.295637726783752,0.423026293516159,0.256923943758011,0.0253363698720932,1.57786750793457
"Ukraine",132,4.09600019454956,4.18541010454297,4.00659028455615,0.89465194940567,1.39453756809235,0.575903952121735,0.122974775731564,0.270061463117599,0.0230294708162546,0.814382314682007
"Uganda",133,4.08099985122681,4.19579996705055,3.96619973540306,0.381430715322495,1.12982773780823,0.217632606625557,0.443185955286026,0.325766056776047,0.057069718837738,1.526362657547
"Burkina Faso",134,4.03200006484985,4.12405906438828,3.93994106531143,0.3502277135849,1.04328000545502,0.215844258666039,0.324367851018906,0.250864684581757,0.120328105986118,1.72721290588379
"Niger",135,4.02799987792969,4.11194681972265,3.94405293613672,0.161925330758095,0.993025004863739,0.26850500702858,0.36365869641304,0.228673845529556,0.138572946190834,1.87398338317871
"Malawi",136,3.97000002861023,4.07747881740332,3.86252123981714,0.233442038297653,0.512568831443787,0.315089583396912,0.466914653778076,0.287170469760895,0.0727116540074348,2.08178615570068
"Chad",137,3.93600010871887,4.0347115239501,3.83728869348764,0.438012987375259,0.953855872154236,0.0411347150802612,0.16234202682972,0.216113850474358,0.0535818822681904,2.07123804092407
"Zimbabwe",138,3.875,3.97869964271784,3.77130035728216,0.375846534967422,1.08309590816498,0.196763753890991,0.336384207010269,0.189143493771553,0.0953753814101219,1.59797024726868
"Lesotho",139,3.80800008773804,4.04434397548437,3.5716561999917,0.521021246910095,1.19009518623352,0,0.390661299228668,0.157497271895409,0.119094640016556,1.42983531951904
"Angola",140,3.79500007629395,3.95164193540812,3.63835821717978,0.858428180217743,1.10441195964813,0.0498686656355858,0,0.097926490008831,0.0697203353047371,1.61448240280151
"Afghanistan",141,3.79399991035461,3.87366141527891,3.71433840543032,0.401477217674255,0.581543326377869,0.180746778845787,0.106179520487785,0.311870932579041,0.0611578300595284,2.15080118179321
"Botswana",142,3.76600003242493,3.87412266626954,3.65787739858031,1.12209415435791,1.22155499458313,0.341755509376526,0.505196332931519,0.0993484482169151,0.0985831990838051,0.3779137134552
"Benin",143,3.65700006484985,3.74578355133533,3.56821657836437,0.431085407733917,0.435299843549728,0.209930211305618,0.425962775945663,0.207948461174965,0.0609290152788162,1.88563096523285
"Madagascar",144,3.64400005340576,3.71431910589337,3.57368100091815,0.305808693170547,0.913020372390747,0.375223308801651,0.189196765422821,0.208732530474663,0.0672319754958153,1.58461260795593
"Haiti",145,3.6029999256134,3.73471479773521,3.47128505349159,0.368610262870789,0.640449821949005,0.277321130037308,0.0303698573261499,0.489203780889511,0.0998721495270729,1.69716763496399
"Yemen",146,3.59299993515015,3.69275031983852,3.49324955046177,0.591683447360992,0.93538224697113,0.310080915689468,0.249463722109795,0.104125209152699,0.0567674227058887,1.34560060501099
"South Sudan",147,3.59100008010864,3.72553858578205,3.45646157443523,0.39724862575531,0.601323127746582,0.163486003875732,0.147062435746193,0.285670816898346,0.116793513298035,1.87956738471985
"Liberia",148,3.53299999237061,3.65375626087189,3.41224372386932,0.119041793048382,0.872117936611176,0.229918196797371,0.332881182432175,0.26654988527298,0.0389482490718365,1.67328596115112
"Guinea",149,3.50699996948242,3.58442812889814,3.4295718100667,0.244549930095673,0.791244685649872,0.194129139184952,0.348587512969971,0.264815092086792,0.110937617719173,1.55231189727783
"Togo",150,3.49499988555908,3.59403811171651,3.39596165940166,0.305444717407227,0.431882530450821,0.247105568647385,0.38042613863945,0.196896150708199,0.0956650152802467,1.83722925186157
"Rwanda",151,3.47099995613098,3.54303023353219,3.39896967872977,0.368745893239975,0.945707023143768,0.326424807310104,0.581843852996826,0.252756029367447,0.455220013856888,0.540061235427856
"Syria",152,3.46199989318848,3.66366855680943,3.26033122956753,0.777153134346008,0.396102607250214,0.50053334236145,0.0815394446253777,0.493663728237152,0.151347130537033,1.06157350540161
"Tanzania",153,3.34899997711182,3.46142975538969,3.23657019883394,0.511135876178741,1.04198980331421,0.364509284496307,0.390017777681351,0.354256361722946,0.0660351067781448,0.621130466461182
"Burundi",154,2.90499997138977,3.07469033300877,2.73530960977077,0.091622568666935,0.629793584346771,0.151610791683197,0.0599007532000542,0.204435184597969,0.0841479450464249,1.68302416801453
"Central African Republic",155,2.69300007820129,2.86488426923752,2.52111588716507,0,0,0.0187726859003305,0.270842045545578,0.280876487493515,0.0565650761127472,2.06600475311279
1 Country Happiness.Rank Happiness.Score Whisker.high Whisker.low Economy..GDP.per.Capita. Family Health..Life.Expectancy. Freedom Generosity Trust..Government.Corruption. Dystopia.Residual
2 Norway 1 7.53700017929077 7.59444482058287 7.47955553799868 1.61646318435669 1.53352355957031 0.796666502952576 0.635422587394714 0.36201223731041 0.315963834524155 2.27702665328979
3 Denmark 2 7.52199983596802 7.58172806486487 7.46227160707116 1.48238301277161 1.55112159252167 0.792565524578094 0.626006722450256 0.355280488729477 0.40077006816864 2.31370735168457
4 Iceland 3 7.50400018692017 7.62203047305346 7.38596990078688 1.480633020401 1.6105740070343 0.833552122116089 0.627162635326385 0.475540220737457 0.153526559472084 2.32271528244019
5 Switzerland 4 7.49399995803833 7.56177242040634 7.42622749567032 1.56497955322266 1.51691174507141 0.858131289482117 0.620070576667786 0.290549278259277 0.367007285356522 2.2767162322998
6 Finland 5 7.4689998626709 7.52754207581282 7.41045764952898 1.44357192516327 1.5402467250824 0.80915766954422 0.617950856685638 0.24548277258873 0.38261154294014 2.4301815032959
7 Netherlands 6 7.3769998550415 7.42742584124207 7.32657386884093 1.50394463539124 1.42893922328949 0.810696125030518 0.585384488105774 0.470489829778671 0.282661825418472 2.29480409622192
8 Canada 7 7.31599998474121 7.38440283536911 7.24759713411331 1.47920441627502 1.48134899139404 0.83455765247345 0.611100912094116 0.435539722442627 0.287371516227722 2.18726444244385
9 New Zealand 8 7.31400012969971 7.3795104418695 7.24848981752992 1.40570604801178 1.54819512367249 0.816759705543518 0.614062130451202 0.500005125999451 0.382816702127457 2.0464563369751
10 Sweden 9 7.28399991989136 7.34409487739205 7.22390496239066 1.49438726902008 1.47816216945648 0.830875158309937 0.612924098968506 0.385399252176285 0.384398728609085 2.09753799438477
11 Australia 10 7.28399991989136 7.35665122494102 7.2113486148417 1.484414935112 1.51004195213318 0.84388679265976 0.601607382297516 0.477699249982834 0.301183730363846 2.06521081924438
12 Israel 11 7.21299982070923 7.27985325649381 7.14614638492465 1.37538242340088 1.37628996372223 0.83840399980545 0.405988603830338 0.330082654953003 0.0852421000599861 2.80175733566284
13 Costa Rica 12 7.0789999961853 7.16811166629195 6.98988832607865 1.10970628261566 1.41640365123749 0.759509265422821 0.580131649971008 0.214613229036331 0.100106589496136 2.89863920211792
14 Austria 13 7.00600004196167 7.07066981211305 6.94133027181029 1.48709726333618 1.4599449634552 0.815328419208527 0.567766189575195 0.316472321748734 0.221060365438461 2.1385064125061
15 United States 14 6.99300003051758 7.07465674757957 6.91134331345558 1.54625928401947 1.41992056369781 0.77428662776947 0.505740523338318 0.392578780651093 0.135638788342476 2.2181134223938
16 Ireland 15 6.97700023651123 7.04335166752338 6.91064880549908 1.53570663928986 1.55823111534119 0.80978262424469 0.573110342025757 0.42785832285881 0.29838815331459 1.77386903762817
17 Germany 16 6.95100021362305 7.00538156926632 6.89661885797977 1.48792338371277 1.47252035140991 0.798950731754303 0.562511384487152 0.336269170045853 0.276731938123703 2.01576995849609
18 Belgium 17 6.89099979400635 6.95582075044513 6.82617883756757 1.46378076076508 1.46231269836426 0.818091869354248 0.539770722389221 0.231503337621689 0.251343131065369 2.12421035766602
19 Luxembourg 18 6.86299991607666 6.92368609987199 6.80231373228133 1.74194359779358 1.45758366584778 0.845089495182037 0.59662789106369 0.283180981874466 0.31883442401886 1.61951208114624
20 United Kingdom 19 6.71400022506714 6.78379176110029 6.64420868903399 1.44163393974304 1.49646008014679 0.805335938930511 0.508190035820007 0.492774158716202 0.265428066253662 1.70414352416992
21 Chile 20 6.65199995040894 6.73925056010485 6.56474934071302 1.25278460979462 1.28402495384216 0.819479703903198 0.376895278692245 0.326662421226501 0.0822879821062088 2.50958585739136
22 United Arab Emirates 21 6.64799976348877 6.72204730376601 6.57395222321153 1.62634336948395 1.26641023159027 0.726798236370087 0.60834527015686 0.3609419465065 0.324489563703537 1.734703540802
23 Brazil 22 6.63500022888184 6.72546950161457 6.5445309561491 1.10735321044922 1.43130600452423 0.616552352905273 0.437453746795654 0.16234989464283 0.111092761158943 2.76926708221436
24 Czech Republic 23 6.60900020599365 6.68386246263981 6.5341379493475 1.35268235206604 1.43388521671295 0.754444003105164 0.490946173667908 0.0881067588925362 0.0368729270994663 2.45186185836792
25 Argentina 24 6.59899997711182 6.69008508607745 6.50791486814618 1.18529546260834 1.44045114517212 0.695137083530426 0.494519203901291 0.109457060694695 0.059739887714386 2.61400532722473
26 Mexico 25 6.57800006866455 6.67114890769124 6.48485122963786 1.15318381786346 1.210862159729 0.709978997707367 0.412730008363724 0.120990432798862 0.132774114608765 2.83715486526489
27 Singapore 26 6.57200002670288 6.63672306910157 6.50727698430419 1.69227766990662 1.35381436347961 0.949492394924164 0.549840569496155 0.345965981483459 0.46430778503418 1.21636199951172
28 Malta 27 6.52699995040894 6.59839677289128 6.45560312792659 1.34327983856201 1.48841166496277 0.821944236755371 0.588767051696777 0.574730575084686 0.153066068887711 1.55686283111572
29 Uruguay 28 6.4539999961853 6.54590621769428 6.36209377467632 1.21755969524384 1.41222786903381 0.719216823577881 0.57939225435257 0.175096929073334 0.178061872720718 2.17240953445435
30 Guatemala 29 6.4539999961853 6.56687397271395 6.34112601965666 0.872001945972443 1.25558519363403 0.540239989757538 0.531310617923737 0.283488392829895 0.0772232785820961 2.89389109611511
31 Panama 30 6.4520001411438 6.55713071614504 6.34686956614256 1.23374843597412 1.37319254875183 0.706156134605408 0.550026834011078 0.21055693924427 0.070983923971653 2.30719995498657
32 France 31 6.44199991226196 6.51576780244708 6.36823202207685 1.43092346191406 1.38777685165405 0.844465851783752 0.470222115516663 0.129762306809425 0.172502428293228 2.00595474243164
33 Thailand 32 6.42399978637695 6.50911685571074 6.33888271704316 1.12786877155304 1.42579245567322 0.647239029407501 0.580200731754303 0.572123110294342 0.0316127352416515 2.03950834274292
34 Taiwan Province of China 33 6.42199993133545 6.49459602192044 6.34940384075046 1.43362653255463 1.38456535339355 0.793984234333038 0.361466586589813 0.258360475301743 0.0638292357325554 2.1266074180603
35 Spain 34 6.40299987792969 6.4710548453033 6.33494491055608 1.38439786434174 1.53209090232849 0.888960599899292 0.408781230449677 0.190133571624756 0.0709140971302986 1.92775774002075
36 Qatar 35 6.375 6.56847681432962 6.18152318567038 1.87076568603516 1.27429687976837 0.710098087787628 0.604130983352661 0.330473870038986 0.439299255609512 1.1454644203186
37 Colombia 36 6.35699987411499 6.45202005416155 6.26197969406843 1.07062232494354 1.4021829366684 0.595027923583984 0.477487415075302 0.149014472961426 0.0466687418520451 2.61606812477112
38 Saudi Arabia 37 6.3439998626709 6.44416661202908 6.24383311331272 1.53062355518341 1.28667759895325 0.590148329734802 0.449750572443008 0.147616013884544 0.27343225479126 2.0654296875
39 Trinidad and Tobago 38 6.16800022125244 6.38153389066458 5.95446655184031 1.36135590076447 1.3802285194397 0.519983291625977 0.518630743026733 0.325296461582184 0.00896481610834599 2.05324745178223
40 Kuwait 39 6.10500001907349 6.1919569888711 6.01804304927588 1.63295245170593 1.25969874858856 0.632105708122253 0.496337592601776 0.228289797902107 0.215159550309181 1.64042520523071
41 Slovakia 40 6.09800004959106 6.1773484121263 6.01865168705583 1.32539355754852 1.50505924224854 0.712732911109924 0.295817464590073 0.136544480919838 0.0242108516395092 2.09777665138245
42 Bahrain 41 6.08699989318848 6.17898906782269 5.99501071855426 1.48841226100922 1.32311046123505 0.653133034706116 0.536746919155121 0.172668486833572 0.257042169570923 1.65614938735962
43 Malaysia 42 6.08400011062622 6.17997963652015 5.98802058473229 1.29121541976929 1.28464603424072 0.618784427642822 0.402264982461929 0.416608929634094 0.0656007081270218 2.00444889068604
44 Nicaragua 43 6.07100009918213 6.18658360034227 5.95541659802198 0.737299203872681 1.28721570968628 0.653095960617065 0.447551846504211 0.301674216985703 0.130687981843948 2.51393055915833
45 Ecuador 44 6.00799989700317 6.10584767535329 5.91015211865306 1.00082039833069 1.28616881370544 0.685636222362518 0.4551981985569 0.150112465023994 0.140134647488594 2.29035258293152
46 El Salvador 45 6.00299978256226 6.108635122329 5.89736444279552 0.909784495830536 1.18212509155273 0.596018552780151 0.432452529668808 0.0782579854130745 0.0899809598922729 2.7145938873291
47 Poland 46 5.97300004959106 6.05390834122896 5.89209175795317 1.29178786277771 1.44571197032928 0.699475347995758 0.520342111587524 0.158465966582298 0.0593078061938286 1.79772281646729
48 Uzbekistan 47 5.97100019454956 6.06553757295012 5.876462816149 0.786441087722778 1.54896914958954 0.498272627592087 0.658248662948608 0.415983647108078 0.246528223156929 1.81691360473633
49 Italy 48 5.96400022506714 6.04273690596223 5.88526354417205 1.39506661891937 1.44492328166962 0.853144347667694 0.256450712680817 0.17278964817524 0.0280280914157629 1.81331205368042
50 Russia 49 5.96299982070923 6.03027490749955 5.89572473391891 1.28177809715271 1.46928238868713 0.547349333763123 0.373783111572266 0.0522638224065304 0.0329628810286522 2.20560741424561
51 Belize 50 5.95599985122681 6.19724231779575 5.71475738465786 0.907975316047668 1.08141779899597 0.450191766023636 0.547509372234344 0.240015640854836 0.0965810716152191 2.63195562362671
52 Japan 51 5.92000007629395 5.99071944460273 5.84928070798516 1.41691517829895 1.43633782863617 0.913475871086121 0.505625545978546 0.12057276815176 0.163760736584663 1.36322355270386
53 Lithuania 52 5.90199995040894 5.98266964137554 5.82133025944233 1.31458234786987 1.47351610660553 0.62894994020462 0.234231784939766 0.010164656676352 0.0118656428530812 2.22844052314758
54 Algeria 53 5.87200021743774 5.97828643366694 5.76571400120854 1.09186446666718 1.1462174654007 0.617584645748138 0.233335807919502 0.0694366469979286 0.146096110343933 2.56760382652283
55 Latvia 54 5.84999990463257 5.92026353821158 5.77973627105355 1.26074862480164 1.40471494197845 0.638566970825195 0.325707912445068 0.153074786067009 0.0738427266478539 1.99365520477295
56 South Korea 55 5.83799982070923 5.92255902826786 5.7534406131506 1.40167844295502 1.12827444076538 0.900214076042175 0.257921665906906 0.206674367189407 0.0632826685905457 1.88037800788879
57 Moldova 56 5.83799982070923 5.90837083846331 5.76762880295515 0.728870630264282 1.25182557106018 0.589465200901031 0.240729048848152 0.208779126405716 0.0100912861526012 2.80780839920044
58 Romania 57 5.82499980926514 5.91969415679574 5.73030546173453 1.21768391132355 1.15009129047394 0.685158312320709 0.457003742456436 0.133519917726517 0.00438790069893003 2.17683148384094
59 Bolivia 58 5.82299995422363 5.9039769025147 5.74202300593257 0.833756566047668 1.22761905193329 0.473630249500275 0.558732926845551 0.22556072473526 0.0604777261614799 2.44327902793884
60 Turkmenistan 59 5.82200002670288 5.88518087550998 5.75881917789578 1.13077676296234 1.49314916133881 0.437726080417633 0.41827192902565 0.24992498755455 0.259270340204239 1.83290982246399
61 Kazakhstan 60 5.81899976730347 5.90364177465439 5.73435775995255 1.28455626964569 1.38436901569366 0.606041550636292 0.437454283237457 0.201964423060417 0.119282886385918 1.78489255905151
62 North Cyprus 61 5.80999994277954 5.89736646488309 5.72263342067599 1.3469113111496 1.18630337715149 0.834647238254547 0.471203625202179 0.266845703125 0.155353352427483 1.54915761947632
63 Slovenia 62 5.75799989700317 5.84222516000271 5.67377463400364 1.3412059545517 1.45251882076263 0.790828227996826 0.572575807571411 0.242649093270302 0.0451289787888527 1.31331729888916
64 Peru 63 5.71500015258789 5.81194677859545 5.61805352658033 1.03522527217865 1.21877038478851 0.630166113376617 0.450002878904343 0.126819714903831 0.0470490865409374 2.20726943016052
65 Mauritius 64 5.62900018692017 5.72986219167709 5.52813818216324 1.18939554691315 1.20956099033356 0.638007462024689 0.491247326135635 0.360933750867844 0.0421815551817417 1.6975839138031
66 Cyprus 65 5.62099981307983 5.71469269931316 5.5273069268465 1.35593807697296 1.13136327266693 0.84471470117569 0.355111539363861 0.271254301071167 0.0412379764020443 1.62124919891357
67 Estonia 66 5.61100006103516 5.68813987419009 5.53386024788022 1.32087934017181 1.47667109966278 0.695168316364288 0.479131430387497 0.0988908112049103 0.183248922228813 1.35750865936279
68 Belarus 67 5.56899976730347 5.64611424401402 5.49188529059291 1.15655755996704 1.44494521617889 0.637714266777039 0.295400261878967 0.15513750910759 0.156313821673393 1.72323298454285
69 Libya 68 5.52500009536743 5.67695380687714 5.37304638385773 1.10180306434631 1.35756433010101 0.520169019699097 0.465733230113983 0.152073666453362 0.0926102101802826 1.83501124382019
70 Turkey 69 5.5 5.59486496329308 5.40513503670692 1.19827437400818 1.33775317668915 0.637605607509613 0.300740599632263 0.0466930419206619 0.0996715798974037 1.87927794456482
71 Paraguay 70 5.49300003051758 5.57738126963377 5.40861879140139 0.932537317276001 1.50728487968445 0.579250693321228 0.473507791757584 0.224150657653809 0.091065913438797 1.6853334903717
72 Hong Kong S.A.R., China 71 5.47200012207031 5.54959417313337 5.39440607100725 1.55167484283447 1.26279091835022 0.943062424659729 0.490968644618988 0.374465793371201 0.293933749198914 0.554633140563965
73 Philippines 72 5.42999982833862 5.54533505424857 5.31466460242867 0.85769921541214 1.25391757488251 0.468009054660797 0.585214674472809 0.193513423204422 0.0993318930268288 1.97260475158691
74 Serbia 73 5.39499998092651 5.49156965613365 5.29843030571938 1.06931757926941 1.25818979740143 0.65078467130661 0.208715528249741 0.220125883817673 0.0409037806093693 1.94708442687988
75 Jordan 74 5.33599996566772 5.44841002240777 5.22358990892768 0.991012394428253 1.23908889293671 0.604590058326721 0.418421149253845 0.172170460224152 0.11980327218771 1.79117655754089
76 Hungary 75 5.32399988174438 5.40303970918059 5.24496005430818 1.2860119342804 1.34313309192657 0.687763452529907 0.175863519310951 0.0784016624093056 0.0366369374096394 1.71645927429199
77 Jamaica 76 5.31099987030029 5.58139872848988 5.04060101211071 0.925579309463501 1.36821806430817 0.641022384166718 0.474307239055634 0.233818337321281 0.0552677810192108 1.61232566833496
78 Croatia 77 5.29300022125244 5.39177720457315 5.19422323793173 1.22255623340607 0.96798300743103 0.701288521289825 0.255772292613983 0.248002976179123 0.0431031100451946 1.85449242591858
79 Kosovo 78 5.27899980545044 5.36484799548984 5.19315161541104 0.951484382152557 1.13785350322723 0.541452050209045 0.260287940502167 0.319931447505951 0.0574716180562973 2.01054072380066
80 China 79 5.27299976348877 5.31927808977663 5.2267214372009 1.08116579055786 1.16083741188049 0.741415500640869 0.472787708044052 0.0288068410009146 0.0227942746132612 1.76493859291077
81 Pakistan 80 5.26900005340576 5.35998364135623 5.17801646545529 0.72688353061676 0.672690689563751 0.402047783136368 0.23521526157856 0.315446019172668 0.124348066747189 2.79248929023743
82 Indonesia 81 5.26200008392334 5.35288859814405 5.17111156970263 0.995538592338562 1.27444469928741 0.492345720529556 0.443323463201523 0.611704587936401 0.0153171354904771 1.42947697639465
83 Venezuela 82 5.25 5.3700319455564 5.1299680544436 1.12843120098114 1.43133759498596 0.617144227027893 0.153997123241425 0.0650196298956871 0.0644911229610443 1.78946375846863
84 Montenegro 83 5.23699998855591 5.34104444056749 5.13295553654432 1.12112903594971 1.23837649822235 0.667464673519135 0.194989055395126 0.197911024093628 0.0881741940975189 1.72919154167175
85 Morocco 84 5.2350001335144 5.31834096476436 5.15165930226445 0.878114581108093 0.774864435195923 0.59771066904068 0.408158332109451 0.0322099551558495 0.0877631828188896 2.45618939399719
86 Azerbaijan 85 5.23400020599365 5.29928653523326 5.16871387675405 1.15360176563263 1.15240025520325 0.540775775909424 0.398155838251114 0.0452693402767181 0.180987507104874 1.76248168945312
87 Dominican Republic 86 5.23000001907349 5.34906088516116 5.11093915298581 1.07937383651733 1.40241670608521 0.574873745441437 0.55258983373642 0.186967849731445 0.113945253193378 1.31946516036987
88 Greece 87 5.22700023651123 5.3252461694181 5.12875430360436 1.28948748111725 1.23941457271576 0.810198903083801 0.0957312509417534 0 0.04328977689147 1.74922156333923
89 Lebanon 88 5.22499990463257 5.31888228848577 5.13111752077937 1.07498753070831 1.12962424755096 0.735081076622009 0.288515985012054 0.264450758695602 0.037513829767704 1.69507384300232
90 Portugal 89 5.19500017166138 5.28504173308611 5.10495861023665 1.3151752948761 1.36704301834106 0.795843541622162 0.498465299606323 0.0951027125120163 0.0158694516867399 1.10768270492554
91 Bosnia and Herzegovina 90 5.18200016021729 5.27633568674326 5.08766463369131 0.982409417629242 1.0693359375 0.705186307430267 0.204403176903725 0.328867495059967 0 1.89217257499695
92 Honduras 91 5.18100023269653 5.30158279687166 5.0604176685214 0.730573117733002 1.14394497871399 0.582569479942322 0.348079860210419 0.236188873648643 0.0733454525470734 2.06581115722656
93 Macedonia 92 5.17500019073486 5.27217263966799 5.07782774180174 1.06457793712616 1.20789301395416 0.644948184490204 0.325905978679657 0.25376096367836 0.0602777935564518 1.6174693107605
94 Somalia 93 5.15100002288818 5.24248370990157 5.0595163358748 0.0226431842893362 0.721151351928711 0.113989137113094 0.602126955986023 0.291631311178207 0.282410323619843 3.11748456954956
95 Vietnam 94 5.07399988174438 5.14728076457977 5.000718998909 0.788547575473785 1.27749133110046 0.652168989181519 0.571055591106415 0.234968051314354 0.0876332372426987 1.46231865882874
96 Nigeria 95 5.07399988174438 5.20950013548136 4.93849962800741 0.783756256103516 1.21577048301697 0.0569157302379608 0.394952565431595 0.230947196483612 0.0261215660721064 2.36539053916931
97 Tajikistan 96 5.04099988937378 5.11142559587956 4.970574182868 0.524713635444641 1.27146327495575 0.529235124588013 0.471566706895828 0.248997643589973 0.146377146244049 1.84904932975769
98 Bhutan 97 5.01100015640259 5.07933456212282 4.94266575068235 0.885416388511658 1.34012651443481 0.495879292488098 0.501537680625916 0.474054545164108 0.173380389809608 1.14018440246582
99 Kyrgyzstan 98 5.00400018692017 5.08991990312934 4.91808047071099 0.596220076084137 1.39423859119415 0.553457796573639 0.454943388700485 0.42858037352562 0.0394391790032387 1.53672313690186
100 Nepal 99 4.96199989318848 5.06735607936978 4.85664370700717 0.479820191860199 1.17928326129913 0.504130780696869 0.440305948257446 0.394096165895462 0.0729755461215973 1.8912410736084
101 Mongolia 100 4.95499992370605 5.0216795091331 4.88832033827901 1.02723586559296 1.4930112361908 0.557783484458923 0.394143968820572 0.338464230298996 0.0329022891819477 1.11129236221313
102 South Africa 101 4.8289999961853 4.92943518772721 4.72856480464339 1.05469870567322 1.38478863239288 0.187080070376396 0.479246735572815 0.139362379908562 0.0725094974040985 1.51090860366821
103 Tunisia 102 4.80499982833862 4.88436700701714 4.72563264966011 1.00726580619812 0.868351459503174 0.613212049007416 0.289680689573288 0.0496933571994305 0.0867231488227844 1.89025115966797
104 Palestinian Territories 103 4.77500009536743 4.88184834256768 4.66815184816718 0.716249227523804 1.15564715862274 0.565666973590851 0.25471106171608 0.114173173904419 0.0892826020717621 1.8788902759552
105 Egypt 104 4.7350001335144 4.82513378962874 4.64486647740006 0.989701807498932 0.997471392154694 0.520187258720398 0.282110154628754 0.128631442785263 0.114381365478039 1.70216107368469
106 Bulgaria 105 4.71400022506714 4.80369470641017 4.62430574372411 1.1614590883255 1.43437945842743 0.708217680454254 0.289231717586517 0.113177694380283 0.0110515309497714 0.996139287948608
107 Sierra Leone 106 4.70900011062622 4.85064333498478 4.56735688626766 0.36842092871666 0.984136044979095 0.00556475389748812 0.318697690963745 0.293040901422501 0.0710951760411263 2.66845989227295
108 Cameroon 107 4.69500017166138 4.79654085725546 4.5934594860673 0.564305365085602 0.946018218994141 0.132892116904259 0.430388748645782 0.236298456788063 0.0513066314160824 2.3336455821991
109 Iran 108 4.69199991226196 4.79822470769286 4.58577511683106 1.15687310695648 0.711551249027252 0.639333188533783 0.249322608113289 0.387242913246155 0.048761073499918 1.49873495101929
110 Albania 109 4.64400005340576 4.75246400639415 4.53553610041738 0.996192753314972 0.803685247898102 0.731159746646881 0.381498634815216 0.201312944293022 0.0398642159998417 1.49044156074524
111 Bangladesh 110 4.60799980163574 4.68982165828347 4.52617794498801 0.586682975292206 0.735131740570068 0.533241033554077 0.478356659412384 0.172255352139473 0.123717859387398 1.97873616218567
112 Namibia 111 4.57399988174438 4.77035474091768 4.37764502257109 0.964434325695038 1.0984708070755 0.33861181139946 0.520303547382355 0.0771337449550629 0.0931469723582268 1.4818902015686
113 Kenya 112 4.55299997329712 4.65569159060717 4.45030835598707 0.560479462146759 1.06795072555542 0.309988349676132 0.452763766050339 0.444860309362411 0.0646413192152977 1.6519021987915
114 Mozambique 113 4.55000019073486 4.77410232633352 4.3258980551362 0.234305649995804 0.870701014995575 0.106654435396194 0.480791091918945 0.322228103876114 0.179436385631561 2.35565090179443
115 Myanmar 114 4.54500007629395 4.61473994642496 4.47526020616293 0.367110550403595 1.12323594093323 0.397522568702698 0.514492034912109 0.838075160980225 0.188816204667091 1.11529040336609
116 Senegal 115 4.53499984741211 4.6016037812829 4.46839591354132 0.479309022426605 1.17969191074371 0.409362852573395 0.377922266721725 0.183468893170357 0.115460447967052 1.78964614868164
117 Zambia 116 4.51399993896484 4.64410550147295 4.38389437645674 0.636406779289246 1.00318729877472 0.257835894823074 0.461603492498398 0.249580144882202 0.0782135501503944 1.82670545578003
118 Iraq 117 4.49700021743774 4.62259140968323 4.37140902519226 1.10271048545837 0.978613197803497 0.501180469989777 0.288555532693863 0.19963726401329 0.107215754687786 1.31890726089478
119 Gabon 118 4.46500015258789 4.5573617656529 4.37263853952289 1.1982102394104 1.1556202173233 0.356578588485718 0.312328577041626 0.0437853783369064 0.0760467872023582 1.32291626930237
120 Ethiopia 119 4.46000003814697 4.54272867664695 4.377271399647 0.339233845472336 0.86466920375824 0.353409707546234 0.408842742443085 0.312650740146637 0.165455713868141 2.01574373245239
121 Sri Lanka 120 4.44000005722046 4.55344719231129 4.32655292212963 1.00985014438629 1.25997638702393 0.625130832195282 0.561213254928589 0.490863561630249 0.0736539661884308 0.419389247894287
122 Armenia 121 4.37599992752075 4.46673461228609 4.28526524275541 0.900596737861633 1.00748372077942 0.637524425983429 0.198303267359734 0.0834880918264389 0.0266744215041399 1.5214991569519
123 India 122 4.31500005722046 4.37152201749384 4.25847809694707 0.792221248149872 0.754372596740723 0.455427616834641 0.469987004995346 0.231538489460945 0.0922268852591515 1.5191171169281
124 Mauritania 123 4.29199981689453 4.37716361626983 4.20683601751924 0.648457288742065 1.2720308303833 0.285349279642105 0.0960980430245399 0.201870024204254 0.136957004666328 1.65163731575012
125 Congo (Brazzaville) 124 4.29099988937378 4.41005350500345 4.17194627374411 0.808964252471924 0.832044363021851 0.28995743393898 0.435025870800018 0.120852127671242 0.0796181336045265 1.72413563728333
126 Georgia 125 4.28599977493286 4.37493396580219 4.19706558406353 0.950612664222717 0.57061493396759 0.649546980857849 0.309410035610199 0.0540088154375553 0.251666635274887 1.50013780593872
127 Congo (Kinshasa) 126 4.28000020980835 4.35781083270907 4.20218958690763 0.0921023488044739 1.22902345657349 0.191407024860382 0.235961347818375 0.246455833315849 0.0602413564920425 2.22495865821838
128 Mali 127 4.19000005722046 4.26967071101069 4.11032940343022 0.476180493831635 1.28147339820862 0.169365674257278 0.306613743305206 0.183354198932648 0.104970246553421 1.66819095611572
129 Ivory Coast 128 4.17999982833862 4.27518256321549 4.08481709346175 0.603048920631409 0.904780030250549 0.0486421696841717 0.447706192731857 0.201237469911575 0.130061775445938 1.84496426582336
130 Cambodia 129 4.16800022125244 4.27851781353354 4.05748262897134 0.601765096187592 1.00623834133148 0.429783403873444 0.633375823497772 0.385922968387604 0.0681059509515762 1.04294109344482
131 Sudan 130 4.13899993896484 4.34574716508389 3.9322527128458 0.65951669216156 1.21400856971741 0.290920823812485 0.0149958552792668 0.182317450642586 0.089847519993782 1.68706583976746
132 Ghana 131 4.11999988555908 4.22270720854402 4.01729256257415 0.667224824428558 0.873664736747742 0.295637726783752 0.423026293516159 0.256923943758011 0.0253363698720932 1.57786750793457
133 Ukraine 132 4.09600019454956 4.18541010454297 4.00659028455615 0.89465194940567 1.39453756809235 0.575903952121735 0.122974775731564 0.270061463117599 0.0230294708162546 0.814382314682007
134 Uganda 133 4.08099985122681 4.19579996705055 3.96619973540306 0.381430715322495 1.12982773780823 0.217632606625557 0.443185955286026 0.325766056776047 0.057069718837738 1.526362657547
135 Burkina Faso 134 4.03200006484985 4.12405906438828 3.93994106531143 0.3502277135849 1.04328000545502 0.215844258666039 0.324367851018906 0.250864684581757 0.120328105986118 1.72721290588379
136 Niger 135 4.02799987792969 4.11194681972265 3.94405293613672 0.161925330758095 0.993025004863739 0.26850500702858 0.36365869641304 0.228673845529556 0.138572946190834 1.87398338317871
137 Malawi 136 3.97000002861023 4.07747881740332 3.86252123981714 0.233442038297653 0.512568831443787 0.315089583396912 0.466914653778076 0.287170469760895 0.0727116540074348 2.08178615570068
138 Chad 137 3.93600010871887 4.0347115239501 3.83728869348764 0.438012987375259 0.953855872154236 0.0411347150802612 0.16234202682972 0.216113850474358 0.0535818822681904 2.07123804092407
139 Zimbabwe 138 3.875 3.97869964271784 3.77130035728216 0.375846534967422 1.08309590816498 0.196763753890991 0.336384207010269 0.189143493771553 0.0953753814101219 1.59797024726868
140 Lesotho 139 3.80800008773804 4.04434397548437 3.5716561999917 0.521021246910095 1.19009518623352 0 0.390661299228668 0.157497271895409 0.119094640016556 1.42983531951904
141 Angola 140 3.79500007629395 3.95164193540812 3.63835821717978 0.858428180217743 1.10441195964813 0.0498686656355858 0 0.097926490008831 0.0697203353047371 1.61448240280151
142 Afghanistan 141 3.79399991035461 3.87366141527891 3.71433840543032 0.401477217674255 0.581543326377869 0.180746778845787 0.106179520487785 0.311870932579041 0.0611578300595284 2.15080118179321
143 Botswana 142 3.76600003242493 3.87412266626954 3.65787739858031 1.12209415435791 1.22155499458313 0.341755509376526 0.505196332931519 0.0993484482169151 0.0985831990838051 0.3779137134552
144 Benin 143 3.65700006484985 3.74578355133533 3.56821657836437 0.431085407733917 0.435299843549728 0.209930211305618 0.425962775945663 0.207948461174965 0.0609290152788162 1.88563096523285
145 Madagascar 144 3.64400005340576 3.71431910589337 3.57368100091815 0.305808693170547 0.913020372390747 0.375223308801651 0.189196765422821 0.208732530474663 0.0672319754958153 1.58461260795593
146 Haiti 145 3.6029999256134 3.73471479773521 3.47128505349159 0.368610262870789 0.640449821949005 0.277321130037308 0.0303698573261499 0.489203780889511 0.0998721495270729 1.69716763496399
147 Yemen 146 3.59299993515015 3.69275031983852 3.49324955046177 0.591683447360992 0.93538224697113 0.310080915689468 0.249463722109795 0.104125209152699 0.0567674227058887 1.34560060501099
148 South Sudan 147 3.59100008010864 3.72553858578205 3.45646157443523 0.39724862575531 0.601323127746582 0.163486003875732 0.147062435746193 0.285670816898346 0.116793513298035 1.87956738471985
149 Liberia 148 3.53299999237061 3.65375626087189 3.41224372386932 0.119041793048382 0.872117936611176 0.229918196797371 0.332881182432175 0.26654988527298 0.0389482490718365 1.67328596115112
150 Guinea 149 3.50699996948242 3.58442812889814 3.4295718100667 0.244549930095673 0.791244685649872 0.194129139184952 0.348587512969971 0.264815092086792 0.110937617719173 1.55231189727783
151 Togo 150 3.49499988555908 3.59403811171651 3.39596165940166 0.305444717407227 0.431882530450821 0.247105568647385 0.38042613863945 0.196896150708199 0.0956650152802467 1.83722925186157
152 Rwanda 151 3.47099995613098 3.54303023353219 3.39896967872977 0.368745893239975 0.945707023143768 0.326424807310104 0.581843852996826 0.252756029367447 0.455220013856888 0.540061235427856
153 Syria 152 3.46199989318848 3.66366855680943 3.26033122956753 0.777153134346008 0.396102607250214 0.50053334236145 0.0815394446253777 0.493663728237152 0.151347130537033 1.06157350540161
154 Tanzania 153 3.34899997711182 3.46142975538969 3.23657019883394 0.511135876178741 1.04198980331421 0.364509284496307 0.390017777681351 0.354256361722946 0.0660351067781448 0.621130466461182
155 Burundi 154 2.90499997138977 3.07469033300877 2.73530960977077 0.091622568666935 0.629793584346771 0.151610791683197 0.0599007532000542 0.204435184597969 0.0841479450464249 1.68302416801453
156 Central African Republic 155 2.69300007820129 2.86488426923752 2.52111588716507 0 0 0.0187726859003305 0.270842045545578 0.280876487493515 0.0565650761127472 2.06600475311279

@ -0,0 +1,43 @@
"""Add polynomial features to the features set"""
import numpy as np
from .normalize import normalize
def generate_polynomials(dataset, polynomial_degree, normalize_data = False):
"""变换方法:
x1, x2, x1^2, x2^2, x1*x2, x1*x2^2, etc.
"""
features_split = np.array_split(dataset, 2, axis=1)
dataset_1 = features_split[0]
dataset_2 = features_split[1]
(num_examples_1, num_features_1) = dataset_1.shape
(num_examples_2, num_features_2) = dataset_2.shape
if num_examples_1 != num_examples_2:
raise ValueError('Can not generate polynomials for two sets with different number of rows')
if num_features_1 == 0 and num_features_2 == 0:
raise ValueError('Can not generate polynomials for two sets with no columns')
if num_features_1 == 0:
dataset_1 = dataset_2
elif num_features_2 == 0:
dataset_2 = dataset_1
num_features = num_features_1 if num_features_1 < num_examples_2 else num_features_2
dataset_1 = dataset_1[:, :num_features]
dataset_2 = dataset_2[:, :num_features]
polynomials = np.empty((num_examples_1, 0))
for i in range(1, polynomial_degree + 1):
for j in range(i + 1):
polynomial_feature = (dataset_1 ** (i - j)) * (dataset_2 ** j)
polynomials = np.concatenate((polynomials, polynomial_feature), axis=1)
if normalize_data:
polynomials = normalize(polynomials)[0]
return polynomials

@ -0,0 +1,15 @@
import numpy as np
def generate_sinusoids(dataset, sinusoid_degree):
"""
sin(x).
"""
num_examples = dataset.shape[0]
sinusoids = np.empty((num_examples, 0))
for degree in range(1, sinusoid_degree+1):
sinusoid_features = np.sin(degree * dataset)
sinusoids = np.concatenate((sinusoids, sinusoid_features), axis=1)
return sinusoids

@ -0,0 +1,24 @@
"""Normalize features"""
"""数据标准化"""
import numpy as np
def normalize(features):
features_normalized = np.copy(features).astype(float)
# 计算均值
features_mean = np.mean(features, 0)
# 计算标准差
features_deviation = np.std(features, 0)
# 标准化操作
if features.shape[0] > 1:
features_normalized -= features_mean
# 防止除以0
features_deviation[features_deviation == 0] = 1
features_normalized /= features_deviation
return features_normalized, features_mean, features_deviation

@ -0,0 +1,41 @@
"""Prepares the dataset for training"""
import numpy as np
from .normalize import normalize
from .generate_polynomials import generate_polynomials
from .generate_sinusoids import generate_sinusoids
def prepare_for_training(data, polynomial_degree=0, sinusoid_degree=0, normalize_data=True):
# 计算样本总数
num_examples = data.shape[0]
data_processed = np.copy(data)
# 预处理
features_mean = 0
features_deviation = 0
data_normalized = data_processed
if normalize_data:
(
data_normalized,
features_mean,
features_deviation
) = normalize(data_processed)
data_processed = data_normalized
# 特征变换sinusoidal
if sinusoid_degree > 0:
sinusoids = generate_sinusoids(data_normalized, sinusoid_degree)
data_processed = np.concatenate((data_processed, sinusoids), axis=1)
# 特征变换polynomial
if polynomial_degree > 0:
polynomials = generate_polynomials(data_normalized, polynomial_degree)
data_processed = np.concatenate((data_processed, polynomials), axis=1)
# 加一列1
data_processed = np.hstack((np.ones((num_examples, 1)), data_processed))
return data_processed, features_mean, features_deviation
Loading…
Cancel
Save