From 4b87218cd6675ea34e9d923a9f1a8c448d033d15 Mon Sep 17 00:00:00 2001 From: Jack Dunn Date: Fri, 27 Aug 2021 11:00:43 -0400 Subject: [PATCH] Save losses in CV output --- src/GLMNet.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GLMNet.jl b/src/GLMNet.jl index eeb2122..d2920d6 100644 --- a/src/GLMNet.jl +++ b/src/GLMNet.jl @@ -501,6 +501,7 @@ struct GLMNetCrossValidation lambda::Vector{Float64} meanloss::Vector{Float64} stdloss::Vector{Float64} + losses::Vector{Vector{Float64}} end function show(io::IO, cv::GLMNetCrossValidation) @@ -612,7 +613,7 @@ function glmnetcv(X::AbstractMatrix, y::Union{AbstractVector{<:Number},AbstractM stdloss[i] = sqrt(stdloss[i]/length(folds)/(nfolds - 1)) end - GLMNetCrossValidation(path, nfolds, path.lambda, meanloss, stdloss) + GLMNetCrossValidation(path, nfolds, path.lambda, meanloss, stdloss, losses) end