Skip to content

Commit

Permalink
remove penalty functions
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed May 12, 2023
1 parent 51333d3 commit a4c878f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/regularizedpred.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ StatsAPI.modelmatrix(p::AbstractRegularizedPred) = p.X

StatsAPI.coef(p::AbstractRegularizedPred) = p.beta0

penalty(p::AbstractRegularizedPred) = p.penalty

penalized_coef(p::AbstractRegularizedPred) = coef(p)

dev_criteria(p::AbstractRegularizedPred) = 2 * cost(penalty(p), penalized_coef(p))

initpred!(p::AbstractRegularizedPred, args...; kwargs...) = p

updatepred!(p::AbstractRegularizedPred, args...; kwargs...) = p

update_beta!(p::AbstractRegularizedPred, args...; kwargs...) = p

function StatsAPI.vcov(p::AbstractRegularizedPred, wt::AbstractVector)
wXt = isempty(wt) ? modelmatrix(p)' : (modelmatrix(p) .* wt)'
return inv(Hermitian(float(Matrix(wXt * modelmatrix(p)))))
Expand Down Expand Up @@ -220,10 +208,6 @@ function Base.propertynames(r::RidgePred, private::Bool=false)
end
end

penalty(p::RidgePred) = SquaredL2Penalty(p.λ)

penalized_coef(p::RidgePred) = p.G * (p.pred.beta0 - p.βprior)

function cgpred(
X::StridedMatrix{T},
λ::Real,
Expand Down

0 comments on commit a4c878f

Please sign in to comment.