Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Applied Artificial Intelligence Workshop

You're reading from   The Applied Artificial Intelligence Workshop Start working with AI today, to build games, design decision trees, and train your own machine learning models

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781800205819
Length 420 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Anthony So Anthony So
Author Profile Icon Anthony So
Anthony So
Zsolt Nagy Zsolt Nagy
Author Profile Icon Zsolt Nagy
Zsolt Nagy
William So William So
Author Profile Icon William So
William So
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface
1. Introduction to Artificial Intelligence 2. An Introduction to Regression FREE CHAPTER 3. An Introduction to Classification 4. An Introduction to Decision Trees 5. Artificial Intelligence: Clustering 6. Neural Networks and Deep Learning Appendix

Linear Regression with Multiple Variables

In the previous section, we dealt with linear regression with one variable. Now we will learn an extended version of linear regression, where we will use multiple input variables to predict the output.

Multiple Linear Regression

If you recall the formula for the line of best fit in linear regression, it was defined as 20, where 21 is the slope of the line, 22 is the y intercept of the line, x is the feature value, and y is the calculated label value.

In multiple regression, we have multiple features and one label. If we have three features, x1, x2, and x3, our model changes to 23.

In NumPy array format, we can write this equation as follows:

y = np.dot(np.array([a1, a2, a3]), np.array([x1, x2, x3])) + b

For convenience, it makes sense to define the whole equation in a vector multiplication format. The coefficient of 24 is going to be 1:

y = np.dot(np.array([b, a1, a2, a3]) * np.array([1, x1, x2, x3]))

Multiple linear regression...

You have been reading a chapter from
The Applied Artificial Intelligence Workshop
Published in: Jul 2020
Publisher: Packt
ISBN-13: 9781800205819
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime