Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Ensemble Learning with Python

You're reading from  Hands-On Ensemble Learning with Python

Product type Book
Published in Jul 2019
Publisher Packt
ISBN-13 9781789612851
Pages 298 pages
Edition 1st Edition
Languages
Authors (2):
George Kyriakides George Kyriakides
Profile icon George Kyriakides
Konstantinos G. Margaritis Konstantinos G. Margaritis
Profile icon Konstantinos G. Margaritis
View More author details
Toc

Table of Contents (20) Chapters close

Preface 1. Section 1: Introduction and Required Software Tools
2. A Machine Learning Refresher 3. Getting Started with Ensemble Learning 4. Section 2: Non-Generative Methods
5. Voting 6. Stacking 7. Section 3: Generative Methods
8. Bagging 9. Boosting 10. Random Forests 11. Section 4: Clustering
12. Clustering 13. Section 5: Real World Applications
14. Classifying Fraudulent Transactions 15. Predicting Bitcoin Prices 16. Evaluating Sentiment on Twitter 17. Recommending Movies with Keras 18. Clustering World Happiness 19. Another Book You May Enjoy

Gaining insights

In order to gain further insights into our dataset's structure and relationships, we will use the t-SNE approach, with ensembles of size 20 and base k-Nearest Neighbors (k-NN) clusterers with a K value of 10. First, we create and train the cluster. Then, we add the cluster assignments to the DataFrame as an additional pandas column. We then calculate the means for each cluster and create a bar plot for each feature:

# DATA LOADING SECTION START #

# Use the 2017 data and fill any NaNs
recents = data[data.Year == 2017]
recents = recents.dropna(axis=1, how="all")
recents = recents.fillna(recents.median())

# Use only these specific features
columns = ['Log GDP per capita',
'Social support', 'Healthy life expectancy at birth',
'Freedom to make life choices', 'Generosity',
'Perceptions of corruption&apos...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime