@@ -131,6 +131,7 @@ zscore:fxx zscoref:{daxf[%;nsdev;x] demeanf[x]::}
131
131
minmax : fxx minmaxf : {daxf [%;{max [x]-min x};x] daxf [-;min ;x]:: }
132
132
/ convert densities into probabilities
133
133
prb : dax [%;sum ]
134
+ / identify the minimum values with 1b
134
135
ismin : dax [=;min ]
135
136
136
137
/ given (g)rouped dictionary, compute the odds
@@ -299,17 +300,17 @@ cgroup:{[df;X;C]value group imin f2nd[df X] C}
299
300
/ to update the centroid location.
300
301
lloyd : {[df ;cf ;X ;C ]cf X@\: cgroup [df ;X;C]}
301
302
/ use (r)esponsibility (f)unction David Mackay's Information Theory..(pg289)
302
- lloyds : {[df ;cf ;rf ;X ;C ] cf [rf .ml. f2nd [df X] C;X]} /soft assignment
303
+ lloyds : {[df ;cf ;rf ;X ;C ] cf [rf f2nd [df X] C;X]} / soft assignment
303
304
304
305
kmeans : lloyd [edist2 ;avg '' ] / k-means
305
306
kmedians : lloyd [mdist ;med '' ] / k-medians
306
307
khmeans : lloyd [edist2 ;hmean '' ] / k harmonic means
307
308
skmeans : lloyd [cosdist ;normalize (avg '' ):: ] / spherical k-means
308
309
309
- kmeanss : lloyds [edist2 ;wavg \:/: ;ismin ] /k-means using loyd with rf
310
- / kmeansoft v1 David Mackay (b)eta stiffness param
311
- / sigma or radius of cluster is 1%sqrt b
312
- kmeanssmax : {[b ;X ] lloyds [edist2 ;wavg \:/: ;softmax neg [b]*;X]}
310
+ kmeanss : lloyds [edist2 ;wavg \:/: ;ismin ] / k-means using Lloyd with rf
311
+ / v1 David Mackay using stiffness parameter (b)eta. 1%sqrt b represents the
312
+ / sigma ( or radius) of the cluster
313
+ kmeanssmax : {[b ;X ]lloyds [edist2 ;wavg \:/: ;softmax neg [b]*;X]}
313
314
314
315
/ using (d)istance (f)unction, find the medoid in matri(X)
315
316
medoid : {[df ;X ]X@\: imin f2nd [sum df [X]:: ] X}
0 commit comments