问题标签 [hyperparameters]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
439 浏览

machine-learning - 如何更容易地获得超参数?

机器学习中的许多模型都包含超参数。使用保留数据查找这些超参数的最佳做法是什么?或者你的方法是什么?

0 投票
1 回答
2080 浏览

algorithm - algorithm-agnostic hyperparameter grid search in MATLAB

I would like to compare different machine learning algorithms. As part of that, I need to be able to perform a grid search for optimal hyperparameters. However, I am not really into the idea of writing a separate implementation of a grid search for each fixed algorithm and a fixed subset of its hyperparameters. Instead, I would like it to look more like it does in scikit-learn but perhaps with not as much functionality (I do not need multiple grids, for example) and written in MATLAB.

So far I am trying to understand the logic of the yet to be written grid_search.m

The calls to the grid_search function should look something like this:

The first call then would try all the combinations of the rbf kernel with Constraints and Sigmas:

The idea behind the args variable is that it is a cell array of the form {'name1', 'value1', 'name2', 'value2', ..., 'nameN', 'valueN'} which would be later on passed to the corresponding algorithm: algo(data, labels, args{:}). The {'name1', 'name2', ..., 'nameN'} part of it is easy. The problem is that I can't unerstand how to create the {'value1', 'value2', ..., 'valueN'} part on each step.

I understand that machine learning terminology is not known to everybody Which is why below comes a self-contained example:

Suppose the crew of the TARDIS may consist of the following classes of beings:

Since there is always just one place for a Timelord, a Companion and a Villain, please show me how to generate the following cell arrays:

The solution should be general, i.e. if the number of beings in a class changes or more classes of beings are added, it should still work. I would much appreciate a step-by-step descritption instead of code, too.

PS: The non-stripped github version of the original grid_search.m might give you a better idea of what I mean.

0 投票
1 回答
1388 浏览

matlab - 回归的高斯过程的超参数

我知道高斯过程回归模型主要由其协方差矩阵指定,并且自由超参数充当模型的“权重”。但是谁能解释协方差矩阵中的 2 个超参数(长度尺度和幅度)代表什么(因为它们不是“真实”参数)?我对这两个参数的“实际”含义有些困惑。

提前谢谢你的帮助。:)

0 投票
2 回答
743 浏览

matlab - 高斯过程,负超参数?

我正在使用 GPML 工具箱进行回归的高斯过程。但是,在使用“minimize.m”(没有平均函数)进行优化后,我得到了一些负超参数!

初始超参数是:

hyp.cov = [0; 0]; % two hyper-parameters in covariance kernel (length-scale & amplitute) hyp.lik = log(0.1); %hyper-parameters of noise

原始训练数据:

在我的代码中,y 被归一化为具有零均值和单位方差。然后优化:

大约 100 次迭代后,我得到了一些负超参数!!!这很令人困惑......

但是,如果我不对 y 进行归一化,优化后所有超参数都将为正。

谁能告诉我负超参数是什么意思?我应该标准化数据吗?

0 投票
2 回答
26452 浏览

machine-learning - 要通过 GridSearchCV() 探索的 svm.SVC() 超参数的良好值范围是多少?

我遇到的问题是我的超参数svm.SVC()太宽以至于GridSearchCV()永远不会完成!一种想法是RandomizedSearchCV()改用。但同样,我的数据集相对较大,500 次迭代大约需要 1 小时!

我的问题是,为了停止浪费资源,在 GridSearchCV (或 RandomizedSearchCV )中有什么好的设置(就每个超参数的值范围而言)?

换句话说,如何确定例如C大于 100 的值是否有意义和/或 1 的步长既不大也不小?很感谢任何形式的帮助。这是我目前使用的设置:

0 投票
2 回答
5583 浏览

r - 我们如何为 glmnet 指定自定义 lambda 序列

我是 中的glmnet包的新手R,想lambda根据已发表的研究论文中的建议指定一个glmnet.cv函数。文档建议我们可以提供一个递减序列lambdas作为参数。但是,在文档中没有关于如何执行此操作的示例。

