summaryrefslogtreecommitdiffstats
path: root/ml/kmeans
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
commit34a0b66bc2d48223748ed1cf5bc1b305c396bd74 (patch)
treefbd36be86cc6bc4288fe627f2b5beada569848bb /ml/kmeans
parentAdding upstream version 1.32.1. (diff)
downloadnetdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.tar.xz
netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.zip
Adding upstream version 1.33.0.upstream/1.33.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--ml/kmeans/SamplesBuffer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ml/kmeans/SamplesBuffer.h b/ml/kmeans/SamplesBuffer.h
index fccd216d5..5c3cb1a97 100644
--- a/ml/kmeans/SamplesBuffer.h
+++ b/ml/kmeans/SamplesBuffer.h
@@ -20,8 +20,9 @@ public:
Sample(CalculatedNumber *Buf, size_t N) : CNs(Buf), NumDims(N) {}
void initDSample(DSample &DS) const {
- for (size_t Idx = 0; Idx != NumDims; Idx++)
- DS(Idx) = CNs[Idx];
+ for (size_t Idx = 0; Idx != NumDims; Idx++) {
+ DS(Idx) = std::abs(CNs[Idx]);
+ }
}
void add(const Sample &RHS) const {