Skip to content
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