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

F-test


The basic steps for running this test are as follows:

  1. Formulate the null hypothesis and its alternative. 
  2. Choose the lags. These can depend on the amount of data you have. One way to choose lags i and j is to run a model order test. It would be easier to pick up multiple values and run the Granger test to see if the results are the similar for different lag levels.
  1. Also identify the f-value. The two equations can be used to find out whether βj = 0 for all lags j.

Limitations

The different limitations of this approach are as follows:

  • Granger causality is not a true causality
  • If X(t) affects Y(t) through a third variable, Z(t), then it is difficult to find Granger causality

Use case

Here, we have a multivariate time series dataset called AirQualityUCI. We have to test whether NOx has a Granger causality of NO2.

Since we don't have a library in Python for multivariate Granger causality, we will do this in R by using the lmtest package.

Load the lmtest library. In case the library isn't there, you...