11Class {
2- #name : # PMClusterFinderTest ,
3- #superclass : # TestCase ,
2+ #name : ' PMClusterFinderTest' ,
3+ #superclass : ' TestCase' ,
44 #instVars : [
55 ' dataServer' ,
66 ' randomNumberGenerator'
77 ],
8- #category : #' Math-Tests-Clustering'
8+ #category : ' Math-Tests-Clustering' ,
9+ #package : ' Math-Tests-Clustering'
910}
1011
11- { #category : # utilities }
12+ { #category : ' utilities' }
1213PMClusterFinderTest >> accumulateAround: aVector size: aNumber into: aCollection [
1314 " Private - Generate a random point around the given center and insert it into the collection.
1415 aNumber is the sigma for the distance to the center"
@@ -28,7 +29,7 @@ PMClusterFinderTest >> accumulateAround: aVector size: aNumber into: aCollection
2829 aCollection add: (localVector + aVector)
2930]
3031
31- { #category : # utilities }
32+ { #category : ' utilities' }
3233PMClusterFinderTest >> generatedPoints: anInteger [
3334 " Private - Generate random points into aCollection. 3 clusters are used"
3435 | centers results randomNumber |
@@ -47,16 +48,16 @@ PMClusterFinderTest >> generatedPoints: anInteger [
4748 ^ results
4849]
4950
50- { #category : # running }
51+ { #category : ' running' }
5152PMClusterFinderTest >> setUp [
5253 super setUp.
53- randomNumberGenerator := Random seed: 3 .
54+ randomNumberGenerator := Random seed: 29 .
5455
5556 dataServer := PMMemoryBasedDataServer new .
5657 dataServer data: (self generatedPoints: 1000 )
5758]
5859
59- { #category : # tests }
60+ { #category : ' tests' }
6061PMClusterFinderTest >> testClusterCovariance [
6162
6263 | clusters finder |
@@ -66,7 +67,7 @@ PMClusterFinderTest >> testClusterCovariance [
6667 self assert: clusters size equals: 3
6768]
6869
69- { #category : # tests }
70+ { #category : ' tests' }
7071PMClusterFinderTest >> testClusterEuclidean [
7172
7273 | clusters finder |
@@ -76,7 +77,7 @@ PMClusterFinderTest >> testClusterEuclidean [
7677 self assert: clusters size equals: 3
7778]
7879
79- { #category : # tests }
80+ { #category : ' tests' }
8081PMClusterFinderTest >> testMahalanobisCenter [
8182 " Code example 12.5"
8283
0 commit comments