From ed37be07202dce3eeea76e39c37a99a9db4e725c Mon Sep 17 00:00:00 2001 From: Ryan Boldi Date: Mon, 9 Jan 2023 16:28:36 +0100 Subject: [PATCH] Update downsample.cljc --- src/propeller/downsample.cljc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/propeller/downsample.cljc b/src/propeller/downsample.cljc index a24b62d..a5117a9 100644 --- a/src/propeller/downsample.cljc +++ b/src/propeller/downsample.cljc @@ -107,6 +107,10 @@ [errors] (map #(replace-mins-with-zero %) errors)) +(defn convert-to-soft-error + [errors delta] + (map #(replace-close-zero-with-zero % delta) errors)) + (defn update-case-distances "updates the case distance field of training-data list, should be called after evaluation of individuals evaluated-pop should be a list of individuals that all have the :errors field with a list of this @@ -118,7 +122,7 @@ errors (map #(:errors %) evaluated-pop) corr-errors (case ids-type :elite (convert-to-elite-error errors) - :soft (replace-close-zero-with-zero errors solution-threshold) + :soft (convert-to-soft-error errors solution-threshold) errors)] ;errors, including elite/not-elite distinction (merge-map-lists-at-index training-data (map-indexed