Scikit Regression comparison of train vs normalized X

Hi
Why do we see difference in output of sgdr class and more iterations with X_Norm as compared to X_train?

Code from Lab:
sgdr = SGDRegressor()
sgdr.fit(X_train, Y_train )
print ( sgdr)
print(f"number of iterations completed: {sgdr.n_iter_}, number of weight updates: {sgdr.t_}")

SGDRegressor(alpha=0.0001, average=False, early_stopping=False, epsilon=0.1,
eta0=0.01, fit_intercept=True, l1_ratio=0.15,
learning_rate=‘invscaling’, loss=‘squared_loss’, max_iter=1000,
n_iter_no_change=5, penalty=‘l2’, power_t=0.25, random_state=None,
shuffle=True, tol=0.001, validation_fraction=0.1, verbose=0,
warm_start=False)
number of iterations completed: 146, number of weight updates: 14455.0

===========

Code modified to pass X_train instead of X_norm to sgdr:

sgdr = SGDRegressor()
sgdr.fit(X_train, Y_train )
print(f"number of iterations completed: {sgdr.n_iter_}, number of weight updates: {sgdr.t_}")
print ( sgdr)

number of iterations completed: 42, number of weight updates: 4159
SGDRegressor()

You can get a better fit by using normalized features. You can also use a larger learning rate, so direct comparisons can be difficult.

Do you have some metrics for the performance of both models?

Yes, you could try passing X_train to the sgdr.fir ( Line 7 ) of the pbook below…

sgdr = SGDRegressor()
sgdr.fit(X_Norm, Y_train )
print(f"number of iterations completed: {sgdr.n_iter_}, number of weight updates: {sgdr.t_}")
print ( sgdr)

Optional lab: Linear regression with scikit-learn | Coursera