|
|
@@ -892,15 +892,15 @@ namespace HealthMonitor.Service.Biz.db |
|
|
|
// 奇数个元素,取中间的数 |
|
|
|
median = sortedRes[count / 2]; |
|
|
|
} |
|
|
|
Console.WriteLine("中位数是: " + median); |
|
|
|
|
|
|
|
//Console.WriteLine("中位数是: " + median); |
|
|
|
_logger.LogInformation($"{serialNo} 中位数是: " + median); |
|
|
|
// 找出最接近平均值的众数 |
|
|
|
//var closestToAverage = modes.OrderBy(m => Math.Abs(m - average)).First(); |
|
|
|
//Console.WriteLine("最接近平均值的众数是: " + closestToAverage); |
|
|
|
|
|
|
|
// 找出最接近中位数的众数 |
|
|
|
var closestToMedian = modes.OrderBy(m => Math.Abs(m - median)).First(); |
|
|
|
Console.WriteLine("最接近中位数的众数是: " + closestToMedian); |
|
|
|
_logger.LogInformation($"{serialNo} 最接近中位数的众数是: " + closestToMedian); |
|
|
|
mode = closestToMedian; |
|
|
|
} |
|
|
|
#endregion |
|
|
@@ -914,8 +914,8 @@ namespace HealthMonitor.Service.Biz.db |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
// 输出新数据集 |
|
|
|
Console.WriteLine("新数据集: " + string.Join(", ", closestToModeData)); |
|
|
|
Console.WriteLine("新数据集的数量: " + closestToModeData.Count); |
|
|
|
_logger.LogInformation($"{serialNo} 新数据集: " + string.Join(", ", closestToModeData)); |
|
|
|
_logger.LogInformation($"{serialNo} 新数据集的数量: " + closestToModeData.Count); |
|
|
|
|
|
|
|
var fhrMap = _mgrFhrPhrMapCache.GetHeartRatesMap(); |
|
|
|
var watchConfig = await _deviceCacheMgr.GetGpsDeviceWatchConfigCacheObjectBySerialNoAsync(serialNo, "0067"); |
|
|
|