The following link ( https://software.intel.com/en-us/articles/intelr-distribution-for-python... ) states that the Intel Python Distribution 2017 Update 2 uses the DAAL as a backend for K-means clustering in Scikit-Learn.
Using the following code, on Linux, does not seem to use the DAAL as reported by vTune. It still runs the original Scikit-Learn code written in Cython. Is there anything to do to enable the DAAL?
import os from time import time import numpy as np from sklearn.cluster import KMeans dim = 784 nb_points = 60000 nb_clusters = 10 nb_iterations = 20 nb_threads = 1 os.environ['OMP_NUM_THREADS'] = '28' points = np.random.rand(nb_points, dim) estimator = KMeans(init = "random", verbose = 1, max_iter = nb_iterations, algorithm = "full", precompute_distances = False, tol = 0.0, n_clusters = nb_clusters, n_init = 1) print("Before computing") time_begin = time() estimator.fit(points) time_end = time() print("After computing") print((time_end - time_begin) / nb_iterations)