Book Image

Designing Machine Learning Systems with Python

By : David Julian
Book Image

Designing Machine Learning Systems with Python

By: David Julian

Overview of this book

Machine learning is one of the fastest growing trends in modern computing. It has applications in a wide range of fields, including economics, the natural sciences, web development, and business modeling. In order to harness the power of these systems, it is essential that the practitioner develops a solid understanding of the underlying design principles. There are many reasons why machine learning models may not give accurate results. By looking at these systems from a design perspective, we gain a deeper understanding of the underlying algorithms and the optimisational methods that are available. This book will give you a solid foundation in the machine learning design process, and enable you to build customised machine learning models to solve unique problems. You may already know about, or have worked with, some of the off-the-shelf machine learning models for solving common problems such as spam detection or movie classification, but to begin solving more complex problems, it is important to adapt these models to your own specific needs. This book will give you this understanding and more.
Table of Contents (16 chapters)
Designing Machine Learning Systems with Python
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Free Chapter
1
Thinking in Machine Learning
Index

Introducing least squares


In a simple one-feature model, our hypothesis function is as follows:

If we graph this, we can see that it is a straight line crossing the y axis at w0 and having a slope of w1. The aim of a linear model is to find the parameter values that will create a straight line that most closely matches the data. We call these the functions parameter values. We define an objective function, Jw, which we want to minimize:

Here, m is the number of training samples, hw(x(i)) is the estimated value of the ith training sample, and yi is its actual value. This is the cost function of h, because it measures the cost of the error; the greater the error, the higher the cost. This method of deriving the cost function is sometime referred to as the sum of the squared error because it sums up the difference between the predicted value and the actual value. This sum is halved as a convenience, as we will see. There are actually two ways that we can solve this. We can either use an iterative...