Mercurial Hosting > traffic-intelligence
changeset 1025:6ba30b259525
minor
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 11 Jun 2018 17:07:53 -0400 |
parents | acb4f6f6545d |
children | 73b124160911 |
files | python/ml.py |
diffstat | 1 files changed, 0 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/python/ml.py Sun Jun 10 23:26:14 2018 -0400 +++ b/python/ml.py Mon Jun 11 17:07:53 2018 -0400 @@ -150,12 +150,6 @@ code,distance = vq(features,centroids) # code starting from 0 (represent first cluster) to k-1 (last cluster) return code,sigma -class Cluster: - 'Represents a cluster, with a prototype id and the list of instances in cluster' - def __init__(prototypeId, memberIndices = []): - self.prototypeId = prototypeId - self.memberIndices = memberIndices - def assignToPrototypeClusters(instances, prototypeIndices, similarities, minSimilarity, similarityFunc = None, minClusterSize = 0): '''Assigns instances to prototypes if minClusterSize is not 0, the clusters will be refined by removing iteratively the smallest clusters