Skip to content

Commit

Permalink
fixing tests. Replace missing now takes a math equation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Nuernberger committed Feb 14, 2019
1 parent 0ffa6af commit f0a0123
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/tech/ml/dataset.clj
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ the correct type."
(first nonzero-entries) (keys inverse-map))
{:entry-label (first nonzero-entries)
:label-map label-map}))))))))
(let [column-values (-> (columns dataset src-column)
(let [column-values (-> (column dataset src-column)
ds-col/column-values)
inverse-map (c-set/map-invert label-map)]
(->> column-values
Expand Down
2 changes: 2 additions & 0 deletions src/tech/ml/dataset/etl/math_ops.clj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
math-expr
(number? math-expr)
math-expr
(boolean? math-expr)
math-expr
(sequential? math-expr)
(let [fn-name (first math-expr)
;;Force errors early
Expand Down
6 changes: 3 additions & 3 deletions src/tech/ml/dataset/etl/pipeline_operators.clj
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
(def-etl-operator
replace-missing

{:missing-value (double (math-ops/eval-expr {:dataset dataset
:column-name column-name}
(first op-args)))}
{:missing-value (math-ops/eval-expr {:dataset dataset
:column-name column-name}
(first op-args))}

(ds/update-column
dataset column-name
Expand Down

0 comments on commit f0a0123

Please sign in to comment.