import timeit
import numpy as np
from sklearn.cluster import KMeans
np.random.seed(5)
X = np.random.rand(200000, 20)
X = np.float32(X)
estimator = KMeans()
def time_this_function():
estimator.fit(X)
timer = timeit.Timer(time_this_function)
print timer.timeit(number=1)
Created
June 17, 2016 13:22
-
-
Save yenchenlin/524c5cd37072be257a0c5a8a27574d59 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment