用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平均分数和更小的标准差。在
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评估指标
在
- 项目
标签: