用Scikitlearn风格的估计器简化超参数调整的hyperopt包装器。

Skperopt的Python项目详细描述


斯派洛特

hyperopt包装器-使用Scikit学习风格估计器简化超参数调整。在

与分类评估指标“f1”、“auc”或“准确性”以及回归“rmse”和“mse”一起使用。在

安装:

pip install skperopt

用法:

只要传入一个估计器,参数网格和Hyperopt就可以完成剩下的工作。不需要定义目标或编写hyoperopt特定的参数网格。在

配方(香草味):

  • [x] 进口SKPEROPOT
  • [x] 初始化skperopt
  • [x] 跑skperopt.HyperSearch.搜索在
  • [x] 收集结果

下面是代码示例。在

^{pr2}$

超搜索参数

  • est[sklearn estimator]必需)

any sklearn style estimator

  • X(需要[pandas Dataframe]

your training data

  • y(需要[pandas Dataframe]

your training data

  • params(需要[dictionary]

a parameter search grid

  • iters(默认500[int]

number of iterations to try before early stopping

  • time\-to-u搜索(默认无[int]

time in seconds to run for before early stopping (None = no time limit)

  • cv(默认为5[int]

number of folds to use in cross_vaidation tests

  • cv_次(默认值为1[int]

number of times to perfrom cross validation on a new random sample of the data -higher values decrease variance but increase run time

  • randomState(默认10[int]

random state for the data shuffling

  • scorer(默认为“f1”[str]

type of evaluation metric to use - accepts classification "f1","auc","accuracy" or regression "rmse" and "mse"

  • verbose(默认值1[int]

amount of verbosity

     0 = none 

     1 = some 

     2 = debug
  • random(默认-False

should the data be randomized during the cross validation

  • foldtype(默认为“Kfold”[str]

type of folds to use - accepts "KFold", "Stratified"

超搜索方法

  • 超搜索搜索()(无)

Used to search the parameter grid using hyperopt. No parameters need to be passed to the function. All parameters are set during initialization.

测试

随机搜索和Skperopt搜索的150次搜索迭代的100次测试。在

Skperopt(hyperopt)比随机搜索的表现更好,产生更高的f1平均分数和更小的标准差。在

alt chart

Skperopt搜索结果

f1成绩超过100次测试:

Mean 0.9340930

Standard deviation 0.0062275

随机搜索结果

f1成绩超过100次测试

Mean 0.927461652

Standard deviation 0.0063314


更新

0.0.73

  • 添加了cv_times attr-在新的随机采样数据集上每次迭代运行交叉验证n次(即cv(5x5)) 这样可以减少过度装配

0.0.7

  • 添加了FIXEDRMSE评估指标

  • 增加了MSE评估指标

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java中的第10个解决方案   Java中泛型的super和extends组合   Java Android OpenGL ES 2.0片段着色器texture2D不工作   在JList elementJava上按下时打开弹出窗口   字典Java数据结构允许对象上的布尔标志和排序?   java我该如何停止为AWS关系数据库服务收费?   java如何检查Google定位准确度是否提高?   java使用Mockito将方法存根在与被测类相同的类中(CUT)   java IntelliJIdea disable inspection:参数的实际值始终为   java CXF+多态POST数据   java命名空间“ads”未绑定   Sun(1999)的“Java编程语言的代码约定”的编码风格过时了吗?   JAVA中的隐式接口、类转换   javafx如何配置Java登录应用程序代码   java如何在滚动窗格中设置选项卡以及如何显示选项卡标题   java中等式和条件运算符的优先级   java Spring WS无法返回JAXB响应   错误响应上的java jaxws处理程序行为   java Hibernate HQL映射查询