Book Image

Machine Learning Quick Reference

By : Rahul Kumar
Book Image

Machine Learning Quick Reference

By: Rahul Kumar

Overview of this book

Machine learning makes it possible to learn about the unknowns and gain hidden insights into your datasets by mastering many tools and techniques. This book guides you to do just that in a very compact manner. After giving a quick overview of what machine learning is all about, Machine Learning Quick Reference jumps right into its core algorithms and demonstrates how they can be applied to real-world scenarios. From model evaluation to optimizing their performance, this book will introduce you to the best practices in machine learning. Furthermore, you will also look at the more advanced aspects such as training neural networks and work with different kinds of data, such as text, time-series, and sequential data. Advanced methods and techniques such as causal inference, deep Gaussian processes, and more are also covered. By the end of this book, you will be able to train fast, accurate machine learning models at your fingertips, which you can easily use as a point of reference.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Random forest algorithm


The random forest algorithm works with the bagging technique. The number of trees are planted and grown in the following manner:

  • There are observations in the training set. Samples out of N observations are taken at random and with replacement. These samples will act as a training set for different trees.
  • If there are M input features (variables), m features are drawn as a subset out of M and of course m < M. What this does is select m features at random at each node of the tree.
  • Every tree is grown to the largest extent possible.

 

  • Prediction takes place based on the aggregation of the results coming out of all the trees. In the case of classification, the method of aggregation is voting, whereas it is an average of all the results in the case of regression:

Let's work on a case study, since that will help us understand this concept more in detail. Let's work on breast cancer data.

 

 

Case study

The data that is given in this case study is about patients who were detected...