Changeset 7648:a3c43789905d in orange
 Timestamp:
 02/11/11 11:38:32 (3 years ago)
 Branch:
 default
 Convert:
 56c9df821126321da151877ee20ce7a1e8b07018
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

orange/Orange/clustering/kmeans.py
r7535 r7648 226 226 227 227 if index == None: 228 return avg([score_fast silhouette(km, i) for i in range(len(km.data))])228 return avg([score_fast_silhouette(km, i) for i in range(len(km.data))]) 229 229 cind = km.clusters[index] 230 230 a = km.distance(km.data[index], km.centroids[km.clusters[index]]) … … 266 266 267 267 def plot_silhouette(km, filename='tmp.png', fast=False): 268 """ Saves a silhuette plot to filename, showing the distributions of silhouette scores in clusters. kmeans is a kmeans clustering object. If fast is True use score_fast silhouette to compute scores instead of score_silhouette.268 """ Saves a silhuette plot to filename, showing the distributions of silhouette scores in clusters. kmeans is a kmeans clustering object. If fast is True use score_fast_silhouette to compute scores instead of score_silhouette. 269 269 270 270 :param km: a kmeans clustering object. … … 272 272 :param filename: name of output plot. 273 273 :type filename: string 274 :param fast: if True use :func:`score_fast silhouette` to compute scores instead of :func:`score_silhouette`274 :param fast: if True use :func:`score_fast_silhouette` to compute scores instead of :func:`score_silhouette` 275 275 :type fast: boolean. 276 276 … … 278 278 import matplotlib.pyplot as plt 279 279 plt.figure() 280 scoring = score_fast silhouette if fast else score_silhouette280 scoring = score_fast_silhouette if fast else score_silhouette 281 281 scores = [[] for i in range(km.k)] 282 282 for i, c in enumerate(km.clusters):
Note: See TracChangeset
for help on using the changeset viewer.