如果有人能建议如何去做,将不胜感激。我是否将 100 个奇数值(的默认值nlambda)的向量传递给函数?这个向量的最小值和最大值应该有什么限制(如果有的话)?另外,在指定向量时,是否要记住关于 等的事情nvarsnobs

提前致谢。

0 投票
0 回答
1744 浏览

r - 使用 BIC、AIC 估计文档聚类中使用 Kmeans 的聚类数

在我的方法中,我试图找到“k”的最佳值,以使用 KMEANS 算法对一组文档进行聚类。我想使用“AIC”和“BIC”信息标准函数来寻找最佳模型。我使用此资源“sherrytowers.com/2013/10/24/k-means-clustering/”来找到“k”的最佳值。

但是当我运行代码时,我得到了 AIC 和 BIC 的以下图表。我无法从图表中解释任何内容。我的疑问是

  1. 我的方法是否错误并且这些度量(AIC,BIC)不能用于使用 Kmeans 进行文档聚类?
  2. 或者编程逻辑有错误,“AIC”和“BIC”是找到“k”簇数的正确方法?

这是我的代码

这些是它生成的图表 http://snag.gy/oAfhk.jpg http://snag.gy/vT8fZ.jpg

0 投票
1 回答
1135 浏览

python - 拟合图形以查找数据曲线的梯度

我有一堆数据需要找到梯度。数据的设置就像我有核金属丰度一样,它是星系中心的金属丰度(距离 = 0)和距离中心不同距离的一堆不同星系的金属丰度。我想找到一个通用梯度,所以我计划绘制所有数据并寻找最佳拟合曲线。这个想法是金属丰度是它的中心。所以我需要修复任何金属丰度梯度,使其返回正确的核金属丰度。我需要将任何梯度的偏移量固定为核金属丰度(拟合单个星系时)或 0(如果通过它们的核金属丰度移动所有内容并拟合完整样本)。

这是我的数据示例:

所以我基本上想要一个像金属度 - 核金属度 = 距离 * 梯度这样的方程。现在我正在使用一个非常简单的脚本,它只是从文本文件中调用数据,然后使用 matplotlib 绘制它。我感到困惑的是如何偏移图表以使核金属丰度为零并且我可以获得通用梯度。由于上面的等式使用了梯度,但我需要解决它,我不知道该怎么做。有谁知道如何使用超参数拟合图形?

编辑:

所以我所说的梯度是我想的最佳拟合线的方程。基本上我在星系的中心有一个金属丰度,而对于一堆不同的星系来说,金属丰度在离中心一定距离的地方,我需要使用这些数据找到一个方程,所以如果我知道中心金属丰度和到中心的距离我可以将其代入所述方程以了解该点的金属丰度。由于目前所有星系都有不同的金属丰度,我试图拟合所有数据以找到梯度。那有意义吗?

0 投票
1 回答
182 浏览

python - scikit - CalibratedCV 上的 GridSearchCV,以 RandomForrestClassifier 作为基本估计器

我想知道是否有办法在 CalibratedCV 中嵌入的 RandomForrestClassifier 上执行 GridSearchCV,我想优化日志丢失,所以我需要在 CalibratedCV 上进行评估,但我想更改 RandomForrest 的参数。

提前致谢

0 投票
1 回答
655 浏览

machine-learning - LibSVM 预测精度

我目前正在尝试运行LibSVM位于此处:https ://www.csie.ntu.edu.tw/~cjlin/libsvm

我只能访问 MATLAB 2011b。当我尝试LibSVM使用不同的值运行包中C包含的示例数据文件(heartscale)时,gamma我得到了相同的精度结果。

这也发生在其他数据集上。

我建立了一个for循环并循环通过不同的Cgamma和精度%的不改变。

我这样做是为了找到最好的C,并gamma按照上述网站上的文档“支持向量分类的实用指南”中的建议用于数据集(交叉验证)。

当我查看accuracy_mat我在下面构建的时,这些值都是相同的。甚至来自的输出svmpredict也是相同的。

我已多次阅读文档并查看网站上的常见问题解答,并希望 SVM 从业者对此提供意见。