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
Ensemble Machine Learning Cookbook

You're reading from  Ensemble Machine Learning Cookbook

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781789136609
Pages 336 pages
Edition 1st Edition
Languages
Authors (2):
Dipayan Sarkar Dipayan Sarkar
Profile icon Dipayan Sarkar
Vijayalakshmi Natarajan Vijayalakshmi Natarajan
Profile icon Vijayalakshmi Natarajan
View More author details
Toc

Table of Contents (14) Chapters close

Preface 1. Get Closer to Your Data 2. Getting Started with Ensemble Machine Learning 3. Resampling Methods 4. Statistical and Machine Learning Algorithms 5. Bag the Models with Bagging 6. When in Doubt, Use Random Forests 7. Boosting Model Performance with Boosting 8. Blend It with Stacking 9. Homogeneous Ensembles Using Keras 10. Heterogeneous Ensemble Classifiers Using H2O 11. Heterogeneous Ensemble for Text Classification Using NLP 12. Homogenous Ensemble for Multiclass Classification Using Keras 13. Other Books You May Enjoy

An ensemble of homogeneous models for energy prediction

In the following example, we will use the Keras API. Keras is an open source high-level framework for building deep neural networks. It's written on top of TensorFlow or Theano and uses them for its calculations behind the scenes. Keras can run on both CPU and GPU. The default settings of Keras are designed to deliver good results in most cases.

The focus of Keras is the idea of a model. Keras supports two types of models. The main type of model is a sequence of layers, called sequential. The other type of model in Keras is the non-sequential model, called model.

To build a sequential model, carry out the following steps:

  1. Instantiate a sequential model using Sequential()
  2. Add layers to it one by one using the Dense class
  3. Compile the model with the following:
    • A mandatory loss function
    • A mandatory optimizer
    • Optional...
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 $15.99/month. Cancel anytime}