如何计算高斯值?
How to calculate gauss value?
我只是想知道我应用公式时这个值是怎么来的,但我想我遗漏了什么有人能告诉我 please.I 是 运行 单个 ELK 堆栈版本 7.16
POST sneaker/_search
{
"query": {
"function_score": {
"functions": [
{
"gauss": {
"price": {
"origin": "300",
"scale": "200"
}
}
}
]
}
}
, "explain": true
}
查询结果
"max_score" : 1.0,
"hits" : [
{
"_shard" : "[sneaker][0]",
"_node" : "29ds_f0VSM6_-eDNhdQPLw",
"_index" : "sneaker",
"_type" : "_doc",
"_id" : "6",
"_score" : 1.0,
"_source" : {
"brand" : "flite",
"price" : 300,
"rating" : 2,
"release_date" : "2020-12-21"
},
"_explanation" : {
"value" : 1.0,
"description" : "function score, product of:",
"details" : [
{
"value" : 1.0,
"description" : "*:*",
"details" : [ ]
},
{
"value" : 1.0,
"description" : "min of:",
"details" : [
{
"value" : 1.0,
"description" : "Function for field price:",
"details" : [
{
"value" : 1.0,
"description" : "exp(-0.5*pow(MIN[Math.max(Math.abs(300.0(=doc value) - 300.0(=origin))) - 0.0(=offset), 0)],2.0)/28853.900817779268)",
"details" : [ ]
}
]
},
我寻找高斯分布,但它与此不同。
我想知道28853.900817779268
值是怎么来的
如果您查看 gauss decay function 的官方文档,您会发现以下用于计算 sigma 的公式:
使用 scale = 200 和 decay = 0.5(如果未指定则为默认值),我们得到以下结果:
-200^2 / (2 * ln (0.5)) = -28853.90081
这就是您在查询解释中看到的内容。
我只是想知道我应用公式时这个值是怎么来的,但我想我遗漏了什么有人能告诉我 please.I 是 运行 单个 ELK 堆栈版本 7.16
POST sneaker/_search
{
"query": {
"function_score": {
"functions": [
{
"gauss": {
"price": {
"origin": "300",
"scale": "200"
}
}
}
]
}
}
, "explain": true
}
查询结果
"max_score" : 1.0,
"hits" : [
{
"_shard" : "[sneaker][0]",
"_node" : "29ds_f0VSM6_-eDNhdQPLw",
"_index" : "sneaker",
"_type" : "_doc",
"_id" : "6",
"_score" : 1.0,
"_source" : {
"brand" : "flite",
"price" : 300,
"rating" : 2,
"release_date" : "2020-12-21"
},
"_explanation" : {
"value" : 1.0,
"description" : "function score, product of:",
"details" : [
{
"value" : 1.0,
"description" : "*:*",
"details" : [ ]
},
{
"value" : 1.0,
"description" : "min of:",
"details" : [
{
"value" : 1.0,
"description" : "Function for field price:",
"details" : [
{
"value" : 1.0,
"description" : "exp(-0.5*pow(MIN[Math.max(Math.abs(300.0(=doc value) - 300.0(=origin))) - 0.0(=offset), 0)],2.0)/28853.900817779268)",
"details" : [ ]
}
]
},
我寻找高斯分布,但它与此不同。
我想知道28853.900817779268
值是怎么来的
如果您查看 gauss decay function 的官方文档,您会发现以下用于计算 sigma 的公式:
使用 scale = 200 和 decay = 0.5(如果未指定则为默认值),我们得到以下结果:
-200^2 / (2 * ln (0.5)) = -28853.90081
这就是您在查询解释中看到的内容。