コード例 #1
0
def main():
    data = readfile('data.txt')
    plot_data(data)  # show data
    # metoda shlukove hladiny
    logging.info('metoda shlukove hladiny')
    cluster()
    # metoda retezove mapy
    logging.info('metoda retezove mapy')
    chmap()
    # metoda maximin
    logging.info('metoda maximin')
    maximin()
    # nerovnomerne binarni deleni
    logging.info('nerovnomerne binarni deleni')
    unebin()
    # kmeans
    logging.info('kmeans')
    kmeans()
    # bayesuv klasifikator
    logging.info('bayesuv klasifikator')
    bayes()
    # klasifikator podle minimalni vzdalenosti
    logging.info('klasifikator podle minimalni vzdalenosti')
    mindist()
    # klasifikator podle k-nejblizsiho souseda
    logging.info('klasifikator podle k-nejblizsiho souseda')
    nearneigh()
    # klasifikator s linearnimi diskriminacnimi funkcemi
    logging.info('klasifikator s linearnimi diskriminacnimi funkcemi')
    lindisc()
コード例 #2
0
def main():
    data = readfile('data.txt')
    # data = [(-3, 1), (1, 1), (-2, 0), (3, -3), (1, 2), (-2, -1)]
    t0 = dt.datetime.now()
    lvls = cluster_levels(data, 1.9)
    t1 = dt.datetime.now()
    print('cas', t1 - t0)
    print_clusterlvls(lvls)
コード例 #3
0
def main():
    data = readfile('data.txt')
    data = kmeans(data, 3)
    ross = rossenblatt(data)
    plot_kmeans(ross)
    const_incr = constant_increment(data, 0.5)
    plot_kmeans(const_incr)
    mod_const_incr = constant_increment(data, 0.5)
    plot_kmeans(mod_const_incr)
コード例 #4
0
ファイル: unequal_binary.py プロジェクト: mareklovci/zsur
def main():
    # data = [(-3, 0), (3, 2), (-2, 0), (3, 3), (2, 2), (3, -2), (4, -2), (3, -3)]
    data = readfile('data.txt')
    logging.info('k-means')
    means = kmeans(data, 3)
    j_kmeans = sum(criterion(means).values())
    plot_kmeans(means)
    logging.info('Unequal binary')
    dist = unequal_binary(data)
    plot_kmeans(dist)
    j_binary = sum(criterion(dist).values())
    logging.info('J kmeans: {}, J binary: {}'.format(j_kmeans, j_binary))
コード例 #5
0
ファイル: nearest_neighbour.py プロジェクト: mareklovci/zsur
def main():
    data = readfile('data.txt')
    processed_data1 = nearest_neighbour(data, 3)
    processed_data2 = knearest_neighbour(data, 3)
    plot_kmeans(processed_data1)
    plot_kmeans(processed_data2)
コード例 #6
0
def main():
    data = readfile('data.txt')
    baye = bayes(data, 3, step=0.4)
    plot_kmeans(baye)
コード例 #7
0
def main():
    data = readfile('data.txt')
    chmap = chain_map(data, 9)
    plot_chainmap(chmap)
コード例 #8
0
def main():
    data = readfile('data.txt')
    processed_data = minimal_distance(data, 3)
    plot_kmeans(processed_data)
コード例 #9
0
ファイル: cluster_levels.py プロジェクト: mareklovci/zsur
def main():
    data = readfile('data.txt')
    lvls = cluster_levels(data, 1.9)
    logger.info('Aglomerativni metodou byly nalezeny: {} tridy'.format(lvls))
コード例 #10
0
def main():
    data = readfile('data.txt')
    # data = [(2, -3), (3, 3), (2, 2), (-3, 1), (-1, 0), (-3, -2), (1, -2), (3, 2)]
    no_of_clusters = maximin(data, 0.3)
    print('MAXIMIN found {} clusters'.format(no_of_clusters))