slope 0.29.0
Loading...
Searching...
No Matches
solver.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "../jit_normalization.h"
9#include "../losses/loss.h"
10#include "../sorted_l1_norm.h"
11#include <Eigen/Core>
12#include <Eigen/SparseCore>
13#include <memory>
14
15namespace slope {
16
30{
31public:
44
46 virtual ~SolverBase() = default;
47
64 virtual void run(Eigen::VectorXd& beta0,
65 Eigen::VectorXd& beta,
66 Eigen::MatrixXd& eta,
67 const Eigen::ArrayXd& lambda,
68 const std::unique_ptr<Loss>& loss,
69 const SortedL1Norm& penalty,
70 const Eigen::VectorXd& gradient,
71 const std::vector<int>& working_set,
72 const Eigen::MatrixXd& x,
73 const Eigen::VectorXd& x_centers,
74 const Eigen::VectorXd& x_scales,
75 const Eigen::MatrixXd& y) = 0;
76
93 virtual void run(Eigen::VectorXd& beta0,
94 Eigen::VectorXd& beta,
95 Eigen::MatrixXd& eta,
96 const Eigen::ArrayXd& lambda,
97 const std::unique_ptr<Loss>& loss,
98 const SortedL1Norm& penalty,
99 const Eigen::VectorXd& gradient,
100 const std::vector<int>& working_set,
101 const Eigen::SparseMatrix<double>& x,
102 const Eigen::VectorXd& x_centers,
103 const Eigen::VectorXd& x_scales,
104 const Eigen::MatrixXd& y) = 0;
105
106protected:
109};
110
111} // namespace slope
Abstract base class for SLOPE optimization solvers.
Definition solver.h:30
virtual 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::SparseMatrix< double > &x, const Eigen::VectorXd &x_centers, const Eigen::VectorXd &x_scales, const Eigen::MatrixXd &y)=0
Pure virtual function defining the solver's optimization routine.
virtual ~SolverBase()=default
Default desstructor.
JitNormalization jit_normalization
JIT feature normalization strategy.
Definition solver.h:107
bool intercept
If true, fits intercept term.
Definition solver.h:108
SolverBase(JitNormalization jit_normalization, bool intercept)
Constructs a base solver for SLOPE optimization.
Definition solver.h:39
virtual 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)=0
Pure virtual function defining the solver's optimization routine.
Class representing the Sorted L1 Norm.
Namespace containing SLOPE regression implementation.
Definition clusters.cpp:5
JitNormalization
Enums to control predictor standardization behavior.