Book Image

Machine Learning with scikit-learn Quick Start Guide

By : Kevin Jolly
Book Image

Machine Learning with scikit-learn Quick Start Guide

By: Kevin Jolly

Overview of this book

Scikit-learn is a robust machine learning library for the Python programming language. It provides a set of supervised and unsupervised learning algorithms. This book is the easiest way to learn how to deploy, optimize, and evaluate all of the important machine learning algorithms that scikit-learn provides. This book teaches you how to use scikit-learn for machine learning. You will start by setting up and configuring your machine learning environment with scikit-learn. To put scikit-learn to use, you will learn how to implement various supervised and unsupervised machine learning models. You will learn classification, regression, and clustering techniques to work with different types of datasets and train your models. Finally, you will learn about an effective pipeline to help you build a machine learning project from scratch. By the end of this book, you will be confident in building your own machine learning models for accurate predictions.
Table of Contents (10 chapters)

The inner mechanics of the linear regression algorithm

In its most fundamental form, the expression for the linear regression algorithm can be written as follows:

In the preceding equation, the output of the model is a numeric outcome. In order to obtain this numeric outcome, we require that each input feature be multiplied with a parameter called Parameter1, and we add the second parameter, Parameter2, to this result.

So, in other words, our task is to find the values of the two parameters that can predict the value of the numeric outcome as accurately as possible. In visual terms, consider the following diagram:

Two-dimensional plot between the target and input feature

The preceding diagram shows a two-dimensional plot between the target that we want to predict on the y axis (numeric output) and the input feature, which is along the x axis. The goal of linear regression is...