slope 6.5.4
Loading...
Searching...
No Matches
quadratic.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "loss.h"
13
14namespace slope {
15
27class Quadratic : public Loss
28{
29public:
30 explicit Quadratic()
31 : Loss(1.00)
32 {
33 }
46 double loss(const Eigen::MatrixXd& eta, const Eigen::MatrixXd& y) override;
47
59 double dual(const Eigen::MatrixXd& theta,
60 const Eigen::MatrixXd& y,
61 const Eigen::VectorXd& w) override;
62
69 Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd& eta) override;
70
78 Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd& y) override;
79
94 void updateWeightsAndWorkingResponse(Eigen::MatrixXd& w,
95 Eigen::MatrixXd& z,
96 const Eigen::MatrixXd& eta,
97 const Eigen::MatrixXd& y) override;
98
104 Eigen::MatrixXd link(const Eigen::MatrixXd& mu) override;
105
111 Eigen::MatrixXd inverseLink(const Eigen::MatrixXd& eta) override;
112
118 Eigen::MatrixXd predict(const Eigen::MatrixXd& eta) override;
119};
120
121} // namespace slope
Loss function interface.
Definition loss.h:21
Implementation of the Quadratic loss function.
Definition quadratic.h:28
double dual(const Eigen::MatrixXd &theta, const Eigen::MatrixXd &y, const Eigen::VectorXd &w) override
Computes the dual function for the quadratic loss.
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