GithubHelp home page GithubHelp logo

hyperopt-doc-zh's People

Contributors

albertz avatar araujoalexandre avatar birbbit avatar bjkomer avatar bwaldvogel avatar craigkelly avatar davidsmf avatar dwf avatar fonttian avatar gwtaylor avatar jaberg avatar jnothman avatar johnflux avatar lishen avatar lucasb-eyer avatar maxpumperla avatar npinto avatar sloth2012 avatar temporaer avatar twiecki avatar willgroves avatar wskish avatar yamins81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyperopt-doc-zh's Issues

遇到问题,希望能得到您的帮助

我使用hyperopt中的fmin进行随机森林超参数选择,在选择过程中我输出了产生最优解的max_depth和n_estimators,但我输出的值均比使用fmin返回的值大1

这是我关于hyperopt

from functools import partial


def hyperopt_clt(params, data_x, data_y):
    global best
    model_clt = RandomForestClassifier(**params)
    acc = cross_val_score(model_clt, data_x, data_y).mean()
    if acc > best:
        best = acc
        print('new best:', best, params)
    return {'loss': 1 - acc, 'status': STATUS_OK}


space_clf = {
    'max_depth': hp.choice('max_depth', range(1, 51)),
    'n_estimators': hp.choice('n_estimators', range(1, 21))
}

best = 0
trials_clt = Trials()
hyperopt_clt_partial = partial(hyperopt_clt, data_x = data_x, data_y = data_y)
best_clt = fmin(hyperopt_clt_partial, space = space_clf, algo = tpe.suggest, max_evals = 100, trials = trials_clt)
print(best, '----------------')
print(best_clt, '------------')`

这是我得到的结果

new best:
0.7955077744291005
{'max_depth': 47, 'n_estimators': 12}
new best:
0.8071266849594411
{'max_depth': 5, 'n_estimators': 20}
100%|██████████| 100/100 [00:30<00:00,  3.29trial/s, best loss: 0.19287331504055893]
0.8071266849594411 ----------------
{'max_depth': 4, 'n_estimators': 19} ------------

关于hyperopt中fmin的一个错误问题

您好,首先感谢您翻译hyperopt的工作,这对于国内的用户是一个十分有帮助的工作,可是在我使用hyperopt的过程中遇到一个问题,搜索了很多资料人就无法解决,希望作者可以给与帮助,谢谢,问题如下:
我按照fmin文档的代码在我的python环境中执行了以后,出现了一个错误提示,代码和错误如下
`from hyperopt import fmin, tpe, hp

space = hp.uniform('x', -10, 10)
best = fmin(fn=lambda x : x**2,
space=space,
algo=tpe.suggest,
max_evals=100)

print(dir(best))`

File "D:\Anaconda3\lib\site-packages\hyperopt\fmin.py", line 314, in fmin
pass_expr_memo_ctrl=pass_expr_memo_ctrl)
File "D:\Anaconda3\lib\site-packages\hyperopt\base.py", line 786, in init
pyll.toposort(self.expr)
File "D:\Anaconda3\lib\site-packages\hyperopt\pyll\base.py", line 715, in toposort
assert order[-1] == expr
TypeError: 'generator' object is not subscriptable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.