Linear regression basics
📖 Scenario: You are a data analyst at a small company. You want to understand how advertising spending affects sales. You have data for advertising spending and sales for 5 months.
🎯 Goal: Build a simple linear regression model to find the relationship between advertising spending and sales.
📋 What You'll Learn
Create a dictionary with advertising spending and sales data
Create a variable for the number of data points
Calculate the slope and intercept of the best fit line using the linear regression formula
Print the slope and intercept values
💡 Why This Matters
🌍 Real World
Linear regression is used in business to predict sales based on advertising budgets, helping companies plan their spending.
💼 Career
Data analysts and data scientists use linear regression to find relationships between variables and make predictions.
Progress0 / 4 steps