Skip to content

Commit

Permalink
Fix some deprecations and add tolerance to niter test
Browse files Browse the repository at this point in the history
  • Loading branch information
simonster committed Dec 15, 2016
1 parent 6b3a1c7 commit dd93814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Lasso.jl
Expand Up @@ -210,7 +210,7 @@ function computeλ(Xy, λminratio, α, nλ, ω::Union{Vector,Void})
end
λmax /= α
logλmax = log(λmax)
λ = exp(linspace(logλmax, logλmax + log(λminratio), nλ))
λ = exp.(linspace(logλmax, logλmax + log(λminratio), nλ))
end

# rescales A so that it sums to base
Expand Down Expand Up @@ -344,9 +344,9 @@ dispersion_parameter(path::RegularizationPath) = GLM.dispersion_parameter(distfu
function StatsBase.loglikelihood(path::RegularizationPath)
n = nobs(path)
if typeof(path.m) <: LinearModel
-0.5*n.*log(deviance(path))
-0.5.*n.*log.(deviance(path))
else
-0.5*n.*deviance(path)
-0.5.*n.*deviance(path)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/lasso.jl
Expand Up @@ -120,7 +120,7 @@ facts("LassoPath") do
if niter == 0
niter = l.niter
else
@fact l.niter --> niter
@fact abs(niter - l.niter) --> less_than_or_equal(10)
end
end
# end
Expand Down

0 comments on commit dd93814

Please sign in to comment.