diff --git a/DIRECTORY.md b/DIRECTORY.md index 483583a..4b32606 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -15,6 +15,8 @@ * Dbscan * [Dbscan](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/dbscan/dbscan.ipynb) * [Dbscan](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/dbscan/dbscan.py) + * Decision Tree With K-Fold Cross Validation + * [K-Fold-Cross Validation Of Decision Tree Regression2](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/Decision%20tree%20with%20k-fold%20cross%20validation/k-fold-cross%20validation%20of%20decision%20tree%20regression2.ipynb) * Decision Tree * [Decision Tree](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/Decision%20tree/Decision_Tree.ipynb) * Fundamentals Of Python @@ -47,6 +49,7 @@ * [Random Forest Regression](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/random_forest_regression/random_forest_regression.py) * Reuters One Vs Rest Classifier * [Reuters One Vs Rest Classifier](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/Reuters_one_vs_rest_classifier/reuters_one_vs_rest_classifier.ipynb) + * [Robust Linear Regression](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/Robust%20Linear%20Regression.ipynb) * Scikit-Learn * [Scikit-Learn](https://github.com/TheAlgorithms/Jupyter/blob/master/machine_learning/Scikit-learn/Scikit-learn.ipynb) diff --git a/First Unique Character.txt b/First Unique Character.txt new file mode 100644 index 0000000..43ee638 --- /dev/null +++ b/First Unique Character.txt @@ -0,0 +1,38 @@ +# Given a string, find the first non-repeating character in it and return its index. +# If it doesn't exist, return -1. # Note: all the input strings are already lowercase. + +#Approach 1 +def solution(s): + frequency = {} + for i in s: + if i not in frequency: + frequency[i] = 1 + else: + frequency[i] +=1 + for i in range(len(s)): + if frequency[s[i]] == 1: + return i + return -1 + +print(solution('alphabet')) +print(solution('barbados')) +print(solution('crunchy')) + +print('###') + +#Approach 2 +import collections + +def solution(s): + # build hash map : character and how often it appears + count = collections.Counter(s) # <-- gives back a dictionary with words occurrence count + #Counter({'l': 1, 'e': 3, 't': 1, 'c': 1, 'o': 1, 'd': 1}) + # find the index + for idx, ch in enumerate(s): + if count[ch] == 1: + return idx + return -1 + +print(solution('alphabet')) +print(solution('barbados')) +print(solution('crunchy')) \ No newline at end of file diff --git a/machine_learning/Decision tree with k-fold cross validation/2019.csv b/machine_learning/Decision tree with k-fold cross validation/2019.csv new file mode 100644 index 0000000..1e6eea4 --- /dev/null +++ b/machine_learning/Decision tree with k-fold cross validation/2019.csv @@ -0,0 +1,157 @@ +Overall rank,Country or region,Score,GDP per capita,Social support,Healthy life expectancy,Freedom to make life choices,Generosity,Perceptions of corruption +1,Finland,7.769,1.340,1.587,0.986,0.596,0.153,0.393 +2,Denmark,7.600,1.383,1.573,0.996,0.592,0.252,0.410 +3,Norway,7.554,1.488,1.582,1.028,0.603,0.271,0.341 +4,Iceland,7.494,1.380,1.624,1.026,0.591,0.354,0.118 +5,Netherlands,7.488,1.396,1.522,0.999,0.557,0.322,0.298 +6,Switzerland,7.480,1.452,1.526,1.052,0.572,0.263,0.343 +7,Sweden,7.343,1.387,1.487,1.009,0.574,0.267,0.373 +8,New Zealand,7.307,1.303,1.557,1.026,0.585,0.330,0.380 +9,Canada,7.278,1.365,1.505,1.039,0.584,0.285,0.308 +10,Austria,7.246,1.376,1.475,1.016,0.532,0.244,0.226 +11,Australia,7.228,1.372,1.548,1.036,0.557,0.332,0.290 +12,Costa Rica,7.167,1.034,1.441,0.963,0.558,0.144,0.093 +13,Israel,7.139,1.276,1.455,1.029,0.371,0.261,0.082 +14,Luxembourg,7.090,1.609,1.479,1.012,0.526,0.194,0.316 +15,United Kingdom,7.054,1.333,1.538,0.996,0.450,0.348,0.278 +16,Ireland,7.021,1.499,1.553,0.999,0.516,0.298,0.310 +17,Germany,6.985,1.373,1.454,0.987,0.495,0.261,0.265 +18,Belgium,6.923,1.356,1.504,0.986,0.473,0.160,0.210 +19,United States,6.892,1.433,1.457,0.874,0.454,0.280,0.128 +20,Czech Republic,6.852,1.269,1.487,0.920,0.457,0.046,0.036 +21,United Arab Emirates,6.825,1.503,1.310,0.825,0.598,0.262,0.182 +22,Malta,6.726,1.300,1.520,0.999,0.564,0.375,0.151 +23,Mexico,6.595,1.070,1.323,0.861,0.433,0.074,0.073 +24,France,6.592,1.324,1.472,1.045,0.436,0.111,0.183 +25,Taiwan,6.446,1.368,1.430,0.914,0.351,0.242,0.097 +26,Chile,6.444,1.159,1.369,0.920,0.357,0.187,0.056 +27,Guatemala,6.436,0.800,1.269,0.746,0.535,0.175,0.078 +28,Saudi Arabia,6.375,1.403,1.357,0.795,0.439,0.080,0.132 +29,Qatar,6.374,1.684,1.313,0.871,0.555,0.220,0.167 +30,Spain,6.354,1.286,1.484,1.062,0.362,0.153,0.079 +31,Panama,6.321,1.149,1.442,0.910,0.516,0.109,0.054 +32,Brazil,6.300,1.004,1.439,0.802,0.390,0.099,0.086 +33,Uruguay,6.293,1.124,1.465,0.891,0.523,0.127,0.150 +34,Singapore,6.262,1.572,1.463,1.141,0.556,0.271,0.453 +35,El Salvador,6.253,0.794,1.242,0.789,0.430,0.093,0.074 +36,Italy,6.223,1.294,1.488,1.039,0.231,0.158,0.030 +37,Bahrain,6.199,1.362,1.368,0.871,0.536,0.255,0.110 +38,Slovakia,6.198,1.246,1.504,0.881,0.334,0.121,0.014 +39,Trinidad & Tobago,6.192,1.231,1.477,0.713,0.489,0.185,0.016 +40,Poland,6.182,1.206,1.438,0.884,0.483,0.117,0.050 +41,Uzbekistan,6.174,0.745,1.529,0.756,0.631,0.322,0.240 +42,Lithuania,6.149,1.238,1.515,0.818,0.291,0.043,0.042 +43,Colombia,6.125,0.985,1.410,0.841,0.470,0.099,0.034 +44,Slovenia,6.118,1.258,1.523,0.953,0.564,0.144,0.057 +45,Nicaragua,6.105,0.694,1.325,0.835,0.435,0.200,0.127 +46,Kosovo,6.100,0.882,1.232,0.758,0.489,0.262,0.006 +47,Argentina,6.086,1.092,1.432,0.881,0.471,0.066,0.050 +48,Romania,6.070,1.162,1.232,0.825,0.462,0.083,0.005 +49,Cyprus,6.046,1.263,1.223,1.042,0.406,0.190,0.041 +50,Ecuador,6.028,0.912,1.312,0.868,0.498,0.126,0.087 +51,Kuwait,6.021,1.500,1.319,0.808,0.493,0.142,0.097 +52,Thailand,6.008,1.050,1.409,0.828,0.557,0.359,0.028 +53,Latvia,5.940,1.187,1.465,0.812,0.264,0.075,0.064 +54,South Korea,5.895,1.301,1.219,1.036,0.159,0.175,0.056 +55,Estonia,5.893,1.237,1.528,0.874,0.495,0.103,0.161 +56,Jamaica,5.890,0.831,1.478,0.831,0.490,0.107,0.028 +57,Mauritius,5.888,1.120,1.402,0.798,0.498,0.215,0.060 +58,Japan,5.886,1.327,1.419,1.088,0.445,0.069,0.140 +59,Honduras,5.860,0.642,1.236,0.828,0.507,0.246,0.078 +60,Kazakhstan,5.809,1.173,1.508,0.729,0.410,0.146,0.096 +61,Bolivia,5.779,0.776,1.209,0.706,0.511,0.137,0.064 +62,Hungary,5.758,1.201,1.410,0.828,0.199,0.081,0.020 +63,Paraguay,5.743,0.855,1.475,0.777,0.514,0.184,0.080 +64,Northern Cyprus,5.718,1.263,1.252,1.042,0.417,0.191,0.162 +65,Peru,5.697,0.960,1.274,0.854,0.455,0.083,0.027 +66,Portugal,5.693,1.221,1.431,0.999,0.508,0.047,0.025 +67,Pakistan,5.653,0.677,0.886,0.535,0.313,0.220,0.098 +68,Russia,5.648,1.183,1.452,0.726,0.334,0.082,0.031 +69,Philippines,5.631,0.807,1.293,0.657,0.558,0.117,0.107 +70,Serbia,5.603,1.004,1.383,0.854,0.282,0.137,0.039 +71,Moldova,5.529,0.685,1.328,0.739,0.245,0.181,0.000 +72,Libya,5.525,1.044,1.303,0.673,0.416,0.133,0.152 +73,Montenegro,5.523,1.051,1.361,0.871,0.197,0.142,0.080 +74,Tajikistan,5.467,0.493,1.098,0.718,0.389,0.230,0.144 +75,Croatia,5.432,1.155,1.266,0.914,0.296,0.119,0.022 +76,Hong Kong,5.430,1.438,1.277,1.122,0.440,0.258,0.287 +77,Dominican Republic,5.425,1.015,1.401,0.779,0.497,0.113,0.101 +78,Bosnia and Herzegovina,5.386,0.945,1.212,0.845,0.212,0.263,0.006 +79,Turkey,5.373,1.183,1.360,0.808,0.195,0.083,0.106 +80,Malaysia,5.339,1.221,1.171,0.828,0.508,0.260,0.024 +81,Belarus,5.323,1.067,1.465,0.789,0.235,0.094,0.142 +82,Greece,5.287,1.181,1.156,0.999,0.067,0.000,0.034 +83,Mongolia,5.285,0.948,1.531,0.667,0.317,0.235,0.038 +84,North Macedonia,5.274,0.983,1.294,0.838,0.345,0.185,0.034 +85,Nigeria,5.265,0.696,1.111,0.245,0.426,0.215,0.041 +86,Kyrgyzstan,5.261,0.551,1.438,0.723,0.508,0.300,0.023 +87,Turkmenistan,5.247,1.052,1.538,0.657,0.394,0.244,0.028 +88,Algeria,5.211,1.002,1.160,0.785,0.086,0.073,0.114 +89,Morocco,5.208,0.801,0.782,0.782,0.418,0.036,0.076 +90,Azerbaijan,5.208,1.043,1.147,0.769,0.351,0.035,0.182 +91,Lebanon,5.197,0.987,1.224,0.815,0.216,0.166,0.027 +92,Indonesia,5.192,0.931,1.203,0.660,0.491,0.498,0.028 +93,China,5.191,1.029,1.125,0.893,0.521,0.058,0.100 +94,Vietnam,5.175,0.741,1.346,0.851,0.543,0.147,0.073 +95,Bhutan,5.082,0.813,1.321,0.604,0.457,0.370,0.167 +96,Cameroon,5.044,0.549,0.910,0.331,0.381,0.187,0.037 +97,Bulgaria,5.011,1.092,1.513,0.815,0.311,0.081,0.004 +98,Ghana,4.996,0.611,0.868,0.486,0.381,0.245,0.040 +99,Ivory Coast,4.944,0.569,0.808,0.232,0.352,0.154,0.090 +100,Nepal,4.913,0.446,1.226,0.677,0.439,0.285,0.089 +101,Jordan,4.906,0.837,1.225,0.815,0.383,0.110,0.130 +102,Benin,4.883,0.393,0.437,0.397,0.349,0.175,0.082 +103,Congo (Brazzaville),4.812,0.673,0.799,0.508,0.372,0.105,0.093 +104,Gabon,4.799,1.057,1.183,0.571,0.295,0.043,0.055 +105,Laos,4.796,0.764,1.030,0.551,0.547,0.266,0.164 +106,South Africa,4.722,0.960,1.351,0.469,0.389,0.130,0.055 +107,Albania,4.719,0.947,0.848,0.874,0.383,0.178,0.027 +108,Venezuela,4.707,0.960,1.427,0.805,0.154,0.064,0.047 +109,Cambodia,4.700,0.574,1.122,0.637,0.609,0.232,0.062 +110,Palestinian Territories,4.696,0.657,1.247,0.672,0.225,0.103,0.066 +111,Senegal,4.681,0.450,1.134,0.571,0.292,0.153,0.072 +112,Somalia,4.668,0.000,0.698,0.268,0.559,0.243,0.270 +113,Namibia,4.639,0.879,1.313,0.477,0.401,0.070,0.056 +114,Niger,4.628,0.138,0.774,0.366,0.318,0.188,0.102 +115,Burkina Faso,4.587,0.331,1.056,0.380,0.255,0.177,0.113 +116,Armenia,4.559,0.850,1.055,0.815,0.283,0.095,0.064 +117,Iran,4.548,1.100,0.842,0.785,0.305,0.270,0.125 +118,Guinea,4.534,0.380,0.829,0.375,0.332,0.207,0.086 +119,Georgia,4.519,0.886,0.666,0.752,0.346,0.043,0.164 +120,Gambia,4.516,0.308,0.939,0.428,0.382,0.269,0.167 +121,Kenya,4.509,0.512,0.983,0.581,0.431,0.372,0.053 +122,Mauritania,4.490,0.570,1.167,0.489,0.066,0.106,0.088 +123,Mozambique,4.466,0.204,0.986,0.390,0.494,0.197,0.138 +124,Tunisia,4.461,0.921,1.000,0.815,0.167,0.059,0.055 +125,Bangladesh,4.456,0.562,0.928,0.723,0.527,0.166,0.143 +126,Iraq,4.437,1.043,0.980,0.574,0.241,0.148,0.089 +127,Congo (Kinshasa),4.418,0.094,1.125,0.357,0.269,0.212,0.053 +128,Mali,4.390,0.385,1.105,0.308,0.327,0.153,0.052 +129,Sierra Leone,4.374,0.268,0.841,0.242,0.309,0.252,0.045 +130,Sri Lanka,4.366,0.949,1.265,0.831,0.470,0.244,0.047 +131,Myanmar,4.360,0.710,1.181,0.555,0.525,0.566,0.172 +132,Chad,4.350,0.350,0.766,0.192,0.174,0.198,0.078 +133,Ukraine,4.332,0.820,1.390,0.739,0.178,0.187,0.010 +134,Ethiopia,4.286,0.336,1.033,0.532,0.344,0.209,0.100 +135,Swaziland,4.212,0.811,1.149,0.000,0.313,0.074,0.135 +136,Uganda,4.189,0.332,1.069,0.443,0.356,0.252,0.060 +137,Egypt,4.166,0.913,1.039,0.644,0.241,0.076,0.067 +138,Zambia,4.107,0.578,1.058,0.426,0.431,0.247,0.087 +139,Togo,4.085,0.275,0.572,0.410,0.293,0.177,0.085 +140,India,4.015,0.755,0.765,0.588,0.498,0.200,0.085 +141,Liberia,3.975,0.073,0.922,0.443,0.370,0.233,0.033 +142,Comoros,3.973,0.274,0.757,0.505,0.142,0.275,0.078 +143,Madagascar,3.933,0.274,0.916,0.555,0.148,0.169,0.041 +144,Lesotho,3.802,0.489,1.169,0.168,0.359,0.107,0.093 +145,Burundi,3.775,0.046,0.447,0.380,0.220,0.176,0.180 +146,Zimbabwe,3.663,0.366,1.114,0.433,0.361,0.151,0.089 +147,Haiti,3.597,0.323,0.688,0.449,0.026,0.419,0.110 +148,Botswana,3.488,1.041,1.145,0.538,0.455,0.025,0.100 +149,Syria,3.462,0.619,0.378,0.440,0.013,0.331,0.141 +150,Malawi,3.410,0.191,0.560,0.495,0.443,0.218,0.089 +151,Yemen,3.380,0.287,1.163,0.463,0.143,0.108,0.077 +152,Rwanda,3.334,0.359,0.711,0.614,0.555,0.217,0.411 +153,Tanzania,3.231,0.476,0.885,0.499,0.417,0.276,0.147 +154,Afghanistan,3.203,0.350,0.517,0.361,0.000,0.158,0.025 +155,Central African Republic,3.083,0.026,0.000,0.105,0.225,0.235,0.035 +156,South Sudan,2.853,0.306,0.575,0.295,0.010,0.202,0.091 diff --git a/machine_learning/Decision tree with k-fold cross validation/k-fold-cross validation of decision tree regression2.ipynb b/machine_learning/Decision tree with k-fold cross validation/k-fold-cross validation of decision tree regression2.ipynb new file mode 100644 index 0000000..712a088 --- /dev/null +++ b/machine_learning/Decision tree with k-fold cross validation/k-fold-cross validation of decision tree regression2.ipynb @@ -0,0 +1,5038 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Overall rankCountry or regionScoreGDP per capitaSocial supportHealthy life expectancyFreedom to make life choicesGenerosityPerceptions of corruption
01Finland7.7691.3401.5870.9860.5960.1530.393
12Denmark7.6001.3831.5730.9960.5920.2520.410
23Norway7.5541.4881.5821.0280.6030.2710.341
34Iceland7.4941.3801.6241.0260.5910.3540.118
45Netherlands7.4881.3961.5220.9990.5570.3220.298
56Switzerland7.4801.4521.5261.0520.5720.2630.343
67Sweden7.3431.3871.4871.0090.5740.2670.373
78New Zealand7.3071.3031.5571.0260.5850.3300.380
89Canada7.2781.3651.5051.0390.5840.2850.308
910Austria7.2461.3761.4751.0160.5320.2440.226
1011Australia7.2281.3721.5481.0360.5570.3320.290
1112Costa Rica7.1671.0341.4410.9630.5580.1440.093
1213Israel7.1391.2761.4551.0290.3710.2610.082
1314Luxembourg7.0901.6091.4791.0120.5260.1940.316
1415United Kingdom7.0541.3331.5380.9960.4500.3480.278
1516Ireland7.0211.4991.5530.9990.5160.2980.310
1617Germany6.9851.3731.4540.9870.4950.2610.265
1718Belgium6.9231.3561.5040.9860.4730.1600.210
1819United States6.8921.4331.4570.8740.4540.2800.128
1920Czech Republic6.8521.2691.4870.9200.4570.0460.036
2021United Arab Emirates6.8251.5031.3100.8250.5980.2620.182
2122Malta6.7261.3001.5200.9990.5640.3750.151
2223Mexico6.5951.0701.3230.8610.4330.0740.073
2324France6.5921.3241.4721.0450.4360.1110.183
2425Taiwan6.4461.3681.4300.9140.3510.2420.097
2526Chile6.4441.1591.3690.9200.3570.1870.056
2627Guatemala6.4360.8001.2690.7460.5350.1750.078
2728Saudi Arabia6.3751.4031.3570.7950.4390.0800.132
2829Qatar6.3741.6841.3130.8710.5550.2200.167
2930Spain6.3541.2861.4841.0620.3620.1530.079
3031Panama6.3211.1491.4420.9100.5160.1090.054
3132Brazil6.3001.0041.4390.8020.3900.0990.086
3233Uruguay6.2931.1241.4650.8910.5230.1270.150
3334Singapore6.2621.5721.4631.1410.5560.2710.453
3435El Salvador6.2530.7941.2420.7890.4300.0930.074
3536Italy6.2231.2941.4881.0390.2310.1580.030
3637Bahrain6.1991.3621.3680.8710.5360.2550.110
3738Slovakia6.1981.2461.5040.8810.3340.1210.014
3839Trinidad & Tobago6.1921.2311.4770.7130.4890.1850.016
3940Poland6.1821.2061.4380.8840.4830.1170.050
4041Uzbekistan6.1740.7451.5290.7560.6310.3220.240
4142Lithuania6.1491.2381.5150.8180.2910.0430.042
4243Colombia6.1250.9851.4100.8410.4700.0990.034
4344Slovenia6.1181.2581.5230.9530.5640.1440.057
4445Nicaragua6.1050.6941.3250.8350.4350.2000.127
4546Kosovo6.1000.8821.2320.7580.4890.2620.006
4647Argentina6.0861.0921.4320.8810.4710.0660.050
4748Romania6.0701.1621.2320.8250.4620.0830.005
4849Cyprus6.0461.2631.2231.0420.4060.1900.041
4950Ecuador6.0280.9121.3120.8680.4980.1260.087
5051Kuwait6.0211.5001.3190.8080.4930.1420.097
5152Thailand6.0081.0501.4090.8280.5570.3590.028
5253Latvia5.9401.1871.4650.8120.2640.0750.064
5354South Korea5.8951.3011.2191.0360.1590.1750.056
5455Estonia5.8931.2371.5280.8740.4950.1030.161
5556Jamaica5.8900.8311.4780.8310.4900.1070.028
5657Mauritius5.8881.1201.4020.7980.4980.2150.060
5758Japan5.8861.3271.4191.0880.4450.0690.140
5859Honduras5.8600.6421.2360.8280.5070.2460.078
5960Kazakhstan5.8091.1731.5080.7290.4100.1460.096
6061Bolivia5.7790.7761.2090.7060.5110.1370.064
6162Hungary5.7581.2011.4100.8280.1990.0810.020
6263Paraguay5.7430.8551.4750.7770.5140.1840.080
6364Northern Cyprus5.7181.2631.2521.0420.4170.1910.162
6465Peru5.6970.9601.2740.8540.4550.0830.027
6566Portugal5.6931.2211.4310.9990.5080.0470.025
6667Pakistan5.6530.6770.8860.5350.3130.2200.098
6768Russia5.6481.1831.4520.7260.3340.0820.031
6869Philippines5.6310.8071.2930.6570.5580.1170.107
6970Serbia5.6031.0041.3830.8540.2820.1370.039
7071Moldova5.5290.6851.3280.7390.2450.1810.000
7172Libya5.5251.0441.3030.6730.4160.1330.152
7273Montenegro5.5231.0511.3610.8710.1970.1420.080
7374Tajikistan5.4670.4931.0980.7180.3890.2300.144
7475Croatia5.4321.1551.2660.9140.2960.1190.022
7576Hong Kong5.4301.4381.2771.1220.4400.2580.287
7677Dominican Republic5.4251.0151.4010.7790.4970.1130.101
7778Bosnia and Herzegovina5.3860.9451.2120.8450.2120.2630.006
7879Turkey5.3731.1831.3600.8080.1950.0830.106
7980Malaysia5.3391.2211.1710.8280.5080.2600.024
8081Belarus5.3231.0671.4650.7890.2350.0940.142
8182Greece5.2871.1811.1560.9990.0670.0000.034
8283Mongolia5.2850.9481.5310.6670.3170.2350.038
8384North Macedonia5.2740.9831.2940.8380.3450.1850.034
8485Nigeria5.2650.6961.1110.2450.4260.2150.041
8586Kyrgyzstan5.2610.5511.4380.7230.5080.3000.023
8687Turkmenistan5.2471.0521.5380.6570.3940.2440.028
8788Algeria5.2111.0021.1600.7850.0860.0730.114
8889Morocco5.2080.8010.7820.7820.4180.0360.076
8990Azerbaijan5.2081.0431.1470.7690.3510.0350.182
9091Lebanon5.1970.9871.2240.8150.2160.1660.027
9192Indonesia5.1920.9311.2030.6600.4910.4980.028
9293China5.1911.0291.1250.8930.5210.0580.100
9394Vietnam5.1750.7411.3460.8510.5430.1470.073
9495Bhutan5.0820.8131.3210.6040.4570.3700.167
9596Cameroon5.0440.5490.9100.3310.3810.1870.037
9697Bulgaria5.0111.0921.5130.8150.3110.0810.004
9798Ghana4.9960.6110.8680.4860.3810.2450.040
9899Ivory Coast4.9440.5690.8080.2320.3520.1540.090
99100Nepal4.9130.4461.2260.6770.4390.2850.089
100101Jordan4.9060.8371.2250.8150.3830.1100.130
101102Benin4.8830.3930.4370.3970.3490.1750.082
102103Congo (Brazzaville)4.8120.6730.7990.5080.3720.1050.093
103104Gabon4.7991.0571.1830.5710.2950.0430.055
104105Laos4.7960.7641.0300.5510.5470.2660.164
105106South Africa4.7220.9601.3510.4690.3890.1300.055
106107Albania4.7190.9470.8480.8740.3830.1780.027
107108Venezuela4.7070.9601.4270.8050.1540.0640.047
108109Cambodia4.7000.5741.1220.6370.6090.2320.062
109110Palestinian Territories4.6960.6571.2470.6720.2250.1030.066
110111Senegal4.6810.4501.1340.5710.2920.1530.072
111112Somalia4.6680.0000.6980.2680.5590.2430.270
112113Namibia4.6390.8791.3130.4770.4010.0700.056
113114Niger4.6280.1380.7740.3660.3180.1880.102
114115Burkina Faso4.5870.3311.0560.3800.2550.1770.113
115116Armenia4.5590.8501.0550.8150.2830.0950.064
116117Iran4.5481.1000.8420.7850.3050.2700.125
117118Guinea4.5340.3800.8290.3750.3320.2070.086
118119Georgia4.5190.8860.6660.7520.3460.0430.164
119120Gambia4.5160.3080.9390.4280.3820.2690.167
120121Kenya4.5090.5120.9830.5810.4310.3720.053
121122Mauritania4.4900.5701.1670.4890.0660.1060.088
122123Mozambique4.4660.2040.9860.3900.4940.1970.138
123124Tunisia4.4610.9211.0000.8150.1670.0590.055
124125Bangladesh4.4560.5620.9280.7230.5270.1660.143
125126Iraq4.4371.0430.9800.5740.2410.1480.089
126127Congo (Kinshasa)4.4180.0941.1250.3570.2690.2120.053
127128Mali4.3900.3851.1050.3080.3270.1530.052
128129Sierra Leone4.3740.2680.8410.2420.3090.2520.045
129130Sri Lanka4.3660.9491.2650.8310.4700.2440.047
130131Myanmar4.3600.7101.1810.5550.5250.5660.172
131132Chad4.3500.3500.7660.1920.1740.1980.078
132133Ukraine4.3320.8201.3900.7390.1780.1870.010
133134Ethiopia4.2860.3361.0330.5320.3440.2090.100
134135Swaziland4.2120.8111.1490.0000.3130.0740.135
135136Uganda4.1890.3321.0690.4430.3560.2520.060
136137Egypt4.1660.9131.0390.6440.2410.0760.067
137138Zambia4.1070.5781.0580.4260.4310.2470.087
138139Togo4.0850.2750.5720.4100.2930.1770.085
139140India4.0150.7550.7650.5880.4980.2000.085
140141Liberia3.9750.0730.9220.4430.3700.2330.033
141142Comoros3.9730.2740.7570.5050.1420.2750.078
142143Madagascar3.9330.2740.9160.5550.1480.1690.041
143144Lesotho3.8020.4891.1690.1680.3590.1070.093
144145Burundi3.7750.0460.4470.3800.2200.1760.180
145146Zimbabwe3.6630.3661.1140.4330.3610.1510.089
146147Haiti3.5970.3230.6880.4490.0260.4190.110
147148Botswana3.4881.0411.1450.5380.4550.0250.100
148149Syria3.4620.6190.3780.4400.0130.3310.141
149150Malawi3.4100.1910.5600.4950.4430.2180.089
150151Yemen3.3800.2871.1630.4630.1430.1080.077
151152Rwanda3.3340.3590.7110.6140.5550.2170.411
152153Tanzania3.2310.4760.8850.4990.4170.2760.147
153154Afghanistan3.2030.3500.5170.3610.0000.1580.025
154155Central African Republic3.0830.0260.0000.1050.2250.2350.035
155156South Sudan2.8530.3060.5750.2950.0100.2020.091
\n", + "
" + ], + "text/plain": [ + " Overall rank Country or region Score GDP per capita \\\n", + "0 1 Finland 7.769 1.340 \n", + "1 2 Denmark 7.600 1.383 \n", + "2 3 Norway 7.554 1.488 \n", + "3 4 Iceland 7.494 1.380 \n", + "4 5 Netherlands 7.488 1.396 \n", + "5 6 Switzerland 7.480 1.452 \n", + "6 7 Sweden 7.343 1.387 \n", + "7 8 New Zealand 7.307 1.303 \n", + "8 9 Canada 7.278 1.365 \n", + "9 10 Austria 7.246 1.376 \n", + "10 11 Australia 7.228 1.372 \n", + "11 12 Costa Rica 7.167 1.034 \n", + "12 13 Israel 7.139 1.276 \n", + "13 14 Luxembourg 7.090 1.609 \n", + "14 15 United Kingdom 7.054 1.333 \n", + "15 16 Ireland 7.021 1.499 \n", + "16 17 Germany 6.985 1.373 \n", + "17 18 Belgium 6.923 1.356 \n", + "18 19 United States 6.892 1.433 \n", + "19 20 Czech Republic 6.852 1.269 \n", + "20 21 United Arab Emirates 6.825 1.503 \n", + "21 22 Malta 6.726 1.300 \n", + "22 23 Mexico 6.595 1.070 \n", + "23 24 France 6.592 1.324 \n", + "24 25 Taiwan 6.446 1.368 \n", + "25 26 Chile 6.444 1.159 \n", + "26 27 Guatemala 6.436 0.800 \n", + "27 28 Saudi Arabia 6.375 1.403 \n", + "28 29 Qatar 6.374 1.684 \n", + "29 30 Spain 6.354 1.286 \n", + "30 31 Panama 6.321 1.149 \n", + "31 32 Brazil 6.300 1.004 \n", + "32 33 Uruguay 6.293 1.124 \n", + "33 34 Singapore 6.262 1.572 \n", + "34 35 El Salvador 6.253 0.794 \n", + "35 36 Italy 6.223 1.294 \n", + "36 37 Bahrain 6.199 1.362 \n", + "37 38 Slovakia 6.198 1.246 \n", + "38 39 Trinidad & Tobago 6.192 1.231 \n", + "39 40 Poland 6.182 1.206 \n", + "40 41 Uzbekistan 6.174 0.745 \n", + "41 42 Lithuania 6.149 1.238 \n", + "42 43 Colombia 6.125 0.985 \n", + "43 44 Slovenia 6.118 1.258 \n", + "44 45 Nicaragua 6.105 0.694 \n", + "45 46 Kosovo 6.100 0.882 \n", + "46 47 Argentina 6.086 1.092 \n", + "47 48 Romania 6.070 1.162 \n", + "48 49 Cyprus 6.046 1.263 \n", + "49 50 Ecuador 6.028 0.912 \n", + "50 51 Kuwait 6.021 1.500 \n", + "51 52 Thailand 6.008 1.050 \n", + "52 53 Latvia 5.940 1.187 \n", + "53 54 South Korea 5.895 1.301 \n", + "54 55 Estonia 5.893 1.237 \n", + "55 56 Jamaica 5.890 0.831 \n", + "56 57 Mauritius 5.888 1.120 \n", + "57 58 Japan 5.886 1.327 \n", + "58 59 Honduras 5.860 0.642 \n", + "59 60 Kazakhstan 5.809 1.173 \n", + "60 61 Bolivia 5.779 0.776 \n", + "61 62 Hungary 5.758 1.201 \n", + "62 63 Paraguay 5.743 0.855 \n", + "63 64 Northern Cyprus 5.718 1.263 \n", + "64 65 Peru 5.697 0.960 \n", + "65 66 Portugal 5.693 1.221 \n", + "66 67 Pakistan 5.653 0.677 \n", + "67 68 Russia 5.648 1.183 \n", + "68 69 Philippines 5.631 0.807 \n", + "69 70 Serbia 5.603 1.004 \n", + "70 71 Moldova 5.529 0.685 \n", + "71 72 Libya 5.525 1.044 \n", + "72 73 Montenegro 5.523 1.051 \n", + "73 74 Tajikistan 5.467 0.493 \n", + "74 75 Croatia 5.432 1.155 \n", + "75 76 Hong Kong 5.430 1.438 \n", + "76 77 Dominican Republic 5.425 1.015 \n", + "77 78 Bosnia and Herzegovina 5.386 0.945 \n", + "78 79 Turkey 5.373 1.183 \n", + "79 80 Malaysia 5.339 1.221 \n", + "80 81 Belarus 5.323 1.067 \n", + "81 82 Greece 5.287 1.181 \n", + "82 83 Mongolia 5.285 0.948 \n", + "83 84 North Macedonia 5.274 0.983 \n", + "84 85 Nigeria 5.265 0.696 \n", + "85 86 Kyrgyzstan 5.261 0.551 \n", + "86 87 Turkmenistan 5.247 1.052 \n", + "87 88 Algeria 5.211 1.002 \n", + "88 89 Morocco 5.208 0.801 \n", + "89 90 Azerbaijan 5.208 1.043 \n", + "90 91 Lebanon 5.197 0.987 \n", + "91 92 Indonesia 5.192 0.931 \n", + "92 93 China 5.191 1.029 \n", + "93 94 Vietnam 5.175 0.741 \n", + "94 95 Bhutan 5.082 0.813 \n", + "95 96 Cameroon 5.044 0.549 \n", + "96 97 Bulgaria 5.011 1.092 \n", + "97 98 Ghana 4.996 0.611 \n", + "98 99 Ivory Coast 4.944 0.569 \n", + "99 100 Nepal 4.913 0.446 \n", + "100 101 Jordan 4.906 0.837 \n", + "101 102 Benin 4.883 0.393 \n", + "102 103 Congo (Brazzaville) 4.812 0.673 \n", + "103 104 Gabon 4.799 1.057 \n", + "104 105 Laos 4.796 0.764 \n", + "105 106 South Africa 4.722 0.960 \n", + "106 107 Albania 4.719 0.947 \n", + "107 108 Venezuela 4.707 0.960 \n", + "108 109 Cambodia 4.700 0.574 \n", + "109 110 Palestinian Territories 4.696 0.657 \n", + "110 111 Senegal 4.681 0.450 \n", + "111 112 Somalia 4.668 0.000 \n", + "112 113 Namibia 4.639 0.879 \n", + "113 114 Niger 4.628 0.138 \n", + "114 115 Burkina Faso 4.587 0.331 \n", + "115 116 Armenia 4.559 0.850 \n", + "116 117 Iran 4.548 1.100 \n", + "117 118 Guinea 4.534 0.380 \n", + "118 119 Georgia 4.519 0.886 \n", + "119 120 Gambia 4.516 0.308 \n", + "120 121 Kenya 4.509 0.512 \n", + "121 122 Mauritania 4.490 0.570 \n", + "122 123 Mozambique 4.466 0.204 \n", + "123 124 Tunisia 4.461 0.921 \n", + "124 125 Bangladesh 4.456 0.562 \n", + "125 126 Iraq 4.437 1.043 \n", + "126 127 Congo (Kinshasa) 4.418 0.094 \n", + "127 128 Mali 4.390 0.385 \n", + "128 129 Sierra Leone 4.374 0.268 \n", + "129 130 Sri Lanka 4.366 0.949 \n", + "130 131 Myanmar 4.360 0.710 \n", + "131 132 Chad 4.350 0.350 \n", + "132 133 Ukraine 4.332 0.820 \n", + "133 134 Ethiopia 4.286 0.336 \n", + "134 135 Swaziland 4.212 0.811 \n", + "135 136 Uganda 4.189 0.332 \n", + "136 137 Egypt 4.166 0.913 \n", + "137 138 Zambia 4.107 0.578 \n", + "138 139 Togo 4.085 0.275 \n", + "139 140 India 4.015 0.755 \n", + "140 141 Liberia 3.975 0.073 \n", + "141 142 Comoros 3.973 0.274 \n", + "142 143 Madagascar 3.933 0.274 \n", + "143 144 Lesotho 3.802 0.489 \n", + "144 145 Burundi 3.775 0.046 \n", + "145 146 Zimbabwe 3.663 0.366 \n", + "146 147 Haiti 3.597 0.323 \n", + "147 148 Botswana 3.488 1.041 \n", + "148 149 Syria 3.462 0.619 \n", + "149 150 Malawi 3.410 0.191 \n", + "150 151 Yemen 3.380 0.287 \n", + "151 152 Rwanda 3.334 0.359 \n", + "152 153 Tanzania 3.231 0.476 \n", + "153 154 Afghanistan 3.203 0.350 \n", + "154 155 Central African Republic 3.083 0.026 \n", + "155 156 South Sudan 2.853 0.306 \n", + "\n", + " Social support Healthy life expectancy Freedom to make life choices \\\n", + "0 1.587 0.986 0.596 \n", + "1 1.573 0.996 0.592 \n", + "2 1.582 1.028 0.603 \n", + "3 1.624 1.026 0.591 \n", + "4 1.522 0.999 0.557 \n", + "5 1.526 1.052 0.572 \n", + "6 1.487 1.009 0.574 \n", + "7 1.557 1.026 0.585 \n", + "8 1.505 1.039 0.584 \n", + "9 1.475 1.016 0.532 \n", + "10 1.548 1.036 0.557 \n", + "11 1.441 0.963 0.558 \n", + "12 1.455 1.029 0.371 \n", + "13 1.479 1.012 0.526 \n", + "14 1.538 0.996 0.450 \n", + "15 1.553 0.999 0.516 \n", + "16 1.454 0.987 0.495 \n", + "17 1.504 0.986 0.473 \n", + "18 1.457 0.874 0.454 \n", + "19 1.487 0.920 0.457 \n", + "20 1.310 0.825 0.598 \n", + "21 1.520 0.999 0.564 \n", + "22 1.323 0.861 0.433 \n", + "23 1.472 1.045 0.436 \n", + "24 1.430 0.914 0.351 \n", + "25 1.369 0.920 0.357 \n", + "26 1.269 0.746 0.535 \n", + "27 1.357 0.795 0.439 \n", + "28 1.313 0.871 0.555 \n", + "29 1.484 1.062 0.362 \n", + "30 1.442 0.910 0.516 \n", + "31 1.439 0.802 0.390 \n", + "32 1.465 0.891 0.523 \n", + "33 1.463 1.141 0.556 \n", + "34 1.242 0.789 0.430 \n", + "35 1.488 1.039 0.231 \n", + "36 1.368 0.871 0.536 \n", + "37 1.504 0.881 0.334 \n", + "38 1.477 0.713 0.489 \n", + "39 1.438 0.884 0.483 \n", + "40 1.529 0.756 0.631 \n", + "41 1.515 0.818 0.291 \n", + "42 1.410 0.841 0.470 \n", + "43 1.523 0.953 0.564 \n", + "44 1.325 0.835 0.435 \n", + "45 1.232 0.758 0.489 \n", + "46 1.432 0.881 0.471 \n", + "47 1.232 0.825 0.462 \n", + "48 1.223 1.042 0.406 \n", + "49 1.312 0.868 0.498 \n", + "50 1.319 0.808 0.493 \n", + "51 1.409 0.828 0.557 \n", + "52 1.465 0.812 0.264 \n", + "53 1.219 1.036 0.159 \n", + "54 1.528 0.874 0.495 \n", + "55 1.478 0.831 0.490 \n", + "56 1.402 0.798 0.498 \n", + "57 1.419 1.088 0.445 \n", + "58 1.236 0.828 0.507 \n", + "59 1.508 0.729 0.410 \n", + "60 1.209 0.706 0.511 \n", + "61 1.410 0.828 0.199 \n", + "62 1.475 0.777 0.514 \n", + "63 1.252 1.042 0.417 \n", + "64 1.274 0.854 0.455 \n", + "65 1.431 0.999 0.508 \n", + "66 0.886 0.535 0.313 \n", + "67 1.452 0.726 0.334 \n", + "68 1.293 0.657 0.558 \n", + "69 1.383 0.854 0.282 \n", + "70 1.328 0.739 0.245 \n", + "71 1.303 0.673 0.416 \n", + "72 1.361 0.871 0.197 \n", + "73 1.098 0.718 0.389 \n", + "74 1.266 0.914 0.296 \n", + "75 1.277 1.122 0.440 \n", + "76 1.401 0.779 0.497 \n", + "77 1.212 0.845 0.212 \n", + "78 1.360 0.808 0.195 \n", + "79 1.171 0.828 0.508 \n", + "80 1.465 0.789 0.235 \n", + "81 1.156 0.999 0.067 \n", + "82 1.531 0.667 0.317 \n", + "83 1.294 0.838 0.345 \n", + "84 1.111 0.245 0.426 \n", + "85 1.438 0.723 0.508 \n", + "86 1.538 0.657 0.394 \n", + "87 1.160 0.785 0.086 \n", + "88 0.782 0.782 0.418 \n", + "89 1.147 0.769 0.351 \n", + "90 1.224 0.815 0.216 \n", + "91 1.203 0.660 0.491 \n", + "92 1.125 0.893 0.521 \n", + "93 1.346 0.851 0.543 \n", + "94 1.321 0.604 0.457 \n", + "95 0.910 0.331 0.381 \n", + "96 1.513 0.815 0.311 \n", + "97 0.868 0.486 0.381 \n", + "98 0.808 0.232 0.352 \n", + "99 1.226 0.677 0.439 \n", + "100 1.225 0.815 0.383 \n", + "101 0.437 0.397 0.349 \n", + "102 0.799 0.508 0.372 \n", + "103 1.183 0.571 0.295 \n", + "104 1.030 0.551 0.547 \n", + "105 1.351 0.469 0.389 \n", + "106 0.848 0.874 0.383 \n", + "107 1.427 0.805 0.154 \n", + "108 1.122 0.637 0.609 \n", + "109 1.247 0.672 0.225 \n", + "110 1.134 0.571 0.292 \n", + "111 0.698 0.268 0.559 \n", + "112 1.313 0.477 0.401 \n", + "113 0.774 0.366 0.318 \n", + "114 1.056 0.380 0.255 \n", + "115 1.055 0.815 0.283 \n", + "116 0.842 0.785 0.305 \n", + "117 0.829 0.375 0.332 \n", + "118 0.666 0.752 0.346 \n", + "119 0.939 0.428 0.382 \n", + "120 0.983 0.581 0.431 \n", + "121 1.167 0.489 0.066 \n", + "122 0.986 0.390 0.494 \n", + "123 1.000 0.815 0.167 \n", + "124 0.928 0.723 0.527 \n", + "125 0.980 0.574 0.241 \n", + "126 1.125 0.357 0.269 \n", + "127 1.105 0.308 0.327 \n", + "128 0.841 0.242 0.309 \n", + "129 1.265 0.831 0.470 \n", + "130 1.181 0.555 0.525 \n", + "131 0.766 0.192 0.174 \n", + "132 1.390 0.739 0.178 \n", + "133 1.033 0.532 0.344 \n", + "134 1.149 0.000 0.313 \n", + "135 1.069 0.443 0.356 \n", + "136 1.039 0.644 0.241 \n", + "137 1.058 0.426 0.431 \n", + "138 0.572 0.410 0.293 \n", + "139 0.765 0.588 0.498 \n", + "140 0.922 0.443 0.370 \n", + "141 0.757 0.505 0.142 \n", + "142 0.916 0.555 0.148 \n", + "143 1.169 0.168 0.359 \n", + "144 0.447 0.380 0.220 \n", + "145 1.114 0.433 0.361 \n", + "146 0.688 0.449 0.026 \n", + "147 1.145 0.538 0.455 \n", + "148 0.378 0.440 0.013 \n", + "149 0.560 0.495 0.443 \n", + "150 1.163 0.463 0.143 \n", + "151 0.711 0.614 0.555 \n", + "152 0.885 0.499 0.417 \n", + "153 0.517 0.361 0.000 \n", + "154 0.000 0.105 0.225 \n", + "155 0.575 0.295 0.010 \n", + "\n", + " Generosity Perceptions of corruption \n", + "0 0.153 0.393 \n", + "1 0.252 0.410 \n", + "2 0.271 0.341 \n", + "3 0.354 0.118 \n", + "4 0.322 0.298 \n", + "5 0.263 0.343 \n", + "6 0.267 0.373 \n", + "7 0.330 0.380 \n", + "8 0.285 0.308 \n", + "9 0.244 0.226 \n", + "10 0.332 0.290 \n", + "11 0.144 0.093 \n", + "12 0.261 0.082 \n", + "13 0.194 0.316 \n", + "14 0.348 0.278 \n", + "15 0.298 0.310 \n", + "16 0.261 0.265 \n", + "17 0.160 0.210 \n", + "18 0.280 0.128 \n", + "19 0.046 0.036 \n", + "20 0.262 0.182 \n", + "21 0.375 0.151 \n", + "22 0.074 0.073 \n", + "23 0.111 0.183 \n", + "24 0.242 0.097 \n", + "25 0.187 0.056 \n", + "26 0.175 0.078 \n", + "27 0.080 0.132 \n", + "28 0.220 0.167 \n", + "29 0.153 0.079 \n", + "30 0.109 0.054 \n", + "31 0.099 0.086 \n", + "32 0.127 0.150 \n", + "33 0.271 0.453 \n", + "34 0.093 0.074 \n", + "35 0.158 0.030 \n", + "36 0.255 0.110 \n", + "37 0.121 0.014 \n", + "38 0.185 0.016 \n", + "39 0.117 0.050 \n", + "40 0.322 0.240 \n", + "41 0.043 0.042 \n", + "42 0.099 0.034 \n", + "43 0.144 0.057 \n", + "44 0.200 0.127 \n", + "45 0.262 0.006 \n", + "46 0.066 0.050 \n", + "47 0.083 0.005 \n", + "48 0.190 0.041 \n", + "49 0.126 0.087 \n", + "50 0.142 0.097 \n", + "51 0.359 0.028 \n", + "52 0.075 0.064 \n", + "53 0.175 0.056 \n", + "54 0.103 0.161 \n", + "55 0.107 0.028 \n", + "56 0.215 0.060 \n", + "57 0.069 0.140 \n", + "58 0.246 0.078 \n", + "59 0.146 0.096 \n", + "60 0.137 0.064 \n", + "61 0.081 0.020 \n", + "62 0.184 0.080 \n", + "63 0.191 0.162 \n", + "64 0.083 0.027 \n", + "65 0.047 0.025 \n", + "66 0.220 0.098 \n", + "67 0.082 0.031 \n", + "68 0.117 0.107 \n", + "69 0.137 0.039 \n", + "70 0.181 0.000 \n", + "71 0.133 0.152 \n", + "72 0.142 0.080 \n", + "73 0.230 0.144 \n", + "74 0.119 0.022 \n", + "75 0.258 0.287 \n", + "76 0.113 0.101 \n", + "77 0.263 0.006 \n", + "78 0.083 0.106 \n", + "79 0.260 0.024 \n", + "80 0.094 0.142 \n", + "81 0.000 0.034 \n", + "82 0.235 0.038 \n", + "83 0.185 0.034 \n", + "84 0.215 0.041 \n", + "85 0.300 0.023 \n", + "86 0.244 0.028 \n", + "87 0.073 0.114 \n", + "88 0.036 0.076 \n", + "89 0.035 0.182 \n", + "90 0.166 0.027 \n", + "91 0.498 0.028 \n", + "92 0.058 0.100 \n", + "93 0.147 0.073 \n", + "94 0.370 0.167 \n", + "95 0.187 0.037 \n", + "96 0.081 0.004 \n", + "97 0.245 0.040 \n", + "98 0.154 0.090 \n", + "99 0.285 0.089 \n", + "100 0.110 0.130 \n", + "101 0.175 0.082 \n", + "102 0.105 0.093 \n", + "103 0.043 0.055 \n", + "104 0.266 0.164 \n", + "105 0.130 0.055 \n", + "106 0.178 0.027 \n", + "107 0.064 0.047 \n", + "108 0.232 0.062 \n", + "109 0.103 0.066 \n", + "110 0.153 0.072 \n", + "111 0.243 0.270 \n", + "112 0.070 0.056 \n", + "113 0.188 0.102 \n", + "114 0.177 0.113 \n", + "115 0.095 0.064 \n", + "116 0.270 0.125 \n", + "117 0.207 0.086 \n", + "118 0.043 0.164 \n", + "119 0.269 0.167 \n", + "120 0.372 0.053 \n", + "121 0.106 0.088 \n", + "122 0.197 0.138 \n", + "123 0.059 0.055 \n", + "124 0.166 0.143 \n", + "125 0.148 0.089 \n", + "126 0.212 0.053 \n", + "127 0.153 0.052 \n", + "128 0.252 0.045 \n", + "129 0.244 0.047 \n", + "130 0.566 0.172 \n", + "131 0.198 0.078 \n", + "132 0.187 0.010 \n", + "133 0.209 0.100 \n", + "134 0.074 0.135 \n", + "135 0.252 0.060 \n", + "136 0.076 0.067 \n", + "137 0.247 0.087 \n", + "138 0.177 0.085 \n", + "139 0.200 0.085 \n", + "140 0.233 0.033 \n", + "141 0.275 0.078 \n", + "142 0.169 0.041 \n", + "143 0.107 0.093 \n", + "144 0.176 0.180 \n", + "145 0.151 0.089 \n", + "146 0.419 0.110 \n", + "147 0.025 0.100 \n", + "148 0.331 0.141 \n", + "149 0.218 0.089 \n", + "150 0.108 0.077 \n", + "151 0.217 0.411 \n", + "152 0.276 0.147 \n", + "153 0.158 0.025 \n", + "154 0.235 0.035 \n", + "155 0.202 0.091 " + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Import libraries require\n", + "\n", + "import numpy as np\n", + "import pandas as pd\n", + "import seaborn as sns\n", + "import matplotlib.pyplot as plt\n", + "\n", + "%matplotlib inline\n", + "sns.set(color_codes = True)\n", + "# Load the data into data frame according to the file where you save it\n", + "\n", + "happiness = pd.read_csv(\"c://2019.csv\")\n", + "\n", + "# Let data frame to display all the data\n", + "\n", + "pd.set_option(\"display.max_rows\", None)\n", + "\n", + "# show the data\n", + "happiness" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
CountryScoreEconomy (GDP per Capita)Social SupportHealth (Life Expectancy)FreedomGenerosityPerception of Corruption
0Finland7.7691.3401.5870.9860.5960.1530.393
1Denmark7.6001.3831.5730.9960.5920.2520.410
2Norway7.5541.4881.5821.0280.6030.2710.341
3Iceland7.4941.3801.6241.0260.5910.3540.118
4Netherlands7.4881.3961.5220.9990.5570.3220.298
5Switzerland7.4801.4521.5261.0520.5720.2630.343
6Sweden7.3431.3871.4871.0090.5740.2670.373
7New Zealand7.3071.3031.5571.0260.5850.3300.380
8Canada7.2781.3651.5051.0390.5840.2850.308
9Austria7.2461.3761.4751.0160.5320.2440.226
10Australia7.2281.3721.5481.0360.5570.3320.290
11Costa Rica7.1671.0341.4410.9630.5580.1440.093
12Israel7.1391.2761.4551.0290.3710.2610.082
13Luxembourg7.0901.6091.4791.0120.5260.1940.316
14United Kingdom7.0541.3331.5380.9960.4500.3480.278
15Ireland7.0211.4991.5530.9990.5160.2980.310
16Germany6.9851.3731.4540.9870.4950.2610.265
17Belgium6.9231.3561.5040.9860.4730.1600.210
18United States6.8921.4331.4570.8740.4540.2800.128
19Czech Republic6.8521.2691.4870.9200.4570.0460.036
20United Arab Emirates6.8251.5031.3100.8250.5980.2620.182
21Malta6.7261.3001.5200.9990.5640.3750.151
22Mexico6.5951.0701.3230.8610.4330.0740.073
23France6.5921.3241.4721.0450.4360.1110.183
24Taiwan6.4461.3681.4300.9140.3510.2420.097
25Chile6.4441.1591.3690.9200.3570.1870.056
26Guatemala6.4360.8001.2690.7460.5350.1750.078
27Saudi Arabia6.3751.4031.3570.7950.4390.0800.132
28Qatar6.3741.6841.3130.8710.5550.2200.167
29Spain6.3541.2861.4841.0620.3620.1530.079
30Panama6.3211.1491.4420.9100.5160.1090.054
31Brazil6.3001.0041.4390.8020.3900.0990.086
32Uruguay6.2931.1241.4650.8910.5230.1270.150
33Singapore6.2621.5721.4631.1410.5560.2710.453
34El Salvador6.2530.7941.2420.7890.4300.0930.074
35Italy6.2231.2941.4881.0390.2310.1580.030
36Bahrain6.1991.3621.3680.8710.5360.2550.110
37Slovakia6.1981.2461.5040.8810.3340.1210.014
38Trinidad & Tobago6.1921.2311.4770.7130.4890.1850.016
39Poland6.1821.2061.4380.8840.4830.1170.050
40Uzbekistan6.1740.7451.5290.7560.6310.3220.240
41Lithuania6.1491.2381.5150.8180.2910.0430.042
42Colombia6.1250.9851.4100.8410.4700.0990.034
43Slovenia6.1181.2581.5230.9530.5640.1440.057
44Nicaragua6.1050.6941.3250.8350.4350.2000.127
45Kosovo6.1000.8821.2320.7580.4890.2620.006
46Argentina6.0861.0921.4320.8810.4710.0660.050
47Romania6.0701.1621.2320.8250.4620.0830.005
48Cyprus6.0461.2631.2231.0420.4060.1900.041
49Ecuador6.0280.9121.3120.8680.4980.1260.087
50Kuwait6.0211.5001.3190.8080.4930.1420.097
51Thailand6.0081.0501.4090.8280.5570.3590.028
52Latvia5.9401.1871.4650.8120.2640.0750.064
53South Korea5.8951.3011.2191.0360.1590.1750.056
54Estonia5.8931.2371.5280.8740.4950.1030.161
55Jamaica5.8900.8311.4780.8310.4900.1070.028
56Mauritius5.8881.1201.4020.7980.4980.2150.060
57Japan5.8861.3271.4191.0880.4450.0690.140
58Honduras5.8600.6421.2360.8280.5070.2460.078
59Kazakhstan5.8091.1731.5080.7290.4100.1460.096
60Bolivia5.7790.7761.2090.7060.5110.1370.064
61Hungary5.7581.2011.4100.8280.1990.0810.020
62Paraguay5.7430.8551.4750.7770.5140.1840.080
63Northern Cyprus5.7181.2631.2521.0420.4170.1910.162
64Peru5.6970.9601.2740.8540.4550.0830.027
65Portugal5.6931.2211.4310.9990.5080.0470.025
66Pakistan5.6530.6770.8860.5350.3130.2200.098
67Russia5.6481.1831.4520.7260.3340.0820.031
68Philippines5.6310.8071.2930.6570.5580.1170.107
69Serbia5.6031.0041.3830.8540.2820.1370.039
70Moldova5.5290.6851.3280.7390.2450.1810.000
71Libya5.5251.0441.3030.6730.4160.1330.152
72Montenegro5.5231.0511.3610.8710.1970.1420.080
73Tajikistan5.4670.4931.0980.7180.3890.2300.144
74Croatia5.4321.1551.2660.9140.2960.1190.022
75Hong Kong5.4301.4381.2771.1220.4400.2580.287
76Dominican Republic5.4251.0151.4010.7790.4970.1130.101
77Bosnia and Herzegovina5.3860.9451.2120.8450.2120.2630.006
78Turkey5.3731.1831.3600.8080.1950.0830.106
79Malaysia5.3391.2211.1710.8280.5080.2600.024
80Belarus5.3231.0671.4650.7890.2350.0940.142
81Greece5.2871.1811.1560.9990.0670.0000.034
82Mongolia5.2850.9481.5310.6670.3170.2350.038
83North Macedonia5.2740.9831.2940.8380.3450.1850.034
84Nigeria5.2650.6961.1110.2450.4260.2150.041
85Kyrgyzstan5.2610.5511.4380.7230.5080.3000.023
87Algeria5.2111.0021.1600.7850.0860.0730.114
88Morocco5.2080.8010.7820.7820.4180.0360.076
89Azerbaijan5.2081.0431.1470.7690.3510.0350.182
90Lebanon5.1970.9871.2240.8150.2160.1660.027
91Indonesia5.1920.9311.2030.6600.4910.4980.028
92China5.1911.0291.1250.8930.5210.0580.100
93Vietnam5.1750.7411.3460.8510.5430.1470.073
94Bhutan5.0820.8131.3210.6040.4570.3700.167
95Cameroon5.0440.5490.9100.3310.3810.1870.037
97Ghana4.9960.6110.8680.4860.3810.2450.040
99Nepal4.9130.4461.2260.6770.4390.2850.089
100Jordan4.9060.8371.2250.8150.3830.1100.130
101Benin4.8830.3930.4370.3970.3490.1750.082
102Congo (Brazzaville)4.8120.6730.7990.5080.3720.1050.093
103Gabon4.7991.0571.1830.5710.2950.0430.055
104Laos4.7960.7641.0300.5510.5470.2660.164
105South Africa4.7220.9601.3510.4690.3890.1300.055
106Albania4.7190.9470.8480.8740.3830.1780.027
107Venezuela4.7070.9601.4270.8050.1540.0640.047
108Cambodia4.7000.5741.1220.6370.6090.2320.062
109Palestinian Territories4.6960.6571.2470.6720.2250.1030.066
110Senegal4.6810.4501.1340.5710.2920.1530.072
112Namibia4.6390.8791.3130.4770.4010.0700.056
113Niger4.6280.1380.7740.3660.3180.1880.102
114Burkina Faso4.5870.3311.0560.3800.2550.1770.113
115Armenia4.5590.8501.0550.8150.2830.0950.064
116Iran4.5481.1000.8420.7850.3050.2700.125
118Georgia4.5190.8860.6660.7520.3460.0430.164
120Kenya4.5090.5120.9830.5810.4310.3720.053
121Mauritania4.4900.5701.1670.4890.0660.1060.088
122Mozambique4.4660.2040.9860.3900.4940.1970.138
123Tunisia4.4610.9211.0000.8150.1670.0590.055
124Bangladesh4.4560.5620.9280.7230.5270.1660.143
126Congo (Kinshasa)4.4180.0941.1250.3570.2690.2120.053
127Mali4.3900.3851.1050.3080.3270.1530.052
128Sierra Leone4.3740.2680.8410.2420.3090.2520.045
129Sri Lanka4.3660.9491.2650.8310.4700.2440.047
130Myanmar4.3600.7101.1810.5550.5250.5660.172
131Chad4.3500.3500.7660.1920.1740.1980.078
132Ukraine4.3320.8201.3900.7390.1780.1870.010
133Ethiopia4.2860.3361.0330.5320.3440.2090.100
135Uganda4.1890.3321.0690.4430.3560.2520.060
136Egypt4.1660.9131.0390.6440.2410.0760.067
137Zambia4.1070.5781.0580.4260.4310.2470.087
138Togo4.0850.2750.5720.4100.2930.1770.085
139India4.0150.7550.7650.5880.4980.2000.085
140Liberia3.9750.0730.9220.4430.3700.2330.033
141Comoros3.9730.2740.7570.5050.1420.2750.078
142Madagascar3.9330.2740.9160.5550.1480.1690.041
143Lesotho3.8020.4891.1690.1680.3590.1070.093
144Burundi3.7750.0460.4470.3800.2200.1760.180
145Zimbabwe3.6630.3661.1140.4330.3610.1510.089
146Haiti3.5970.3230.6880.4490.0260.4190.110
148Syria3.4620.6190.3780.4400.0130.3310.141
149Malawi3.4100.1910.5600.4950.4430.2180.089
150Yemen3.3800.2871.1630.4630.1430.1080.077
151Rwanda3.3340.3590.7110.6140.5550.2170.411
152Tanzania3.2310.4760.8850.4990.4170.2760.147
153Afghanistan3.2030.3500.5170.3610.0000.1580.025
154Central African Republic3.0830.0260.0000.1050.2250.2350.035
155South Sudan2.8530.3060.5750.2950.0100.2020.091
\n", + "
" + ], + "text/plain": [ + " Country Score Economy (GDP per Capita) \\\n", + "0 Finland 7.769 1.340 \n", + "1 Denmark 7.600 1.383 \n", + "2 Norway 7.554 1.488 \n", + "3 Iceland 7.494 1.380 \n", + "4 Netherlands 7.488 1.396 \n", + "5 Switzerland 7.480 1.452 \n", + "6 Sweden 7.343 1.387 \n", + "7 New Zealand 7.307 1.303 \n", + "8 Canada 7.278 1.365 \n", + "9 Austria 7.246 1.376 \n", + "10 Australia 7.228 1.372 \n", + "11 Costa Rica 7.167 1.034 \n", + "12 Israel 7.139 1.276 \n", + "13 Luxembourg 7.090 1.609 \n", + "14 United Kingdom 7.054 1.333 \n", + "15 Ireland 7.021 1.499 \n", + "16 Germany 6.985 1.373 \n", + "17 Belgium 6.923 1.356 \n", + "18 United States 6.892 1.433 \n", + "19 Czech Republic 6.852 1.269 \n", + "20 United Arab Emirates 6.825 1.503 \n", + "21 Malta 6.726 1.300 \n", + "22 Mexico 6.595 1.070 \n", + "23 France 6.592 1.324 \n", + "24 Taiwan 6.446 1.368 \n", + "25 Chile 6.444 1.159 \n", + "26 Guatemala 6.436 0.800 \n", + "27 Saudi Arabia 6.375 1.403 \n", + "28 Qatar 6.374 1.684 \n", + "29 Spain 6.354 1.286 \n", + "30 Panama 6.321 1.149 \n", + "31 Brazil 6.300 1.004 \n", + "32 Uruguay 6.293 1.124 \n", + "33 Singapore 6.262 1.572 \n", + "34 El Salvador 6.253 0.794 \n", + "35 Italy 6.223 1.294 \n", + "36 Bahrain 6.199 1.362 \n", + "37 Slovakia 6.198 1.246 \n", + "38 Trinidad & Tobago 6.192 1.231 \n", + "39 Poland 6.182 1.206 \n", + "40 Uzbekistan 6.174 0.745 \n", + "41 Lithuania 6.149 1.238 \n", + "42 Colombia 6.125 0.985 \n", + "43 Slovenia 6.118 1.258 \n", + "44 Nicaragua 6.105 0.694 \n", + "45 Kosovo 6.100 0.882 \n", + "46 Argentina 6.086 1.092 \n", + "47 Romania 6.070 1.162 \n", + "48 Cyprus 6.046 1.263 \n", + "49 Ecuador 6.028 0.912 \n", + "50 Kuwait 6.021 1.500 \n", + "51 Thailand 6.008 1.050 \n", + "52 Latvia 5.940 1.187 \n", + "53 South Korea 5.895 1.301 \n", + "54 Estonia 5.893 1.237 \n", + "55 Jamaica 5.890 0.831 \n", + "56 Mauritius 5.888 1.120 \n", + "57 Japan 5.886 1.327 \n", + "58 Honduras 5.860 0.642 \n", + "59 Kazakhstan 5.809 1.173 \n", + "60 Bolivia 5.779 0.776 \n", + "61 Hungary 5.758 1.201 \n", + "62 Paraguay 5.743 0.855 \n", + "63 Northern Cyprus 5.718 1.263 \n", + "64 Peru 5.697 0.960 \n", + "65 Portugal 5.693 1.221 \n", + "66 Pakistan 5.653 0.677 \n", + "67 Russia 5.648 1.183 \n", + "68 Philippines 5.631 0.807 \n", + "69 Serbia 5.603 1.004 \n", + "70 Moldova 5.529 0.685 \n", + "71 Libya 5.525 1.044 \n", + "72 Montenegro 5.523 1.051 \n", + "73 Tajikistan 5.467 0.493 \n", + "74 Croatia 5.432 1.155 \n", + "75 Hong Kong 5.430 1.438 \n", + "76 Dominican Republic 5.425 1.015 \n", + "77 Bosnia and Herzegovina 5.386 0.945 \n", + "78 Turkey 5.373 1.183 \n", + "79 Malaysia 5.339 1.221 \n", + "80 Belarus 5.323 1.067 \n", + "81 Greece 5.287 1.181 \n", + "82 Mongolia 5.285 0.948 \n", + "83 North Macedonia 5.274 0.983 \n", + "84 Nigeria 5.265 0.696 \n", + "85 Kyrgyzstan 5.261 0.551 \n", + "87 Algeria 5.211 1.002 \n", + "88 Morocco 5.208 0.801 \n", + "89 Azerbaijan 5.208 1.043 \n", + "90 Lebanon 5.197 0.987 \n", + "91 Indonesia 5.192 0.931 \n", + "92 China 5.191 1.029 \n", + "93 Vietnam 5.175 0.741 \n", + "94 Bhutan 5.082 0.813 \n", + "95 Cameroon 5.044 0.549 \n", + "97 Ghana 4.996 0.611 \n", + "99 Nepal 4.913 0.446 \n", + "100 Jordan 4.906 0.837 \n", + "101 Benin 4.883 0.393 \n", + "102 Congo (Brazzaville) 4.812 0.673 \n", + "103 Gabon 4.799 1.057 \n", + "104 Laos 4.796 0.764 \n", + "105 South Africa 4.722 0.960 \n", + "106 Albania 4.719 0.947 \n", + "107 Venezuela 4.707 0.960 \n", + "108 Cambodia 4.700 0.574 \n", + "109 Palestinian Territories 4.696 0.657 \n", + "110 Senegal 4.681 0.450 \n", + "112 Namibia 4.639 0.879 \n", + "113 Niger 4.628 0.138 \n", + "114 Burkina Faso 4.587 0.331 \n", + "115 Armenia 4.559 0.850 \n", + "116 Iran 4.548 1.100 \n", + "118 Georgia 4.519 0.886 \n", + "120 Kenya 4.509 0.512 \n", + "121 Mauritania 4.490 0.570 \n", + "122 Mozambique 4.466 0.204 \n", + "123 Tunisia 4.461 0.921 \n", + "124 Bangladesh 4.456 0.562 \n", + "126 Congo (Kinshasa) 4.418 0.094 \n", + "127 Mali 4.390 0.385 \n", + "128 Sierra Leone 4.374 0.268 \n", + "129 Sri Lanka 4.366 0.949 \n", + "130 Myanmar 4.360 0.710 \n", + "131 Chad 4.350 0.350 \n", + "132 Ukraine 4.332 0.820 \n", + "133 Ethiopia 4.286 0.336 \n", + "135 Uganda 4.189 0.332 \n", + "136 Egypt 4.166 0.913 \n", + "137 Zambia 4.107 0.578 \n", + "138 Togo 4.085 0.275 \n", + "139 India 4.015 0.755 \n", + "140 Liberia 3.975 0.073 \n", + "141 Comoros 3.973 0.274 \n", + "142 Madagascar 3.933 0.274 \n", + "143 Lesotho 3.802 0.489 \n", + "144 Burundi 3.775 0.046 \n", + "145 Zimbabwe 3.663 0.366 \n", + "146 Haiti 3.597 0.323 \n", + "148 Syria 3.462 0.619 \n", + "149 Malawi 3.410 0.191 \n", + "150 Yemen 3.380 0.287 \n", + "151 Rwanda 3.334 0.359 \n", + "152 Tanzania 3.231 0.476 \n", + "153 Afghanistan 3.203 0.350 \n", + "154 Central African Republic 3.083 0.026 \n", + "155 South Sudan 2.853 0.306 \n", + "\n", + " Social Support Health (Life Expectancy) Freedom Generosity \\\n", + "0 1.587 0.986 0.596 0.153 \n", + "1 1.573 0.996 0.592 0.252 \n", + "2 1.582 1.028 0.603 0.271 \n", + "3 1.624 1.026 0.591 0.354 \n", + "4 1.522 0.999 0.557 0.322 \n", + "5 1.526 1.052 0.572 0.263 \n", + "6 1.487 1.009 0.574 0.267 \n", + "7 1.557 1.026 0.585 0.330 \n", + "8 1.505 1.039 0.584 0.285 \n", + "9 1.475 1.016 0.532 0.244 \n", + "10 1.548 1.036 0.557 0.332 \n", + "11 1.441 0.963 0.558 0.144 \n", + "12 1.455 1.029 0.371 0.261 \n", + "13 1.479 1.012 0.526 0.194 \n", + "14 1.538 0.996 0.450 0.348 \n", + "15 1.553 0.999 0.516 0.298 \n", + "16 1.454 0.987 0.495 0.261 \n", + "17 1.504 0.986 0.473 0.160 \n", + "18 1.457 0.874 0.454 0.280 \n", + "19 1.487 0.920 0.457 0.046 \n", + "20 1.310 0.825 0.598 0.262 \n", + "21 1.520 0.999 0.564 0.375 \n", + "22 1.323 0.861 0.433 0.074 \n", + "23 1.472 1.045 0.436 0.111 \n", + "24 1.430 0.914 0.351 0.242 \n", + "25 1.369 0.920 0.357 0.187 \n", + "26 1.269 0.746 0.535 0.175 \n", + "27 1.357 0.795 0.439 0.080 \n", + "28 1.313 0.871 0.555 0.220 \n", + "29 1.484 1.062 0.362 0.153 \n", + "30 1.442 0.910 0.516 0.109 \n", + "31 1.439 0.802 0.390 0.099 \n", + "32 1.465 0.891 0.523 0.127 \n", + "33 1.463 1.141 0.556 0.271 \n", + "34 1.242 0.789 0.430 0.093 \n", + "35 1.488 1.039 0.231 0.158 \n", + "36 1.368 0.871 0.536 0.255 \n", + "37 1.504 0.881 0.334 0.121 \n", + "38 1.477 0.713 0.489 0.185 \n", + "39 1.438 0.884 0.483 0.117 \n", + "40 1.529 0.756 0.631 0.322 \n", + "41 1.515 0.818 0.291 0.043 \n", + "42 1.410 0.841 0.470 0.099 \n", + "43 1.523 0.953 0.564 0.144 \n", + "44 1.325 0.835 0.435 0.200 \n", + "45 1.232 0.758 0.489 0.262 \n", + "46 1.432 0.881 0.471 0.066 \n", + "47 1.232 0.825 0.462 0.083 \n", + "48 1.223 1.042 0.406 0.190 \n", + "49 1.312 0.868 0.498 0.126 \n", + "50 1.319 0.808 0.493 0.142 \n", + "51 1.409 0.828 0.557 0.359 \n", + "52 1.465 0.812 0.264 0.075 \n", + "53 1.219 1.036 0.159 0.175 \n", + "54 1.528 0.874 0.495 0.103 \n", + "55 1.478 0.831 0.490 0.107 \n", + "56 1.402 0.798 0.498 0.215 \n", + "57 1.419 1.088 0.445 0.069 \n", + "58 1.236 0.828 0.507 0.246 \n", + "59 1.508 0.729 0.410 0.146 \n", + "60 1.209 0.706 0.511 0.137 \n", + "61 1.410 0.828 0.199 0.081 \n", + "62 1.475 0.777 0.514 0.184 \n", + "63 1.252 1.042 0.417 0.191 \n", + "64 1.274 0.854 0.455 0.083 \n", + "65 1.431 0.999 0.508 0.047 \n", + "66 0.886 0.535 0.313 0.220 \n", + "67 1.452 0.726 0.334 0.082 \n", + "68 1.293 0.657 0.558 0.117 \n", + "69 1.383 0.854 0.282 0.137 \n", + "70 1.328 0.739 0.245 0.181 \n", + "71 1.303 0.673 0.416 0.133 \n", + "72 1.361 0.871 0.197 0.142 \n", + "73 1.098 0.718 0.389 0.230 \n", + "74 1.266 0.914 0.296 0.119 \n", + "75 1.277 1.122 0.440 0.258 \n", + "76 1.401 0.779 0.497 0.113 \n", + "77 1.212 0.845 0.212 0.263 \n", + "78 1.360 0.808 0.195 0.083 \n", + "79 1.171 0.828 0.508 0.260 \n", + "80 1.465 0.789 0.235 0.094 \n", + "81 1.156 0.999 0.067 0.000 \n", + "82 1.531 0.667 0.317 0.235 \n", + "83 1.294 0.838 0.345 0.185 \n", + "84 1.111 0.245 0.426 0.215 \n", + "85 1.438 0.723 0.508 0.300 \n", + "87 1.160 0.785 0.086 0.073 \n", + "88 0.782 0.782 0.418 0.036 \n", + "89 1.147 0.769 0.351 0.035 \n", + "90 1.224 0.815 0.216 0.166 \n", + "91 1.203 0.660 0.491 0.498 \n", + "92 1.125 0.893 0.521 0.058 \n", + "93 1.346 0.851 0.543 0.147 \n", + "94 1.321 0.604 0.457 0.370 \n", + "95 0.910 0.331 0.381 0.187 \n", + "97 0.868 0.486 0.381 0.245 \n", + "99 1.226 0.677 0.439 0.285 \n", + "100 1.225 0.815 0.383 0.110 \n", + "101 0.437 0.397 0.349 0.175 \n", + "102 0.799 0.508 0.372 0.105 \n", + "103 1.183 0.571 0.295 0.043 \n", + "104 1.030 0.551 0.547 0.266 \n", + "105 1.351 0.469 0.389 0.130 \n", + "106 0.848 0.874 0.383 0.178 \n", + "107 1.427 0.805 0.154 0.064 \n", + "108 1.122 0.637 0.609 0.232 \n", + "109 1.247 0.672 0.225 0.103 \n", + "110 1.134 0.571 0.292 0.153 \n", + "112 1.313 0.477 0.401 0.070 \n", + "113 0.774 0.366 0.318 0.188 \n", + "114 1.056 0.380 0.255 0.177 \n", + "115 1.055 0.815 0.283 0.095 \n", + "116 0.842 0.785 0.305 0.270 \n", + "118 0.666 0.752 0.346 0.043 \n", + "120 0.983 0.581 0.431 0.372 \n", + "121 1.167 0.489 0.066 0.106 \n", + "122 0.986 0.390 0.494 0.197 \n", + "123 1.000 0.815 0.167 0.059 \n", + "124 0.928 0.723 0.527 0.166 \n", + "126 1.125 0.357 0.269 0.212 \n", + "127 1.105 0.308 0.327 0.153 \n", + "128 0.841 0.242 0.309 0.252 \n", + "129 1.265 0.831 0.470 0.244 \n", + "130 1.181 0.555 0.525 0.566 \n", + "131 0.766 0.192 0.174 0.198 \n", + "132 1.390 0.739 0.178 0.187 \n", + "133 1.033 0.532 0.344 0.209 \n", + "135 1.069 0.443 0.356 0.252 \n", + "136 1.039 0.644 0.241 0.076 \n", + "137 1.058 0.426 0.431 0.247 \n", + "138 0.572 0.410 0.293 0.177 \n", + "139 0.765 0.588 0.498 0.200 \n", + "140 0.922 0.443 0.370 0.233 \n", + "141 0.757 0.505 0.142 0.275 \n", + "142 0.916 0.555 0.148 0.169 \n", + "143 1.169 0.168 0.359 0.107 \n", + "144 0.447 0.380 0.220 0.176 \n", + "145 1.114 0.433 0.361 0.151 \n", + "146 0.688 0.449 0.026 0.419 \n", + "148 0.378 0.440 0.013 0.331 \n", + "149 0.560 0.495 0.443 0.218 \n", + "150 1.163 0.463 0.143 0.108 \n", + "151 0.711 0.614 0.555 0.217 \n", + "152 0.885 0.499 0.417 0.276 \n", + "153 0.517 0.361 0.000 0.158 \n", + "154 0.000 0.105 0.225 0.235 \n", + "155 0.575 0.295 0.010 0.202 \n", + "\n", + " Perception of Corruption \n", + "0 0.393 \n", + "1 0.410 \n", + "2 0.341 \n", + "3 0.118 \n", + "4 0.298 \n", + "5 0.343 \n", + "6 0.373 \n", + "7 0.380 \n", + "8 0.308 \n", + "9 0.226 \n", + "10 0.290 \n", + "11 0.093 \n", + "12 0.082 \n", + "13 0.316 \n", + "14 0.278 \n", + "15 0.310 \n", + "16 0.265 \n", + "17 0.210 \n", + "18 0.128 \n", + "19 0.036 \n", + "20 0.182 \n", + "21 0.151 \n", + "22 0.073 \n", + "23 0.183 \n", + "24 0.097 \n", + "25 0.056 \n", + "26 0.078 \n", + "27 0.132 \n", + "28 0.167 \n", + "29 0.079 \n", + "30 0.054 \n", + "31 0.086 \n", + "32 0.150 \n", + "33 0.453 \n", + "34 0.074 \n", + "35 0.030 \n", + "36 0.110 \n", + "37 0.014 \n", + "38 0.016 \n", + "39 0.050 \n", + "40 0.240 \n", + "41 0.042 \n", + "42 0.034 \n", + "43 0.057 \n", + "44 0.127 \n", + "45 0.006 \n", + "46 0.050 \n", + "47 0.005 \n", + "48 0.041 \n", + "49 0.087 \n", + "50 0.097 \n", + "51 0.028 \n", + "52 0.064 \n", + "53 0.056 \n", + "54 0.161 \n", + "55 0.028 \n", + "56 0.060 \n", + "57 0.140 \n", + "58 0.078 \n", + "59 0.096 \n", + "60 0.064 \n", + "61 0.020 \n", + "62 0.080 \n", + "63 0.162 \n", + "64 0.027 \n", + "65 0.025 \n", + "66 0.098 \n", + "67 0.031 \n", + "68 0.107 \n", + "69 0.039 \n", + "70 0.000 \n", + "71 0.152 \n", + "72 0.080 \n", + "73 0.144 \n", + "74 0.022 \n", + "75 0.287 \n", + "76 0.101 \n", + "77 0.006 \n", + "78 0.106 \n", + "79 0.024 \n", + "80 0.142 \n", + "81 0.034 \n", + "82 0.038 \n", + "83 0.034 \n", + "84 0.041 \n", + "85 0.023 \n", + "87 0.114 \n", + "88 0.076 \n", + "89 0.182 \n", + "90 0.027 \n", + "91 0.028 \n", + "92 0.100 \n", + "93 0.073 \n", + "94 0.167 \n", + "95 0.037 \n", + "97 0.040 \n", + "99 0.089 \n", + "100 0.130 \n", + "101 0.082 \n", + "102 0.093 \n", + "103 0.055 \n", + "104 0.164 \n", + "105 0.055 \n", + "106 0.027 \n", + "107 0.047 \n", + "108 0.062 \n", + "109 0.066 \n", + "110 0.072 \n", + "112 0.056 \n", + "113 0.102 \n", + "114 0.113 \n", + "115 0.064 \n", + "116 0.125 \n", + "118 0.164 \n", + "120 0.053 \n", + "121 0.088 \n", + "122 0.138 \n", + "123 0.055 \n", + "124 0.143 \n", + "126 0.053 \n", + "127 0.052 \n", + "128 0.045 \n", + "129 0.047 \n", + "130 0.172 \n", + "131 0.078 \n", + "132 0.010 \n", + "133 0.100 \n", + "135 0.060 \n", + "136 0.067 \n", + "137 0.087 \n", + "138 0.085 \n", + "139 0.085 \n", + "140 0.033 \n", + "141 0.078 \n", + "142 0.041 \n", + "143 0.093 \n", + "144 0.180 \n", + "145 0.089 \n", + "146 0.110 \n", + "148 0.141 \n", + "149 0.089 \n", + "150 0.077 \n", + "151 0.411 \n", + "152 0.147 \n", + "153 0.025 \n", + "154 0.035 \n", + "155 0.091 " + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Rename the columns to make it more easy to understand\n", + "\n", + "happiness = happiness.rename(columns = {'Overall rank': 'Rank', 'Country or region': 'Country', \n", + " 'GDP per capita': 'Economy (GDP per Capita)', 'Social support': 'Social Support', \n", + " 'Healthy life expectancy': 'Health (Life Expectancy)', \n", + " 'Freedom to make life choices': 'Freedom',\n", + " 'Perceptions of corruption': 'Perception of Corruption'})\n", + "\n", + "#cleaning null value and inconsistent data\n", + "happiness.drop(index=86,axis=0 , inplace=True)\n", + "happiness.drop(index=96,axis=0 , inplace=True)\n", + "happiness.drop(index=98,axis=0 , inplace=True)\n", + "happiness.drop(index=111,axis=0 , inplace=True)\n", + "happiness.drop(index=117,axis=0 , inplace=True)\n", + "happiness.drop(index=119,axis=0 , inplace=True)\n", + "happiness.drop(index=125,axis=0 , inplace=True)\n", + "happiness.drop(index=134,axis=0 , inplace=True)\n", + "happiness.drop(index=147,axis=0 , inplace=True)\n", + "\n", + "# Dropping the unimportant columns\n", + "\n", + "happiness.drop(['Rank'], axis = 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of dyplicate rows: (0, 9)\n" + ] + } + ], + "source": [ + "# Checking if the rows containing any duplicate data or not\n", + "\n", + "duplicate_rows_happiness = happiness[happiness.duplicated()]\n", + "print(\"number of dyplicate rows: \", duplicate_rows_happiness.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank 0\n", + "Country 0\n", + "Score 0\n", + "Economy (GDP per Capita) 0\n", + "Social Support 0\n", + "Health (Life Expectancy) 0\n", + "Freedom 0\n", + "Generosity 0\n", + "Perception of Corruption 0\n", + "dtype: int64\n" + ] + } + ], + "source": [ + "# Find the null values.\n", + "\n", + "print(happiness.isnull().sum())" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Rank 147\n", + "Country 147\n", + "Score 147\n", + "Economy (GDP per Capita) 147\n", + "Social Support 147\n", + "Health (Life Expectancy) 147\n", + "Freedom 147\n", + "Generosity 147\n", + "Perception of Corruption 147\n", + "dtype: int64" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Drop the missing values.\n", + "happiness = happiness.dropna() \n", + "happiness.count()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank 0\n", + "Country 0\n", + "Score 0\n", + "Economy (GDP per Capita) 0\n", + "Social Support 0\n", + "Health (Life Expectancy) 0\n", + "Freedom 0\n", + "Generosity 0\n", + "Perception of Corruption 0\n", + "dtype: int64\n" + ] + } + ], + "source": [ + "# After dropping the values\n", + "\n", + "print(happiness.isnull().sum())" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R2: 0.5694117211173655\n" + ] + } + ], + "source": [ + "# Decision Tree Regression\n", + "\n", + "x = pd.DataFrame(np.c_[happiness['Economy (GDP per Capita)'], happiness['Social Support'], happiness['Health (Life Expectancy)']], \n", + " columns = ['Economy (GDP per Capita)','Social Support','Health (Life Expectancy)'])\n", + "y = happiness['Score']\n", + "\n", + "# split the data using train_test_split\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(x, y, test_size = 0.2, random_state=42)\n", + "\n", + "# build the model\n", + "from sklearn.tree import DecisionTreeRegressor\n", + "regressor = DecisionTreeRegressor()\n", + "\n", + "# Fitting Decision Tree Regression into dataset\n", + "regressor.fit(x_train, y_train)\n", + "\n", + "y_pred = regressor.predict(x_test)\n", + "\n", + "# test the accuracy/performance measurement using R2\n", + "print('R2: ', regressor.score(x_test, y_test))" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Real ValuesPredicted Values
1324.3325.261
516.0085.523
1463.5974.085
196.8526.118
1074.7076.125
127.1396.223
765.4255.523
316.3006.125
815.2875.339
97.2466.985
266.4366.253
994.9135.779
1523.2314.996
675.6485.888
1423.9334.286
665.6534.996
186.8926.825
695.6036.125
1314.3504.374
306.3216.293
296.3546.223
1084.7004.166
366.1996.446
1244.4565.208
555.8905.743
226.5955.523
645.6975.386
1413.9734.286
825.2854.696
117.1675.323
\n", + "
" + ], + "text/plain": [ + " Real Values Predicted Values\n", + "132 4.332 5.261\n", + "51 6.008 5.523\n", + "146 3.597 4.085\n", + "19 6.852 6.118\n", + "107 4.707 6.125\n", + "12 7.139 6.223\n", + "76 5.425 5.523\n", + "31 6.300 6.125\n", + "81 5.287 5.339\n", + "9 7.246 6.985\n", + "26 6.436 6.253\n", + "99 4.913 5.779\n", + "152 3.231 4.996\n", + "67 5.648 5.888\n", + "142 3.933 4.286\n", + "66 5.653 4.996\n", + "18 6.892 6.825\n", + "69 5.603 6.125\n", + "131 4.350 4.374\n", + "30 6.321 6.293\n", + "29 6.354 6.223\n", + "108 4.700 4.166\n", + "36 6.199 6.446\n", + "124 4.456 5.208\n", + "55 5.890 5.743\n", + "22 6.595 5.523\n", + "64 5.697 5.386\n", + "141 3.973 4.286\n", + "82 5.285 4.696\n", + "11 7.167 5.323" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = pd.DataFrame({'Real Values':y_test, 'Predicted Values':y_pred})\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEXCAYAAACtTzM+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAta0lEQVR4nO3de1QV5f4/8PdGEjTAglCMOmT2M41M8JIHRRHNBLxgYJYaXjhQ4ml5pCOKiJJ4F5KlEsXxe9KTUhY3PcfM0ky/JlRoluCt0qMhKiCKXJTb3s/vD2G+brltcM+GGd+vtVqrmdnM/nxmhM/M88w8j0YIIUBERA88s7YOgIiI2gcWBCIiAsCCQEREtVgQiIgIAAsCERHVYkEgIiIAgHlbB0DKd+nSJYwePRq9evUCAOh0Ojz88MOYPn06fHx8Wr3f4OBgLFy4EM8880yD27Ozs7F582Zs3Lix1d9RZ8WKFcjKygIAnDt3Do6OjrC0tAQAfPbZZ9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Xn31VWRlZSErKwubN2/G5s2bkZKSgszMTLi7u0s5zpw5EwCwbt06+Pj4SOPj+/n5YeXKlVJ8AwYMkPZ/8OBBlJaWIiMjAwBQXV0NOzu7Zo42PWhYEEhR7u1DuNfdA4DpdDr4+voiLCxMWi4oKECXLl2g0Wgg7hq1paFRLzt06KA3lHBJSUm9zmatVgtra2u9mK5duwZra2usW7dO7zsa6ws4duwYjh8/jqCgIHh6esLT0xPvvPMOxo0bhyNHjtSLo6KiAnl5edDpdPX2JYRATU1Ng8ciIiICHh4eAO7MDaCkyWHINPiUEamWu7s7vvjiCxQUFAAAPv30U8yYMQMAMGzYMHz22WcA7gyL/MMPP9T7+SFDhmDfvn0oKysDAGzatAlbt26Fubk5tFothBDo0aOHXpG6cuUKxo0bh5ycHAwfPhx79+5FSUkJdDpdo4XM1tYWH3zwAY4ePSqtKywsRFlZGXr16oXBgwcjMzNTymPHjh2IiYnBsGHDsGfPHly/fh0AkJqa2mhfhbu7O5KSklBVVQWdToclS5Zg/fr1rTqupF68QyDVcnd3R3BwMAIDA6HRaGBlZYX4+HhoNBpERUVh0aJF8Pb2hoODQ4NPKHl4eOD333/HlClTAADPPPMMli9fjk6dOuGFF17A2LFjkZSUhISEBKxcuRL/8z//g5qaGvztb3+TmmvOnj0Lf39/2NjYoHfv3rhx40a97+nRowfef/99xMXF4erVq7CwsIC1tTVWrVqFp59+GgAQFhaGoKAgAHdmxVq1ahW6deuGmTNnYsaMGdDpdFInuJlZ/eu8OXPmYO3atXjllVeg1WrRp08fhIeHG+1YkzpwtFMiIgLAJiMiIqrFgkBERABYEIiIqBYLAhERAWBBICKiWiwIREQEgAWBiIhqsSAQEREA4P8Dtw9nwD705DMAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Visualising the Decision Tree Regression Results \n", + "\n", + "X_grid = np.arange(0, 10)\n", + "X_grid = X_grid.reshape((len(X_grid), 1))\n", + "plt.scatter(y_pred, y_test)\n", + "plt.title('Decision Tree Regression')\n", + "plt.xlabel('Predicted Score')\n", + "plt.ylabel('Score')\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.5222810333333335" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from sklearn import metrics\n", + "mse = metrics.mean_squared_error(y_test, y_pred)\n", + "mse" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mean in first_cv_scores is -0.87 and in second_cv_scores is -0.68\n" + ] + } + ], + "source": [ + "# k-fold cross validation of decision tree regression\n", + "\n", + "from sklearn.model_selection import cross_val_score\n", + "regressor = DecisionTreeRegressor()\n", + "\n", + "first_cv_scores = cross_val_score(regressor, x, y, cv=5, scoring='neg_mean_squared_error')\n", + "second_cv_scores = cross_val_score(regressor, x, y, cv=10, scoring='neg_mean_squared_error')\n", + "print('mean in first_cv_scores is {0:.2f} and in second_cv_scores is {1:.2f}'.format(np.mean\n", + "(first_cv_scores),\n", + " np.mean\n", + "(second_cv_scores)))\n", + "\n", + "# neg_mean_squared_error is better when close to 0.0" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/machine_learning/Robust Linear Regression.ipynb b/machine_learning/Robust Linear Regression.ipynb new file mode 100644 index 0000000..8694530 --- /dev/null +++ b/machine_learning/Robust Linear Regression.ipynb @@ -0,0 +1,343 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "681773a2", + "metadata": {}, + "source": [ + "# Robust Linear Regression\n", + "\n", + "In this notebook, we demonstrate HuberRegressor class from scikit-learn which is robust to outliers." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "2dc1c06a", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from sklearn.linear_model import HuberRegressor, LinearRegression\n", + "from sklearn.datasets import make_regression\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "id": "99095791", + "metadata": {}, + "source": [ + "**Creating a regression problem using make_regression method**" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "7c32f354", + "metadata": {}, + "outputs": [], + "source": [ + "rng = np.random.RandomState(0)\n", + "\n", + "X, y, coef = make_regression(n_samples = 200, n_features = 2, noise = 4.0, coef = True, random_state = 0)" + ] + }, + { + "cell_type": "markdown", + "id": "7e25a9f6", + "metadata": {}, + "source": [ + "**Plot**" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "0b521419", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAADCCAYAAACVBLzQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA61ElEQVR4nO2df5AU53nnv+8MAwygMKuIIGuEjC6lgxMhsCXKVoXU1a4SGye25A2OLbnknM+5O10qietEqbayOrsi5MjFVrBPqUpyVefILqfKOoNsfGspOEGOYCt3XGQHvEswNnuSI+vHSCI47GDQDmJ29r0/dnvo6Xnf7rd/d898P1UqsT093W/39Pvt533e530eIaUEIYQQQgiJjkLaDSCEEEII6TVoYBFCCCGERAwNLEIIIYSQiKGBRQghhBASMTSwCCGEEEIihgYWIYQQQkjELEu7AXZuuOEGuXHjxrSb4clbb72F1atXp90M3+Sx3XlsM8B2++HkyZM/kVKuS/S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IQgE1YvJ8vA/gdKWUt3Va5k0dNA6hrSZBHXQPS1zYaWIQQQgghEcMpQkIIIYSQiKGBRQghhBASMTSwCCGEEEIihgYWIYQQQkjE0MAihBBCCIkYGliEEEIIIRFDA4sQQgghJGJoYBFCCCGERMz/BzP4WzjIiZf5AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fix, ax = plt.subplots(1, 2, figsize = (10, 3))\n", + "ax[0].scatter(X[:,0], y)\n", + "ax[0].grid(True)\n", + "ax[1].scatter(X[:,1], y)\n", + "ax[1].grid(True)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7ed266d1", + "metadata": {}, + "source": [ + "**Inserting random outliers in the data**" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "1efd96b2", + "metadata": {}, + "outputs": [], + "source": [ + "X[:4] = rng.uniform(10, 20, (4, 2))\n", + "y[:4] = rng.uniform(100, 200, 4)" + ] + }, + { + "cell_type": "markdown", + "id": "505d0301", + "metadata": {}, + "source": [ + "**Plot to show the inserted outlier**" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "dc21f8e4", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmUAAADCCAYAAAAICbVYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAmeUlEQVR4nO3db5Bc1Xnn8e8zTQu3kJcRBo9FA4bNssIoClI0RdjS1taIJBax10aGEGDtmNq4Sq4tvBsoapJR4jUiDotqVQS/iEmVHFywBUYQo4xlY0d2EFPeZZFtaUdECJhCNrasFgES1ARJDWr1nH3R3UNPz739997u2/f+PlWqmb7d032OevTo6XOec4455xARERGR/hrqdwNEREREREmZiIiISCQoKRMRERGJAC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k/2xgGn35vNrNc5T3fb2Yf62cbpXNxjFtxiElxjDdxjCVmdqGZPW1mL5rZQTP7w8r1tt8rJWUBqhzD8lXgd4DLgZsrx7UkxTrn3Kq4LWuu8yALj9WZAJ5yzl0KPFW5HTcP4n2c0H2V93yVc+67PW6TBCDmcWvQY9KDxC/ePEj8Yslp4A7n3EeAq4BbK/+G2n6vlJQF60rgkHPuZ865U8B2yse1SEw4534IvFl3+Vrgocr3DxHDY3d8+i3xoLgVUXGMN3GMJc65V51z/6/y/dvAi5RP+mj7vVJSFqws8Mua2w2PkYoZB3zfzPZVjpdJkpHK/lVUvn6wz+3ppS+Y2T9UpiQGahpF5sQ1bsU1JsU13sQilpjZxcBq4Ed08F4pKQtWW8dIxcxa59yvU54CudXM/kO/GySh+yvgV4BVwKvAvX1tjXQqrnFLMWlwxCKWmNkS4AngNufcv3TyHErKguV3NEvsOeeOVr6+Dvwt5SmRpHjNzJYBVL6+3uf29IRz7jXnXMk5Nwt8jWS953ESy7gV45gUu3gTh1hiZmnKCdkjzrkdlcttv1dKyoL1E+BSM7vEzBYBN1E+riXWzOwsM3t/9Xvgo8DzjX8qVnYCt1S+v4WEHLtTDTYVnyJZ73mcxC5uxTwmxS7eDHosqRy59gDwonPuL2ruavu90uaxAass5f0KkAK+7py7u78tCp+Z/WvKn0ShfMj9N+LabzN7FBgDzgVeA+4EJikfyXMRcBi4wTkXq0JWn36PUZ5ucMDPgc9X6ydksMQtbsUlJsUx3sQxlpjZvwf+N3AAmK1c/hPKdWVtvVdKykREREQiQNOXIiIiIhGgpExEREQkApSUiYiIiESAkjIRERGRCFBSJiIiIhIBSspEREREIkBJmYiIiEgEKCkTERERiYD/D5Rwb0zTsrNlAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fix, ax = plt.subplots(1, 2, figsize = (10, 3))\n", + "ax[0].scatter(X[:,0], y)\n", + "ax[0].grid(True)\n", + "ax[1].scatter(X[:,1], y)\n", + "ax[1].grid(True)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e3bf337f", + "metadata": {}, + "source": [ + "**Create a HuberRegressor object and fit**\n", + "\n", + "The Huber Regressor optimizes the squared loss for the samples where $|\\frac{y - X'w}{\\sigma}| < \\epsilon$ and the absolute loss for the samples where $|\\frac{y - X'w}{\\sigma}| < \\epsilon$, where $w$ and $\\sigma$ are parameters to be optimized.\n", + "\n", + "The parameter $\\sigma$ makes sure that if $y$ is scaled up or down by a certain factor, one does not need to rescale epsilon to achieve the same robustness. Note that this does not take into account the fact that the different features of $X$ may be of different scales." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "5ec880ba", + "metadata": {}, + "outputs": [], + "source": [ + "huber = HuberRegressor()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "6bd3684c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "HuberRegressor()" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "huber.fit(X, y)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "62c25065", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[16.02763376, 15.44883183]])" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "X[1].reshape(1, -1)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "96837c28", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([763.50484115])" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "huber.predict(X[1].reshape(1, -1))" + ] + }, + { + "cell_type": "markdown", + "id": "0ecbda8e", + "metadata": {}, + "source": [ + "**A simple linear regression fir for comparison**" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "ef2a97d4", + "metadata": {}, + "outputs": [], + "source": [ + "linear = LinearRegression()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "0df053ad", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "LinearRegression()" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "linear.fit(X, y)" + ] + }, + { + "cell_type": "markdown", + "id": "60189bf7", + "metadata": {}, + "source": [ + "**Compare the estimated coefficients**\n", + "\n", + "As we will see, the Huber regressor estimates the coefficients, in the presence of outliers, far better (closer to the true values) than a simple linear model." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "c9e56d9b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True coefficients: [20.4923687 34.16981149]\n", + "Huber coefficients: [17.79064226 31.01065329]\n", + "Linear Regression coefficients: [ 1.97461433 11.65050932]\n" + ] + } + ], + "source": [ + "print(\"True coefficients:\", coef)\n", + "print(\"Huber coefficients:\", huber.coef_)\n", + "print(\"Linear Regression coefficients:\", linear.coef_)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "2d682f94", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAvcAAADUCAYAAAAY2AwKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAes0lEQVR4nO3de7wtdV3/8dfbc7gJgiIXj2gcK9C8FCKSCCoIUYGJGEKmP8As0MyfZJSYPgjxZ4GaWZohmYH9vABeSVFABBF/3A5w4IBchDgkiKCcuKpc5PP7Y2bXcrHWvp2199p7eD0fj/VYe2a+M/NZ3z3rO5/9ne/MTlUhSZIkafF7zLgDkCRJkjQaJveSJElSR5jcS5IkSR1hci9JkiR1hMm9JEmS1BEm95IkSVJHmNyrM5L8cpKPJrk8yc+SnDOLbWyb5Kgkjx99hLOXZMMkn0lyR5JKcnA7/4+S3JjkoSTnJFne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NVd08aOFc1M0k3+kFc9x0xKKoq/n6/o3YdI7VsZtmmzOv1vL7P6+GxbrQ6jXJ5mmfBJdkA9p2nYVZpwNjnVWdDrrL1teUdzTvRXNn+A3AO9p5bwDeUP9zx/M/tstXATvMURy70FxKvgJY2b726ovlT4CraJ4GcQHwwjmsl19s93N5u8+x1U27r8fSJOub9Mybt7qh+aPiVuBBmp7C1wNPBM4Cvtu+b9qWfTJw2mTH2BzEcj3NuOOJY+e4/liG/U7nIJZ/a4+HK2ga3WXzUS/D4mnnnzBxrPSUneu6GfadHstx0+XXYqiruTjGRhzftNu4BRjnwDZnzHHO6Pu/QGNdUPUK/CpwWRvPlbRPPlugdTos1hnXqf+hVpIkSeoIh+VIkiRJHWFyL0mSJHWEyb0kSZLUESb3kiRJUkeY3EuSJEkdYXIvSZIkdYTJvSRJktQRJveSJElSR/x/wbK3dNwRzCQAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fix, ax = plt.subplots(1, 2, figsize = (12, 3), sharey = True)\n", + "ax[0].barh(['True coef', 'Huber coef', 'Linear fit coef'], width = [coef[0], huber.coef_[0], linear.coef_[0]])\n", + "ax[0].set_title(\"1st coefficients\", fontsize = 15)\n", + "ax[1].barh(['True coef', 'Huber coef', 'Linear fit coef'], width = [coef[1], huber.coef_[1], linear.coef_[1]])\n", + "ax[1].set_title(\"2nd coefficients\", fontsize = 15)\n", + "plt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}