First time here? Checkout the FAQ!
x
+2 votes
409 views
asked in Machine Learning Interview Questions by (1.1k points)  
  

1 Answer

0 votes
answered by (200 points)  

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
commented by (116k points)  
Is not this rule be of thumb for k-NN?!
...