Ejemplo n.º 1
0
    def random(self, vectors):
        weights = np.zeros([4, 80])
        for i in range(80):
            row = np.array([random_normal_01() for _ in range(4)])
            weights[0][i], weights[1][i], weights[2][i], weights[3][i] = row / sum(row)

        centers = np.array([(np.random.rand(2) * 180 - 90) * random_normal_01() for _ in range(4)])
        
        return MultiFuzzyClustering(weights, centers, vectors)
Ejemplo n.º 2
0
 def random(self, vectors):
     clusters = np.array([random.choice([0, 1, 2, 3]) for _ in range(80)])
     centers = np.array([
         (np.random.rand(2) * 180 - 90) * random_normal_01()
         for _ in range(4)
     ])
     return Clustering(clusters, centers, vectors)
    def random(self, vectors, neighbors):
        weights = np.zeros([4, 80])
        for i in range(80):
            row = np.array([random_normal_01() for _ in range(4)])
            weights[0][i], weights[1][i], weights[2][i], weights[3][
                i] = row / sum(row)

        return FuzzyClusteringNeighbors(weights, vectors, neighbors)