def cluster_birch(X_train, model_args=None, gridsearch=True):
from sklearn.cluster import Birch
print('Birch')
if gridsearch is True:
## TODO:
# add hyperparamter searching. No scoring method available for this model,
# so we can't easily use gridsearching.
raise NotImplementedError('No hyperparameter optimization available yet for this model. Set gridsearch to False')
# prune(param_grid, model_args)
else:
if 'n_clusters' not in model_args:
raise KeyError('Need to define n_clusters for Birch')
param_grid = None
return ModelWrapper(Birch, X=X_train, model_args=model_args, param_grid=param_grid, unsupervised=True)
评论列表
文章目录