1

Use selector.get_support (Documentation). This will give you a mask of the features that were selected and features that were discarded. >>> selector.get_support() array([False, True, True, False]) And here is how you get your selected features indices >>> [ i for i, f in enumerate(selector.get_support()) if f ] [1, 2]


1

I believe you are trying to access "labels_" before fitting the data. from sklearn.cluster import KMeans import numpy as np X = np.array([[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]]) kmeans = KMeans(n_clusters=2, random_state=0).fit(X) def get_properies(model): return [i for i in model.__dict__ ] get_properies(kmeans) ...


Only top voted, non community-wiki answers of a minimum length are eligible