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

Kernel PCA


The Kernel PCA is an algorithm that not only keeps the main spirit of PCA as it is, but goes a step further to make use of the kernel trick so that it is operational for non-linear data:

  1. Let's define the covariance matrix of the data in the feature space, which is the product of the mapping function and the transpose of the mapping function:

 

It is similar to the one we used for PCA.

  1. The next step is to solve the following equation so that we can compute principal components:

Here, CF is the covariance matrix of the data in feature space, v is the eigenvector, and λ (lambda) is the eigenvalues.

  1. Let's put the value of step 1 into step 2 – that is, the value of CF in the equation of step 2. The eigenvector will be as follows:

Here, 

 is a scalar number.

 

  1. Now, let's add the kernel function into the equation. Let's multiply Φ(xkon both sides of the formula, 
    :
  1. Let's put the value of v from the equation in step 3 into the equation of step 4, as follows:
  1. Now, we call
    . Upon simplifying the...