From d2da0fc208a5fac08ee447a0514dc57ee2de69f5 Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Sun, 25 Oct 2026 13:42:12 +0000 Subject: [PATCH] Load East Timor data through pods instead of a dead staffwww URL. Lecture 07 smoke was failing because the notebook still fetched EastTimor.pickle from Sheffield staffwww (403). pods 0.1.19 now serves this dataset from the mirror. --- _lectures/07-non-gaussian-likelihoods.html | 22 +++++--------------- _notebooks/07-non-gaussian-likelihoods.ipynb | 22 +++++--------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/_lectures/07-non-gaussian-likelihoods.html b/_lectures/07-non-gaussian-likelihoods.html index e4391f0..d951313 100644 --- a/_lectures/07-non-gaussian-likelihoods.html +++ b/_lectures/07-non-gaussian-likelihoods.html @@ -71,23 +71,11 @@

Non Gaussian Likelihoods

[Gaussian processes model functions. If our observation is a corrupted version of this function and the corruption process is also Gaussian, it is trivial to account for this. However, there are many circumstances where our observation may be non Gaussian. In these cases we need to turn to approximate inference techniques. As a simple illustration, we’ll use a dataset of binary observations of the language that is spoken in different regions of East-Timor. First we will load the data and a couple of libraries to visualize it.}

from matplotlib.patches import Polygon
 from matplotlib.collections import PatchCollection
-from pathlib import Path
-import pickle
-import urllib.request
-
# Load East Timor language regions (local copy preferred; remote host is unreliable)
-data_path = Path('data/EastTimor2.pickle')
-if not data_path.exists():
-    data_path = Path('EastTimor2.pickle')
-if not data_path.exists():
-    url = 'http://staffwww.dcs.shef.ac.uk/people/M.Zwiessele/gpss/lab2/EastTimor.pickle'
-    urllib.request.urlretrieve(url, 'EastTimor2.pickle')
-    data_path = Path('EastTimor2.pickle')
-
-with open(data_path, 'rb') as f:
-    try:
-        X, y, polygons = pickle.load(f, encoding='latin1')
-    except TypeError:
-        X, y, polygons = pickle.load(f)
+import pods +
data = pods.datasets.east_timor()
+X = data['X']
+y = data['Y']
+polygons = data['polygons']

Now we will create a map of East Timor and, using GPy, plot the data on top of it. A classification model can be defined in a similar way to the regression model, but now using GPy.models.GPClassification. However, once we’ve define the model, we also need to update the approximation to the likelihood. This runs the Expectation propagation updates.

import GPy
#Define the model
diff --git a/_notebooks/07-non-gaussian-likelihoods.ipynb b/_notebooks/07-non-gaussian-likelihoods.ipynb
index a2419e8..5111e92 100644
--- a/_notebooks/07-non-gaussian-likelihoods.ipynb
+++ b/_notebooks/07-non-gaussian-likelihoods.ipynb
@@ -278,9 +278,7 @@
    "source": [
     "from matplotlib.patches import Polygon\n",
     "from matplotlib.collections import PatchCollection\n",
-    "from pathlib import Path\n",
-    "import pickle\n",
-    "import urllib.request"
+    "import pods"
    ],
    "id": "bf80c131-13db-46da-b32a-977525075286"
   },
@@ -290,20 +288,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "# Load East Timor language regions (local copy preferred; remote host is unreliable)\n",
-    "data_path = Path('data/EastTimor2.pickle')\n",
-    "if not data_path.exists():\n",
-    "    data_path = Path('EastTimor2.pickle')\n",
-    "if not data_path.exists():\n",
-    "    url = 'http://staffwww.dcs.shef.ac.uk/people/M.Zwiessele/gpss/lab2/EastTimor.pickle'\n",
-    "    urllib.request.urlretrieve(url, 'EastTimor2.pickle')\n",
-    "    data_path = Path('EastTimor2.pickle')\n",
-    "\n",
-    "with open(data_path, 'rb') as f:\n",
-    "    try:\n",
-    "        X, y, polygons = pickle.load(f, encoding='latin1')\n",
-    "    except TypeError:\n",
-    "        X, y, polygons = pickle.load(f)"
+    "data = pods.datasets.east_timor()\n",
+    "X = data['X']\n",
+    "y = data['Y']\n",
+    "polygons = data['polygons']"
    ],
    "id": "03afdd84-a321-4c43-8ad7-f8a49c474a3b"
   },