I am new to ML. I am trying to implement k-means which uses a BIC function that takes cluster and data points as arguments and returns BIC value. I need a function to find best k value that is maximise the BIC. Can anyone provide a code snippet for BIC function in python. I searched everywhere I couldn't find exact what I needed