From 344d43bd529612232df33cc5b9b0dab6f7fb91bd Mon Sep 17 00:00:00 2001 From: Wenjie Wang Date: Fri, 5 Jan 2024 14:45:29 -0500 Subject: [PATCH] Group loss/penalty/objective in output --- src/template_helpers.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/template_helpers.h b/src/template_helpers.h index e5d3fc8..e394744 100644 --- a/src/template_helpers.h +++ b/src/template_helpers.h @@ -80,9 +80,11 @@ inline Rcpp::List template_fit(T& object) Rcpp::Named("kappa_ratio") = object.control_.kappa_ratio_, Rcpp::Named("gamma") = object.control_.gamma_ ), - Rcpp::Named("loss") = abclass::arma2rvec(object.loss_), - Rcpp::Named("penalty") = abclass::arma2rvec(object.penalty_), - Rcpp::Named("objective") = abclass::arma2rvec(object.objective_), + Rcpp::Named("optimization") = Rcpp::List::create( + Rcpp::Named("loss") = abclass::arma2rvec(object.loss_), + Rcpp::Named("penalty") = abclass::arma2rvec(object.penalty_), + Rcpp::Named("objective") = abclass::arma2rvec(object.objective_) + ), Rcpp::Named("cross_validation") = cv_res, Rcpp::Named("et") = et_res );