Let's think about it this way for a second
The Linear Regression formula is `y = m*x + b` (familiar from school algebra) — `m` (the coefficient/slope) shows how much 'weight' each feature carries, and `b` (the intercept) shows the baseline value when all features are 0. Multiple Linear Regression handles more than one feature (`y = m1*x1 + m2*x2 + ... + b`) — you'd use this concept if you wanted to predict house price not just from 'size' alone, but from multiple features like 'size + location + age'.
Let's connect it to a real scenario
Printing `model.coef_` shows you the coefficient for each feature — a positive coefficient means the target goes up as the feature goes up (positive correlation), and a negative one means the target goes down as the feature goes up (negative correlation) — if the 'size' coefficient is bigger than the 'age' coefficient, you can infer that size affects price more.
Let's look at it together
from sklearn.linear_model import LinearRegression
# Multiple features: size, age, distance to city center
X = df[['size', 'age', 'distance']]
y = df['price']
model = LinearRegression()
model.fit(X, y)
print(f"Coefficients: {model.coef_}")
print(f"Intercept: {model.intercept_}")
# e.g. Coefficients: [1200, -800, -3000]
# size: +1200 per unit, age: -800 per year, distance: -3000 per kmCoefficients: [1200.5 -800.2 -3000.1]
Intercept: 50000.05-minute try-it
Train a Multiple Linear Regression model on a sample dataset with multiple features (size, age, distance), print `model.coef_`, and write down the direction (positive/negative) for each feature.
A quick word of caution
If multicollinearity is present (two features are highly correlated with each other, e.g. 'size in sqft' and 'size in sqm'), you can't reliably interpret the coefficients — you should remove the redundant feature.