def get_pyrbm(n_features, rng): pyvotune.dense_input(PyRBMFeatureExtractor) pyvotune.non_terminal(PyRBMFeatureExtractor) pyvotune.pfloat(range=(0., 1.0), name='learning_rate', rng=rng)(PyRBMFeatureExtractor) pyvotune.pfloat(range=(0., 1.0), name='momentum', rng=rng)(PyRBMFeatureExtractor) pyvotune.pfloat(range=(0., 1.0), name='l2_weight', rng=rng)(PyRBMFeatureExtractor) pyvotune.pfloat(range=(0., 1.0), name='sparsity', rng=rng)(PyRBMFeatureExtractor) pyvotune.pfloat(range=(0., 1.0), name='scale', rng=rng)(PyRBMFeatureExtractor) pyvotune.pbool(name='binary', rng=rng)(PyRBMFeatureExtractor) pyvotune.pbool(name='reconstruction', rng=rng)(PyRBMFeatureExtractor) pyvotune.pint(range=(1, 10), name='n_training_epochs', rng=rng)(PyRBMFeatureExtractor) pyvotune.pint(range=(1, 20), name='n_gibbs', rng=rng)(PyRBMFeatureExtractor) pyvotune.pint(range=(1, 1000), name='batch_size', rng=rng)(PyRBMFeatureExtractor) pyvotune.pint(range=(5, 1500), name='n_hidden', rng=rng)(PyRBMFeatureExtractor) return [PyRBMFeatureExtractor]
def get_theano(n_features, rng): pyvotune.dense_input(TheanoRBMFeatureExtractor) pyvotune.non_terminal(TheanoRBMFeatureExtractor) pyvotune.pfloat(range=(0., 1.0), name='learning_rate', rng=rng)(TheanoRBMFeatureExtractor) pyvotune.pint(range=(1, 10), name='training_epochs', rng=rng)(TheanoRBMFeatureExtractor) pyvotune.pint(range=(1, 1000), name='batch_size', rng=rng)(TheanoRBMFeatureExtractor) pyvotune.pint(range=(1, 1000), name='n_resamples', rng=rng)(TheanoRBMFeatureExtractor) pyvotune.pint(range=(5, 1500), name='n_hidden', rng=rng)(TheanoRBMFeatureExtractor) return [TheanoRBMFeatureExtractor]
def get_decomposers(n_features, rng): pyvotune.dense_input(PCA) pyvotune.non_terminal(PCA) pyvotune.pbool(name='whiten', rng=rng)(PCA) pyvotune.non_terminal(ProjectedGradientNMF) pyvotune.pint(range=(1, n_features), name='n_components', rng=rng)(ProjectedGradientNMF) pyvotune.choice(choices=['nndsvd', 'nndsvda', 'nndsvdar'], name='init', rng=rng)(ProjectedGradientNMF) pyvotune.choice(choices=['data', 'components', None], name='sparseness', rng=rng)(ProjectedGradientNMF) pyvotune.pfloat(range=(1, 10), name='beta', rng=rng)(ProjectedGradientNMF) pyvotune.pfloat(range=(0.01, 10), name='eta', rng=rng)(ProjectedGradientNMF) pyvotune.pint(range=(1, 600), name='max_iter', rng=rng)(ProjectedGradientNMF) pyvotune.pint(range=(100, 4000), name='nls_max_iter', rng=rng)(ProjectedGradientNMF) # PCA & ProbabilisticPCA are initialized together since ProbabilisticPCA # wraps PCA return [PCA, ProbabilisticPCA, ProjectedGradientNMF]
def get_decomposers(n_features, rng): pyvotune.dense_input(PCA) pyvotune.non_terminal(PCA) pyvotune.pbool(name='whiten', rng=rng)(PCA) pyvotune.non_terminal(ProjectedGradientNMF) pyvotune.pint( range=(1, n_features), name='n_components', rng=rng)(ProjectedGradientNMF) pyvotune.choice( choices=['nndsvd', 'nndsvda', 'nndsvdar'], name='init', rng=rng)(ProjectedGradientNMF) pyvotune.choice( choices=['data', 'components', None], name='sparseness', rng=rng)(ProjectedGradientNMF) pyvotune.pfloat( range=(1, 10), name='beta', rng=rng)(ProjectedGradientNMF) pyvotune.pfloat( range=(0.01, 10), name='eta', rng=rng)(ProjectedGradientNMF) pyvotune.pint( range=(1, 600), name='max_iter', rng=rng)(ProjectedGradientNMF) pyvotune.pint( range=(100, 4000), name='nls_max_iter', rng=rng)(ProjectedGradientNMF) # PCA & ProbabilisticPCA are initialized together since ProbabilisticPCA # wraps PCA return [PCA, ProbabilisticPCA, ProjectedGradientNMF]
def get_image_features(n_features, rng): pyvotune.dense_input(PatchExtractor) pyvotune.non_terminal(PatchExtractor) pyvotune.param( typename="patchsize", checker_fn=patchsize_checker, checker_args={ 'min_width': 2, 'max_width': 200, 'min_height': 2, 'max_height': 200 }, generator_fn=patchsize_generator, generator_args={ 'min_width': 2, 'max_width': 200, 'min_height': 2, 'max_height': 200 }, name="patch_size")(PatchExtractor) pyvotune.pint(range=(1, 100), name='max_patches', rng=rng)(PatchExtractor) return [PatchExtractor]
def get_classifiers(n_features, rng): pyvotune.dense_input(RandomForestClassifier) pyvotune.excl_terminal(RandomForestClassifier) pyvotune.choice( choices=['gini', 'entropy'], name='criterion', rng=rng)(RandomForestClassifier) pyvotune.pint(range=(1, 1000), name='n_estimators', rng=rng)(RandomForestClassifier) pyvotune.pfloat(range=(0, 1), name='min_density', rng=rng)(RandomForestClassifier) pyvotune.pconst(value=1, name='n_jobs', rng=rng)(RandomForestClassifier) pyvotune.pbool(name='bootstrap', rng=rng)(RandomForestClassifier) pyvotune.pbool(name='oob_score', rng=rng)(RandomForestClassifier) pyvotune.dense_input(ExtraTreesClassifier) pyvotune.excl_terminal(ExtraTreesClassifier) pyvotune.choice( choices=['gini', 'entropy'], name='criterion', rng=rng)(ExtraTreesClassifier) pyvotune.pint(range=(1, 1000), name='n_estimators', rng=rng)(ExtraTreesClassifier) pyvotune.pfloat(range=(0, 1), name='min_density', rng=rng)(ExtraTreesClassifier) pyvotune.pconst(value=1, name='n_jobs', rng=rng)(ExtraTreesClassifier) pyvotune.pbool(name='bootstrap', rng=rng)(ExtraTreesClassifier) pyvotune.pbool(name='oob_score', rng=rng)(ExtraTreesClassifier) pyvotune.dense_input(GradientBoostingClassifier) pyvotune.excl_terminal(GradientBoostingClassifier) pyvotune.pint(range=(10, 1000), name='n_estimators', rng=rng)(GradientBoostingClassifier) pyvotune.pint(range=(1, n_features), name='max_features', rng=rng)(GradientBoostingClassifier) pyvotune.pfloat(range=(0, 1), name='learn_rate', rng=rng)(GradientBoostingClassifier) pyvotune.pfloat(range=(0, 1), name='subsample', rng=rng)(GradientBoostingClassifier) pyvotune.dense_input(GaussianNB) pyvotune.excl_terminal(GaussianNB) pyvotune.dense_input(MultinomialNB) pyvotune.pfloat(range=(0, 1), name='alpha', rng=rng)(MultinomialNB) pyvotune.pbool(name='fit_prior', rng=rng)(MultinomialNB) pyvotune.excl_terminal(MultinomialNB) pyvotune.dense_input(KNeighborsClassifier) pyvotune.excl_terminal(KNeighborsClassifier) pyvotune.pint(range=(2, 100), name='n_neighbors', rng=rng)(KNeighborsClassifier) pyvotune.choice( choices=['uniform', 'distance'], name='weights', rng=rng)(KNeighborsClassifier) pyvotune.choice( choices=[ 'auto', 'ball_tree', 'kd_tree', 'brute'], name='algorithm', rng=rng)( KNeighborsClassifier) pyvotune.pint(range=(10, 100), name='leaf_size', rng=rng)(KNeighborsClassifier) pyvotune.pint(range=(1, 20), name='p', rng=rng)(KNeighborsClassifier) pyvotune.excl_terminal(SVC) pyvotune.pfloat(range=(0, 1000), name='C', rng=rng)(SVC) pyvotune.choice(choices=['linear', 'poly', 'rbf', 'sigmoid'], name='kernel', rng=rng)(SVC) pyvotune.pint(range=(0, 10), name='degree', rng=rng)(SVC) pyvotune.pfloat(range=(0, 100.), name='gamma', rng=rng)(SVC) pyvotune.pfloat(range=(-10000, 10000.), name='coef0', rng=rng)(SVC) pyvotune.pbool(name='shrinking', rng=rng)(SVC) pyvotune.excl_terminal(NuSVC) pyvotune.pfloat(range=(0, 1.), name='nu', rng=rng)(NuSVC) pyvotune.choice(choices=['poly', 'rbf', 'sigmoid'], name='kernel', rng=rng)(NuSVC) pyvotune.pint(range=(0, 10), name='degree', rng=rng)(NuSVC) pyvotune.pfloat(range=(0, 100.), name='gamma', rng=rng)(NuSVC) pyvotune.pfloat(range=(-10000, 10000.), name='coef0', rng=rng)(NuSVC) pyvotune.pbool(name='shrinking', rng=rng)(NuSVC) return [SVC, NuSVC, GaussianNB, RandomForestClassifier, MultinomialNB, KNeighborsClassifier, ExtraTreesClassifier, GradientBoostingClassifier]
def get_regressors(n_features): pyvotune.dense_input(LinearRegression) pyvotune.excl_terminal(LinearRegression) pyvotune.pbool(name='normalize')(LinearRegression) pyvotune.pbool(name='fit_intercept')(LinearRegression) pyvotune.dense_input(Ridge) pyvotune.excl_terminal(Ridge) pyvotune.pfloat(range=(0, 1), name='alpha')(Ridge) pyvotune.pbool(name='normalize')(Ridge) pyvotune.pbool(name='fit_intercept')(Ridge) pyvotune.dense_input(RandomForestRegressor) pyvotune.excl_terminal(RandomForestRegressor) pyvotune.pint(range=(1, 1000), name='n_estimators')(RandomForestRegressor) pyvotune.pfloat(range=(0, 1), name='min_density')(RandomForestRegressor) pyvotune.pconst(value=1, name='n_jobs')(RandomForestRegressor) pyvotune.pbool(name='bootstrap')(RandomForestRegressor) pyvotune.pbool(name='oob_score')(RandomForestRegressor) pyvotune.dense_input(ExtraTreesRegressor) pyvotune.excl_terminal(ExtraTreesRegressor) pyvotune.pint(range=(1, 1000), name='n_estimators')(ExtraTreesRegressor) pyvotune.pfloat(range=(0, 1), name='min_density')(ExtraTreesRegressor) pyvotune.choice(choices=['auto', 'sqrt', 'log2', None], name='max_features')(ExtraTreesRegressor) pyvotune.pconst(value=1, name='n_jobs')(ExtraTreesRegressor) pyvotune.pbool(name='bootstrap')(ExtraTreesRegressor) pyvotune.pbool(name='oob_score')(RandomForestRegressor) pyvotune.dense_input(GradientBoostingRegressor) pyvotune.excl_terminal(GradientBoostingRegressor) pyvotune.pint(range=(10, 1000), name='n_estimators')(GradientBoostingRegressor) pyvotune.pint(range=(1, n_features), name='max_features')(GradientBoostingRegressor) pyvotune.pfloat(range=(0, 1), name='learn_rate')(GradientBoostingRegressor) pyvotune.pfloat(range=(0, 1), name='subsample')(GradientBoostingRegressor) pyvotune.dense_input(KNeighborsRegressor) pyvotune.excl_terminal(KNeighborsRegressor) pyvotune.pint(range=(2, 100), name='n_neighbors')(KNeighborsRegressor) pyvotune.choice( choices=['uniform', 'distance'], name='weights')(KNeighborsRegressor) pyvotune.choice( choices=[ 'auto', 'ball_tree', 'kd_tree', 'brute'], name='algorithm')( KNeighborsRegressor) pyvotune.pint(range=(10, 100), name='leaf_size')(KNeighborsRegressor) pyvotune.pint(range=(1, 20), name='p')(KNeighborsRegressor) pyvotune.excl_terminal(SVR) pyvotune.pfloat(range=(0, 1000), name='C')(SVR) pyvotune.pfloat(range=(0, 2.0), name='epsilon')(SVR) pyvotune.choice(choices=['linear', 'poly', 'rbf', 'sigmoid'], name='kernel')(SVR) pyvotune.pint(range=(0, 10), name='degree')(SVR) pyvotune.pfloat(range=(0, 100.), name='gamma')(SVR) pyvotune.pfloat(range=(-10000, 10000.), name='coef0')(SVR) pyvotune.pbool(name='shrinking')(SVR) pyvotune.excl_terminal(NuSVR) pyvotune.pfloat(range=(0, 1.), name='nu')(NuSVR) pyvotune.choice(choices=['poly', 'rbf', 'sigmoid'], name='kernel')(NuSVR) pyvotune.pint(range=(0, 10), name='degree')(NuSVR) pyvotune.pfloat(range=(0, 100.), name='gamma')(NuSVR) pyvotune.pfloat(range=(-10000, 10000.), name='coef0')(NuSVR) pyvotune.pbool(name='shrinking')(NuSVR) return [RandomForestRegressor, GradientBoostingRegressor, KNeighborsRegressor, SVR, NuSVR, ExtraTreesRegressor, LinearRegression, Ridge]