Update downsample.cljc
This commit is contained in:
parent
e7130da06f
commit
288faadedf
@ -6,14 +6,14 @@
|
||||
(defn assign-indices-to-data
|
||||
"assigns an index to each training case in order to differentiate them when downsampling"
|
||||
[training-data]
|
||||
(map (fn [data-map index]
|
||||
(pmap (fn [data-map index]
|
||||
(let [data-m (if (map? data-map) data-map (assoc {} :data data-map))] ;if data is not in a map, make it one
|
||||
(assoc data-m :index index)))
|
||||
training-data (range (count training-data))))
|
||||
|
||||
(defn initialize-case-distances
|
||||
[{:keys [training-data population-size]}]
|
||||
(map #(assoc % :distances (vec (repeat (count training-data) population-size))) training-data))
|
||||
[{:keys [training-data population-size] :as argmap}]
|
||||
(utils/pmapallv #(assoc % :distances (vec (repeat (count training-data) population-size))) training-data argmap))
|
||||
|
||||
(defn select-downsample-random
|
||||
"Selects a downsample from the training cases and returns it"
|
||||
|
Loading…
x
Reference in New Issue
Block a user