提问人:Cam Hoang 提问时间:11/17/2023 最后编辑:Peter MortensenCam Hoang 更新时间:11/21/2023 访问量:250
为什么新的贡献者在所有事情上都受到限制?[已结束]
Why is a new contributor limited in all the things? [closed]
问:
我看到了这个 https://stackoverflow.com/help/answering-limit#:~:text=We%20slow%20down%20new%20user,to%20craft%20a%20good%20answer。 但这没有任何意义,因为有些人正在使用 ChatGPT,然后所有新贡献者都必须等待各种速率限制:无法发表评论、无法投票、等待 30 分钟才能回答,......?
作为一名开发人员,我希望 Stack Overflow 能够开发新功能来检测 ChatGPT 答案并阻止它,或者从收到反对票的答案中扣除声誉。请不要因为人工智能而减慢人类的速度!!
答:
由于他人的行为而受到限制,您在网站上的互动方式受到限制是很烦人的。但是,如果您真的要面对 30 分钟的多个答案,那么您不应该有这个问题太久,因为您的答案会被点赞,并且您会发现自己很快就会脱离代表截止时间。
评论
我从未使用过 matlab,但从您之前的问题来看,我怀疑您正在寻找类似于 Kdtree 或变体的东西。
澄清:由于对此似乎存在一些混淆,我认为伪代码示例是有序的。
// Some of this shamelessly borrowed from the wikipedia article
function kdtree(points, lower_bound, upper_bound) {
// lower_bound and upper_bound are the boundaries of your bucket
if(points is empty) {
return nil
}
// It's a trivial exercise to control the minimum size of a partition as well
else {
// Sort the points list and choose the median element
select median from points.x
node.location = median;
node.left = kdtree(select from points where lower_bound < points.x <= median, lower_bound, median);
node.right = kdtree(select from points where median < points.x <= upper_bound, median, upper_bound);
return node
}
}
kdtree(points, -inf, inf)
// or alternatively
kdtree(points, min(points.x), max(points.x))
评论
听起来您想使用大小因 x 值的密度而异的条柱。我认为您仍然可以像上一篇文章的答案一样使用 HISTC 函数,但您只需要给它一组不同的边缘。
我不知道这是否正是您想要的,但这里有一个建议:不要将 x 轴拆分为 70 个等距组,而是将排序后的 x 数据拆分为 70 个相等的组并确定边值。我认为这段代码应该有效:
% Start by assuming x and y are vectors of data:
nBins = 70;
nValues = length(x);
[xsort,index] = sort(x); % Sort x in ascending order
ysort = y(index); % Sort y the same way as x
binEdges = [xsort(1:ceil(nValues/nBins):nValues) xsort(nValues)+1];
% Bin the data and get the averages as in previous post (using ysort instead of y):
[h,whichBin] = histc(xsort,binEdges);
for i = 1:nBins
flagBinMembers = (whichBin == i);
binMembers = ysort(flagBinMembers);
binMean(i) = mean(binMembers);
end
这应该为您提供大小随数据密度而变化的箱。
更新:另一个版本...
这是我在发表一些评论后想出的另一个想法。使用此代码,您可以为 x 中相邻数据点之间的差值设置阈值 (maxDelta)。任何与较大的邻居相差大于或等于 maxDelta 的 x 值都被迫放在它们自己的 bin 中(所有这些都由它们的孤独)。您仍可为 nBin 选择一个值,但当分散点降级到其自己的 bin 时,最终的 bin 数将大于此值。
% Start by assuming x and y are vectors of data:
maxDelta = 10; % Or whatever suits your data set!
nBins = 70;
nValues = length(x);
[xsort,index] = sort(x); % Sort x in ascending order
ysort = y(index); % Sort y the same way as x
% Create bin edges:
edgeIndex = false(1,nValues);
edgeIndex(1:ceil(nValues/nBins):nValues) = true;
edgeIndex = edgeIndex | ([0 diff(xsort)] >= maxDelta);
nBins = sum(edgeIndex);
binEdges = [xsort(edgeIndex) xsort(nValues)+1];
% Bin the data and get the y averages:
[h,whichBin] = histc(xsort,binEdges);
for i = 1:nBins
flagBinMembers = (whichBin == i);
binMembers = ysort(flagBinMembers);
binMean(i) = mean(binMembers);
end
我在几个小样本数据集上测试了它,它似乎做了它应该做的事情。希望它也适用于您的数据集,无论它包含什么!=)
评论
上一个:在筛选聚合中选择嵌套字段
评论