Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 01_the_machine_learning_landscape.ipynb Fix SSL error #92

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion 01_the_machine_learning_landscape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,23 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import ssl\n",
"from sklearn.linear_model import LinearRegression\n",
"\n",
"# Download and prepare the data\n",
"data_root = \"https://github.com/ageron/data/raw/main/\"\n",
"lifesat = pd.read_csv(data_root + \"lifesat/lifesat.csv\")\n",
"url = data_root + 'lifesat/lifesat.csv'\n",
"\n",
"# Disable verification of SSL certificate\n",
"ssl_context = ssl.create_default_context()\n",
"ssl_context.check_hostname = False\n",
"ssl_context.verify_mode = ssl.CERT_NONE\n",
"\n",
"# Download CSV file\n",
"response = urllib.request.urlopen(url, context=ssl_context)\n",
"\n",
"# Read the CSV data\n",
"lifesat = pd.read_csv(response)\n",
"X = lifesat[[\"GDP per capita (USD)\"]].values\n",
"y = lifesat[[\"Life satisfaction\"]].values\n",
"\n",
Expand Down