omtcyf0 omtcyf0 - 2 months ago 12
Python Question

Importing hidden function from Python module

I'd like to import

function from scikit-learn/sklearn/cluster/k_means_.py. However, it's not listed in scikit-learn/blob/master/sklearn/cluster/__init__.py. Is there any "nice" way to do that?

Answer

"Hidden" functions are a recommendation in Python, you can import them.

Try

from scikit-learn.sklearn.cluster.k_means_ import _init_centroids
Comments