I'm working through some examples of Linear Regression under different scenarios, comparing the results from using Normalizer and StandardScaler, and the results are puzzling.

I'm using the Boston housing dataset, and prepping it this way:

import numpy as np

import pandas as pd

from sklearn.datasets import load_boston

from sklearn.preprocessing import Normalizer

from sklearn.preprocessing import StandardScaler

from sklearn.linear_model import LinearRegression

#load the data

df = pd.DataFrame(boston.data)

df.columns = boston.feature_names

df['PRICE'] = boston.target

I'm currently trying to reason about the results I get from the following scenarios:

- Initializing Linear Regression with the parameter normalize=True vs using Normalizer
- Initializing Linear Regression with the parameter fit_intercept = False with and without standardization.

Collectively, I find the results confusing.

Here's how I'm setting everything up:

# Prep the data

X = df.iloc[:, :-1]

y = df.iloc[:, -1:]

normal_X = Normalizer().fit_transform(X)

scaled_X = StandardScaler().fit_transform(X)

#now prepare some of the models

reg1 = LinearRegression().fit(X, y)

reg2 = LinearRegression(normalize=True).fit(X, y)

reg3 = LinearRegression().fit(normal_X, y)

reg4 = LinearRegression().fit(scaled_X, y)

reg5 = LinearRegression(fit_intercept=False).fit(scaled_X, y)

I have some questions that I can't reconcile:

- Why is there absolutely no difference between the first two models? It appears that setting normalize=False does nothing. I can understand having predictions and R^2 values that are the same, but my features have different numerical scales, so I'm not sure why normalizing would have no effect at all. This is doubly confusing when you consider that using StandardScaler changes the coefficients considerably.
- I don't understand why the model using Normalizer causes such radically different coefficient values from the others, especially when the model with LinearRegression(normalize=True) makes no change at all.