slope 6.6.0
Loading...
Searching...
No Matches
quadratic.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "loss.h"
13
14namespace slope {
15
27class Quadratic : public Loss
28{
29public:
31
32 explicit Quadratic()
33 : Loss(1.00)
34 {
35 }
48 double loss(const Eigen::MatrixXd& eta, const Eigen::MatrixXd& y) override;
49
50 double loss(const Eigen::MatrixXd& eta,
51 const Eigen::MatrixXd& y,
52 const Eigen::VectorXd& observation_weights) override;
53
65 double dual(const Eigen::MatrixXd& theta,
66 const Eigen::MatrixXd& y,
67 const Eigen::VectorXd& w) override;
68
75 Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd& eta) override;
76
84 Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd& y) override;
85
100 void updateWeightsAndWorkingResponse(Eigen::MatrixXd& w,
101 Eigen::MatrixXd& z,
102 const Eigen::MatrixXd& eta,
103 const Eigen::MatrixXd& y) override;
104
110 Eigen::MatrixXd link(const Eigen::MatrixXd& mu) override;
111
117 Eigen::MatrixXd inverseLink(const Eigen::MatrixXd& eta) override;
118
124 Eigen::MatrixXd predict(const Eigen::MatrixXd& eta) override;
125};
126
127} // namespace slope
Loss(double lipschitz_constant)
Constructs an loss function with specified Lipschitz constant.
Definition loss.h:213
virtual void updateWeightsAndWorkingResponse(Eigen::MatrixXd &w, Eigen::MatrixXd &z, const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y)
Updates weights and working response.
double dual(const Eigen::MatrixXd &theta, const Eigen::MatrixXd &y, const Eigen::VectorXd &w) override
Computes the dual function for the quadratic loss.
double loss(const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y, const Eigen::VectorXd &observation_weights) override
Calculates the loss averaged by observation weights.
Eigen::MatrixXd inverseLink(const Eigen::MatrixXd &eta) override
The link function, also known as the mean function.
Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd &eta) override
Calculates hessian diagonal.
Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd &y) override
Preprocesses the response for the quadratic model.
void updateWeightsAndWorkingResponse(Eigen::MatrixXd &w, Eigen::MatrixXd &z, const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y) override
Updates weights and working response for IRLS algorithm.
double loss(const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y) override
Calculates the quadratic (least-squares) loss.
Eigen::MatrixXd link(const Eigen::MatrixXd &mu) override
The link function.
Eigen::MatrixXd predict(const Eigen::MatrixXd &eta) override
Return predicted response, which is the same as the linear predictor.
The declartion of the Objctive class and its subclasses, which represent the data-fitting part of the...
Namespace containing SLOPE regression implementation.
Definition clusters.h:11