Baby Steps Towards Data Science: Multiple Linear Regression in Python

What is Multiple Linear Regression?

Let me get right into the subject. The picture you see above is the mathematical representation of Multiple Linear Regression. All the necessary explanation is given in the image.

As the name suggests MLR (Multiple Linear Regression) is linear combination of multiple features/variables that define the average behavior of the dependent variable.

Consider x1,x2,…xp as the independent variables and Y is the dependent variable. All the beta values correspond to the coefficients for respective independent variables. Beta0 on the other hand is the intercept values which is similar to Simple Linear Regression.

What’s the error term ?

It is an error that is there in the nature. Remember in my previous article I specified one can never predict the exact future value ? that is due to the fact that this error is present. Error consists of all the data that is not recorded/ used in our model. Such as emotions, feelings etc that can not be easily quantifiable or simply the lack of data/human errors in recording the data.

But don’t worry about it. Once we use this regression method we only get the average behavior of the Y variable. This average behavior when compared to the actual data, might be greater than, less than or equal to the original predictions of Y. Since we deal with only the average of Y the error terms cancel out each other and we have an estimated regression function in the end with no error term.

How to decrease error ? Simple, invest more money and find more data.


Let us consider a firm’s profit as the dependent variable (Y) and it’s spending in RnD (x1), Advertising (x2) and Marketing (x3) be our independent variables.Let’s say after doing all the math we come up with the below regression equation or function [the other name for the mathematical representation of any regression]. Please bear in mind that the below function is hypothetical.

Profit = 10000 + 5(RnD) - 2(Advertising) + 1(Marketing)


  1. If the firm doesn’t invest in RnD, Advertising and Marketing, then their average profit would be $10,000
  2. If the firm increases RnD spends by $100K, the average profit increases by $500K/5 units[Here the units of the variables is very important. Based on the units you can rightly make the interpretations [All variables are in the units of $100k], this makes sense because, more investment in RnD better products come into the market, thus better sales.
  3. If the firm increases Advertising spending by $100k, then the average profit decreases by $200K/2 units. More expenditure on advertisements might decrease the overall profits.
  4. If the firm increases Marketing spending by $100k, then the average profit increases by $100K/1 unit. More expenditure on marketing might increase its popularity and thus the profits.

How are these estimates calculated ?

There is a mathematical method called OLS (Ordinary Least Squares) method. Using certain matrix transformations you can find the estimated coefficient values. Explaining OLS is not in the scope of this article. You can easily find tutorials online regarding the same, kindly go through them if you really want to know how it works. However, modern programming languages will help you in computing those estimates for you.

Implementation in Python

Let us deep dive into python and build a MLR model and try to predict the points scored by basketball players.

#regression-analysis #machine-learning #multiple-linearregression #analysis #data-science #data analysis

What is GEEK

Buddha Community

Baby Steps Towards Data Science: Multiple Linear Regression in Python
akshay L

akshay L


Data Science With Python Training | Python Data Science Course | Intellipaat

In this Data Science With Python Training video, you will learn everything about data science and python from basic to advance level. This python data science course video will help you learn various python concepts, AI, and lots of projects, hands-on demo, and lastly top trending data science and python interview questions. This is a must-watch video for everyone who wishes o learn data science and python to make a career in it.

#data science with python #python data science course #python data science #data science with python

Uriah  Dietrich

Uriah Dietrich


How To Build A Data Science Career In 2021

For this week’s data science career interview, we got in touch with Dr Suman Sanyal, Associate Professor of Computer Science and Engineering at NIIT University. In this interview, Dr Sanyal shares his insights on how universities can contribute to this highly promising sector and what aspirants can do to build a successful data science career.

With industry-linkage, technology and research-driven seamless education, NIIT University has been recognised for addressing the growing demand for data science experts worldwide with its industry-ready courses. The university has recently introduced B.Tech in Data Science course, which aims to deploy data sets models to solve real-world problems. The programme provides industry-academic synergy for the students to establish careers in data science, artificial intelligence and machine learning.

“Students with skills that are aligned to new-age technology will be of huge value. The industry today wants young, ambitious students who have the know-how on how to get things done,” Sanyal said.

#careers # #data science aspirant #data science career #data science career intervie #data science education #data science education marke #data science jobs #niit university data science

Data Science with Python Certification Training in Chennai

Learn Best data science with python Course in Chennai by Industry Experts & Rated as and Best data science with python training in Chennai. Call Us Today!

#data science with python training #data science with python courses #data science with python #data science with python course

Manish Sharma


Applied Data Science with Python Certification Training Course -IgmGuru

IgmGuru’s Data Science with Python certification course has been designed after consulting some of the best in the industry and also the faculty who are teaching at some of the best universities. The reason we have done this is because we wanted to embed the topics and techniques which are practiced and are in demand in the industry – conduct them with the help of pedagogy which is followed across universities – kind of applied data science with python. In doing so, we make our learners more industry/job-ready. IgmGuru’s Data Science with Python online training course is the gateway towards your Data Science career.

#applied data science with python #data science with python certification #data science with python online training #data science with python training

 iOS App Dev

iOS App Dev


Your Data Architecture: Simple Best Practices for Your Data Strategy

If you accumulate data on which you base your decision-making as an organization, you should probably think about your data architecture and possible best practices.

If you accumulate data on which you base your decision-making as an organization, you most probably need to think about your data architecture and consider possible best practices. Gaining a competitive edge, remaining customer-centric to the greatest extent possible, and streamlining processes to get on-the-button outcomes can all be traced back to an organization’s capacity to build a future-ready data architecture.

In what follows, we offer a short overview of the overarching capabilities of data architecture. These include user-centricity, elasticity, robustness, and the capacity to ensure the seamless flow of data at all times. Added to these are automation enablement, plus security and data governance considerations. These points from our checklist for what we perceive to be an anticipatory analytics ecosystem.

#big data #data science #big data analytics #data analysis #data architecture #data transformation #data platform #data strategy #cloud data platform #data acquisition