9#include "../clusters.h"
10#include "../losses/loss.h"
11#include "../sorted_l1_norm.h"
50 , update_clusters(update_clusters)
51 , cd_iterations(cd_iterations)
56 void run(Eigen::VectorXd& beta0,
57 Eigen::VectorXd& beta,
59 const Eigen::ArrayXd& lambda,
60 const std::unique_ptr<Loss>& loss,
62 const Eigen::VectorXd& gradient,
63 const std::vector<int>& working_set,
64 const Eigen::MatrixXd& x,
65 const Eigen::VectorXd& x_centers,
66 const Eigen::VectorXd& x_scales,
67 const Eigen::MatrixXd& y)
override;
70 void run(Eigen::VectorXd& beta0,
71 Eigen::VectorXd& beta,
73 const Eigen::ArrayXd& lambda,
74 const std::unique_ptr<Loss>& loss,
76 const Eigen::VectorXd& gradient,
77 const std::vector<int>& working_set,
78 const Eigen::SparseMatrix<double>& x,
79 const Eigen::VectorXd& x_centers,
80 const Eigen::VectorXd& x_scales,
81 const Eigen::MatrixXd& y)
override;
98 template<
typename MatrixType>
99 void runImpl(Eigen::VectorXd& beta0,
100 Eigen::VectorXd& beta,
101 Eigen::MatrixXd& eta,
102 const Eigen::ArrayXd& lambda,
103 const std::unique_ptr<Loss>& loss,
105 const Eigen::VectorXd& gradient_in,
106 const std::vector<int>& working_set,
108 const Eigen::VectorXd& x_centers,
109 const Eigen::VectorXd& x_scales,
110 const Eigen::VectorXd& y)
112 using Eigen::MatrixXd;
113 using Eigen::VectorXd;
115 const int n = x.rows();
120 pgd_solver.run(beta0,
135 VectorXd w = VectorXd::Ones(n);
137 loss->updateWeightsAndWorkingResponse(w, z, eta, y);
139 VectorXd residual = eta - z;
141 for (
int it = 0; it < this->cd_iterations; ++it) {
153 this->update_clusters);
162 double pgd_learning_rate =
164 double pgd_learning_rate_decr =
166 bool update_clusters =
false;
167 int cd_iterations = 10;
Representation of the clusters in SLOPE.
Hybrid CD-PGD solver for SLOPE.
Hybrid(JitNormalization jit_normalization, bool intercept, bool update_clusters, int cd_iterations)
Constructs Hybrid solver for SLOPE optimization.
void run(Eigen::VectorXd &beta0, Eigen::VectorXd &beta, Eigen::MatrixXd &eta, const Eigen::ArrayXd &lambda, const std::unique_ptr< Loss > &loss, const SortedL1Norm &penalty, const Eigen::VectorXd &gradient, const std::vector< int > &working_set, const Eigen::MatrixXd &x, const Eigen::VectorXd &x_centers, const Eigen::VectorXd &x_scales, const Eigen::MatrixXd &y) override
Pure virtual function defining the solver's optimization routine.
Proximal Gradient Descent solver for SLOPE optimization.
Abstract base class for SLOPE optimization solvers.
JitNormalization jit_normalization
JIT feature normalization strategy.
bool intercept
If true, fits intercept term.
Class representing the Sorted L1 Norm.
An implementation of the coordinate descent step in the hybrid algorithm for solving SLOPE.
Namespace containing SLOPE regression implementation.
JitNormalization
Enums to control predictor standardization behavior.
void coordinateDescent(Eigen::VectorXd &beta0, Eigen::VectorXd &beta, Eigen::VectorXd &residual, Clusters &clusters, const Eigen::ArrayXd &lambda, const T &x, const Eigen::VectorXd &w, const Eigen::VectorXd &x_centers, const Eigen::VectorXd &x_scales, const bool intercept, const JitNormalization jit_normalization, const bool update_clusters)
Proximal Gradient Descent solver implementation for SLOPE.
Numerical solver class for SLOPE (Sorted L-One Penalized Estimation)