Changeset 9724:318e91106d47 in orange for Orange/clustering/kmeans.py
 Timestamp:
 02/06/12 13:52:55 (2 years ago)
 Branch:
 default
 Children:
 9725:6c16952df555, 9752:cbd6f6f10f06
 rebase_source:
 be8730bf9f2e7e771332dfc8b3876c8a62826bd1
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/clustering/kmeans.py
r9671 r9724 294 294 :param k: the number of clusters. 295 295 :type k: integer 296 :param distfun: a distance function. 297 :type distfun: :class:`orange.ExamplesDistance` 298 """ 296 """ 299 297 return data.getitems(random.sample(range(len(data)), k)) 300 298 … … 307 305 :type k: integer 308 306 :param distfun: a distance function. 309 :type distfun: :class:` orange.ExamplesDistance`307 :type distfun: :class:`Orange.distance.Distance` 310 308 """ 311 309 center = data_center(data) … … 338 336 :type k: integer 339 337 :param distfun: a distance function. 340 :type distfun: :class:` orange.ExamplesDistance`338 :type distfun: :class:`Orange.distance.Distance` 341 339 """ 342 340 sample = orange.ExampleTable(random.sample(data, min(self.n, len(data)))) … … 393 391 def __init__(self, data=None, centroids=3, maxiters=None, minscorechange=None, 394 392 stopchanges=0, nstart=1, initialization=init_random, 395 distance= orange.ExamplesDistanceConstructor_Euclidean,393 distance=Orange.distance.Euclidean, 396 394 scoring=score_distance_to_centroids, inner_callback = None, 397 395 outer_callback = None): … … 404 402 :type nstart: integer 405 403 :param distance: an example distance constructor, which measures the distance between two instances. 406 :type distance: :class:` orange.ExamplesDistanceConstructor`404 :type distance: :class:`Orange.distance.DistanceConstructor` 407 405 :param initialization: a function to select centroids given data instances, k and a example distance function. This module implements different approaches (:func:`init_random`, :func:`init_diversity`, :class:`init_hclustering`). 408 406 :param scoring: a function that takes clustering object and returns the clustering score. It could be used, for instance, in procedure that repeats the clustering nstart times, returning the clustering with the lowest score.
Note: See TracChangeset
for help on using the changeset viewer.