BASC0005 Quantitative Methods 2: Data Science and Visualisation


A decision tree is a non-parametric supervised learning algorithm, which is utilized for both classification and regression tasks. It has a hierarchical, tree structure, which consists of a root node, branches, internal nodes and leaf nodes.
The random forest algorithm is made up of a collection of decision trees, and each tree in the ensemble is comprised of a data sample drawn from a training set with replacement, called the bootstrap sample.


Lets evaluate the Random Forest Models we trained earlier using these metrics

Even with a relatively small dataset and a handful of variables, we’ve ended up with quite a complex model
Goal: make each cluster as tight as possible (minimise the total squared distance from each point to its centroid)

The algorithm outputs numbers 0–4. The names are ours: an interpretation of these profiles, not a fact about the data
32 boroughs, same 7 features. The height of each join shows how different the merged groups are. The dotted line cuts the tree into 3 clusters




| K-means | Hierarchical | DBSCAN | |
|---|---|---|---|
| Choose k in advance? | Yes | No (cut the tree) | No (choose ε and min points) |
| Cluster shapes | Round, similar size | Depends on linkage | Any shape |
| Handles noise? | No: every point assigned | No | Yes: labels outliers |
| Speed on big data | Fast | Slow | Fast with spatial indexing |
| Good for | Segmenting areas or customers | Small data; seeing structure | Spatial points; finding hotspots |
o.ballinger@ucl.ac.uk
BASC0005 Quantitative Methods 2