def multinomial_nb( name, alpha=None, fit_prior=None, ): def _name(msg): return '%s.%s_%s' % (name, 'multinomial_nb', msg) rval = scope.sklearn_MultinomialNB( alpha=hp.quniform(_name('alpha'), 0, 1, 0.001) if alpha is None else alpha, fit_prior=hp.choice(_name('fit_prior'), [True, False]) if fit_prior is None else fit_prior, ) return rval
def multinomial_nb(name, alpha=None, fit_prior=None, class_prior=None, ): def _name(msg): return '%s.%s_%s' % (name, 'multinomial_nb', msg) rval = scope.sklearn_MultinomialNB( alpha=(hp.quniform(_name('alpha'), 0, 1, 0.001) if alpha is None else alpha), fit_prior=(hp_bool(_name('fit_prior')) if fit_prior is None else fit_prior), class_prior=class_prior ) return rval
def multinomial_nb(name, alpha=None, fit_prior=None, ): def _name(msg): return '%s.%s_%s' % (name, 'multinomial_nb', msg) rval = scope.sklearn_MultinomialNB( alpha=hp.quniform( _name('alpha'), 0, 1, 0.001 ) if alpha is None else alpha, fit_prior=hp.choice( _name('fit_prior'), [ True, False ] ) if fit_prior is None else fit_prior, ) return rval