Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Feature Engineering Made Easy

You're reading from   Feature Engineering Made Easy Identify unique features from your dataset in order to build powerful machine learning systems

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781787287600
Length 316 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Divya Susarla Divya Susarla
Author Profile Icon Divya Susarla
Divya Susarla
Sinan Ozdemir Sinan Ozdemir
Author Profile Icon Sinan Ozdemir
Sinan Ozdemir
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Introduction to Feature Engineering 2. Feature Understanding – What's in My Dataset? FREE CHAPTER 3. Feature Improvement - Cleaning Datasets 4. Feature Construction 5. Feature Selection 6. Feature Transformations 7. Feature Learning 8. Case Studies 9. Other Books You May Enjoy

Extracting RBM components from MNIST


Let's now create our first RBM in scikit-learn. We will start by instantiating a module to extract 100 components from our MNIST dataset.

We will also set the verbose parameter to True to allow us visibility into the training process as well as the random_state parameter to 0. The random_state parameter is an integer that allows for reproducibility in code. It fixes the random number generator and sets the weights and biases randomly at the same time, every time. We finally let n_iter be 20. This is the number of iterations we wish to do, or back and forth passes of the network:

# instantiate our BernoulliRBM
 # we set a random_state to initialize our weights and biases to the same starting point
 # verbose is set to True to see the fitting period
 # n_iter is the number of back and forth passes
 # n_components (like PCA and LDA) represent the number of features to create
 # n_components can be any integer, less than , equal to, or greater than the original...
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 $19.99/month. Cancel anytime