ageron / ageron/handson-ml2

Chapter 2. Got different results for linear regression using windows and ubuntu

Open
#227 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
30k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

I noticed this problem when I try to run the jupyter notebook code on my windows computer and ubuntu computer.

The result for RandomForest seems exactly same. However, the linear regression in cell 83 gives the predictions, which are different on two computers, where the ubuntu result is same as the downloaded jupyter notebook shows, while the windows result is different.

So then I double checked the data, it seems exactly same. Then I compared the coefficients by outputting

lin_reg.coef_

The windows result is
array([-5.56504116e+04, -5.67324623e+04, 1.38190749e+04, -2.00154656e+03,
7.48547532e+03, -4.56915062e+04, 4.53960963e+04, 7.48198373e+04,
6.60940148e+03, 1.03259856e+03, 9.25735792e+03, -1.61550167e+17,
-1.61550167e+17, -1.61550167e+17, -1.61550167e+17, -1.61550167e+17])

Apparently, there's some overflow in windows scikit-learn run.

Would you mind pointing out how to fix it on windows?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.