908 views

1 Answer

0 0 votes

My Answer

def select_k(n):
    k = int(math.sqrt(n))
    # if k is an even number subtract 1
    if k % 2 == 0:
        return k-1
    else:
        return k

Related questions

1 1 vote
1 1 answer
1.1k
1.1k views
Neo asked Oct 19, 2018
1,093 views
how to choose the number of clusters based on intertia and based on silhouette using K-means
1 1 vote
1 1 answer
919
919 views
DavidS asked Oct 17, 2018
919 views
PCAhttps://www.youtube.com/watch?v=FgakZw6K1QQK-Meanshttps://www.youtube.com/watch?v=4b5d3muPQmA&index=10&list=PLblh5JKOoLUICTaGLRoHQDuF_7q2GfuJF&t=0s
3 3 votes
0 0 answers
534
534 views
2 2 votes
1 answers 1 answer
20.9k
20.9k views
tofighi asked Jun 26, 2019
20,915 views
Use the k-means algorithm and Euclidean distance to cluster the following 8 examples into 3 clusters:$A1=(2,10), A2=(2,5), A3=(8,4), A4=(5,8), A5=(7,5), A6=(6,4), A7=(1,2...