Skip to content
Snippets Groups Projects
Commit c2be489a authored by Simon Belak's avatar Simon Belak
Browse files

Fix potentially returning a regression with Infinity as a coeficient

parent 9532c572
No related branches found
No related tags found
No related merge requests found
......@@ -395,7 +395,8 @@
lambda 0.1
regularize (fn [penalty]
(fn [ssr]
(if (Double/isNaN ssr)
(if (or (Double/isNaN ssr)
(Double/isInfinite ssr))
Double/MAX_VALUE
(+ ssr (* lambda penalty)))))
best-fit (transduce
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment