In order to create the ensemble, we will utilize the openensembles library that we presented in Chapter 8, Clustering. As our dataset does not contain labels, we cannot use the homogeneity score in order to evaluate our clustering models. Instead, we will use the silhouette score, which evaluates how cohesive each cluster is and how separate different clusters are. First, we must load our dataset, which is provided in the WHR.csv file. The second file that we load, Regions.csv, contains the region that each country belongs to. We will utilize the data from 2017, as 2018 has a lot of missing data (for example, Delivery quality and Democratic quality are completely absent). We will fill any missing data using the median of the dataset. For our experiment, we will utilize the factors we presented earlier. We store them in the columns variable, for ease of reference...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia