Beispiel #1
0
def max_average_ball2():
    sample_number, k, r = 2 ** 10, 2, 4
    data_2d = np.random.randint(0, 500, (sample_number, 2))
    artificial_cluster_size = 2 ** 6
    artificial_cluster = np.random.randint(100, 130, (artificial_cluster_size, 2))
    data_2d = np.vstack((data_2d, artificial_cluster))
    sample_number += artificial_cluster_size
    mat = __distances__(data_2d)
    t = 50
    # closest = np.sum(mat, axis=1).argsort()[t:]
    return __max_average_ball__(r, mat, t)
Beispiel #2
0
def max_average_ball2():
    sample_number, k, r = 2**10, 2, 4
    data_2d = np.random.randint(0, 500, (sample_number, 2))
    artificial_cluster_size = 2**6
    artificial_cluster = np.random.randint(100, 130,
                                           (artificial_cluster_size, 2))
    data_2d = np.vstack((data_2d, artificial_cluster))
    sample_number += artificial_cluster_size
    mat = __distances__(data_2d)
    t = 50
    # closest = np.sum(mat, axis=1).argsort()[t:]
    return __max_average_ball__(r, mat, t)
Beispiel #3
0
def distances():
    data = np.random.normal(0, 5, (10, 2))
    mat = __distances__(data)
    plt.scatter(*zip(*data))
    return mat
Beispiel #4
0
def distances():
    data = np.random.normal(0, 5, (10, 2))
    mat = __distances__(data)
    plt.scatter(*zip(*data))
    return mat