Skip to content

Instantly share code, notes, and snippets.

@amueller
Created October 7, 2012 20:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amueller/3849419 to your computer and use it in GitHub Desktop.
Save amueller/3849419 to your computer and use it in GitHub Desktop.
find parameter names for sklearn estimators
from sklearn.utils.testing import all_estimators
import numpy as np
all_objects = []
for C in all_estimators():
try:
all_objects.append(C[1]())
except:
pass
params = [c.get_params().keys() for c in all_objects]
flat = [x for c in params for x in c]
unique, indices = np.unique(flat, return_inverse=True)
print(np.vstack([unique, np.bincount(indices)]).T)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment