Skip to content

Commit

Permalink
some minor changes in order to make integration test work
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Mar 13, 2013
1 parent 04e7e66 commit de3862a
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -10,7 +10,6 @@ def run_clustering(data, k):
from shogun.Distance import EuclideanDistance
from shogun.Features import RealFeatures

Math_init_random(42)
fea = RealFeatures(data)
distance = EuclideanDistance(fea, fea)
kmeans=KMeans(k, distance)
Expand All @@ -34,11 +33,12 @@ def assign_labels(data, centroids, ncenters):
knn.train()
return knn.apply(fea)

def evaluation_clustering (n_data=100, sqrt_num_blobs=4, distance=5):
def evaluation_clustering_simple (n_data=100, sqrt_num_blobs=4, distance=5):
from shogun.Evaluation import ClusteringAccuracy, ClusteringMutualInformation
from shogun.Features import MulticlassLabels, GaussianBlobsDataGenerator
from shogun.Mathematics import Math


# reproducable results
Math.init_random(1)

# produce sone Gaussian blobs to cluster
Expand Down Expand Up @@ -80,4 +80,4 @@ def evaluation_clustering (n_data=100, sqrt_num_blobs=4, distance=5):

if __name__ == '__main__':
print('Evaluation Clustering')
evaluation_clustering(*parameter_list[0])
evaluation_clustering_simple(*parameter_list[0])

0 comments on commit de3862a

Please sign in to comment.