Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Commit 5dffad2

Browse files
committed
update with Matt's suggestions
1 parent e17ff1f commit 5dffad2

2 files changed

Lines changed: 8 additions & 30 deletions

File tree

Chapter 10 - Learning without Supervision.ipynb

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:189f0456c1d26e9ea5feec25463854db938f70123d727c2cc8c73819b6f4cd59"
4+
"signature": "sha256:4a735510c93747b11ebb86855c4f985cce0023c63086b07a69dc1e0d784b3667"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -300,7 +300,7 @@
300300
"source": [
301301
"What does our clustering tell us? We can distinguish two main groups: cluster 8 (consisting of apple$_0$, apple$_1$, apple$_2$ and apple$_5$), and cluster 9 (consisting of apple$_3$ and apple$_4$). These two clusters seem to point out that the quality of the apples is considered on the basis of their firmness and that, apparently, soft apples are considered to be better than hard apples.\n",
302302
"\n",
303-
"Hopefully, you will now have a better feeling of hierarchical clustering and the single linkage method is about. It is about time that we start with our own implementation of the hierarchical clustering algorithm."
303+
"Hopefully, you will now have a better feeling of hierarchical clustering and what the single linkage method is about. It is about time that we start with our own implementation of the hierarchical clustering algorithm."
304304
]
305305
},
306306
{
@@ -496,18 +496,7 @@
496496
],
497497
"language": "python",
498498
"metadata": {},
499-
"outputs": [
500-
{
501-
"output_type": "stream",
502-
"stream": "stdout",
503-
"text": [
504-
"Cluster(3\n",
505-
" Cluster(1)\n",
506-
" Cluster(2))\n"
507-
]
508-
}
509-
],
510-
"prompt_number": 389
499+
"outputs": []
511500
},
512501
{
513502
"cell_type": "markdown",
@@ -579,7 +568,7 @@
579568
"cell_type": "markdown",
580569
"metadata": {},
581570
"source": [
582-
"Now it's time for the most tricky part of our clustering algorithm: computing the linkage function. We have already implemented a function that extracts the two indices corresponding to the two clusters that are closest to each other. But how do we find the indices of two clusters when they have been merged? One way would be to recursively go through the `ClusterTree` and extract the indices from there. There is however another way which makes it possible to use the same `smallest_distance` function at each iteration of the clustering procedure. As we will see this method is particularly benificial because it will allow us to implement a number of different linkage functions in a elegant and simple way.\n",
571+
"Now it's time for the most tricky part of our clustering algorithm: computing the linkage function. We have already implemented a function that extracts the two indices corresponding to the two clusters that are closest to each other. But how do we find the indices of two clusters when they have been merged? One way would be to recursively go through the `ClusterTree` and extract the indices from there. There is however another way which makes it possible to use the same `smallest_distance` function at each iteration of the clustering procedure. As we will see this method is particularly beneficial because it will allow us to implement a number of different linkage functions in a elegant and simple way.\n",
583572
"\n",
584573
"Recall that in the single linkage function \u2013 the distance $D(X,Y)$ between clusters $X$ and $Y$ \u2013 is described by the expression\n",
585574
"\n",

answerbook/Chapter 10 - Learning without Supervision.ipynb

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:189f0456c1d26e9ea5feec25463854db938f70123d727c2cc8c73819b6f4cd59"
4+
"signature": "sha256:4a735510c93747b11ebb86855c4f985cce0023c63086b07a69dc1e0d784b3667"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -300,7 +300,7 @@
300300
"source": [
301301
"What does our clustering tell us? We can distinguish two main groups: cluster 8 (consisting of apple$_0$, apple$_1$, apple$_2$ and apple$_5$), and cluster 9 (consisting of apple$_3$ and apple$_4$). These two clusters seem to point out that the quality of the apples is considered on the basis of their firmness and that, apparently, soft apples are considered to be better than hard apples.\n",
302302
"\n",
303-
"Hopefully, you will now have a better feeling of hierarchical clustering and the single linkage method is about. It is about time that we start with our own implementation of the hierarchical clustering algorithm."
303+
"Hopefully, you will now have a better feeling of hierarchical clustering and what the single linkage method is about. It is about time that we start with our own implementation of the hierarchical clustering algorithm."
304304
]
305305
},
306306
{
@@ -496,18 +496,7 @@
496496
],
497497
"language": "python",
498498
"metadata": {},
499-
"outputs": [
500-
{
501-
"output_type": "stream",
502-
"stream": "stdout",
503-
"text": [
504-
"Cluster(3\n",
505-
" Cluster(1)\n",
506-
" Cluster(2))\n"
507-
]
508-
}
509-
],
510-
"prompt_number": 389
499+
"outputs": []
511500
},
512501
{
513502
"cell_type": "markdown",
@@ -579,7 +568,7 @@
579568
"cell_type": "markdown",
580569
"metadata": {},
581570
"source": [
582-
"Now it's time for the most tricky part of our clustering algorithm: computing the linkage function. We have already implemented a function that extracts the two indices corresponding to the two clusters that are closest to each other. But how do we find the indices of two clusters when they have been merged? One way would be to recursively go through the `ClusterTree` and extract the indices from there. There is however another way which makes it possible to use the same `smallest_distance` function at each iteration of the clustering procedure. As we will see this method is particularly benificial because it will allow us to implement a number of different linkage functions in a elegant and simple way.\n",
571+
"Now it's time for the most tricky part of our clustering algorithm: computing the linkage function. We have already implemented a function that extracts the two indices corresponding to the two clusters that are closest to each other. But how do we find the indices of two clusters when they have been merged? One way would be to recursively go through the `ClusterTree` and extract the indices from there. There is however another way which makes it possible to use the same `smallest_distance` function at each iteration of the clustering procedure. As we will see this method is particularly beneficial because it will allow us to implement a number of different linkage functions in a elegant and simple way.\n",
583572
"\n",
584573
"Recall that in the single linkage function \u2013 the distance $D(X,Y)$ between clusters $X$ and $Y$ \u2013 is described by the expression\n",
585574
"\n",

0 commit comments

Comments
 (0)