slope 6.2.1
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);
47
59 double dual(const Eigen::MatrixXd& theta,
60 const Eigen::MatrixXd& y,
61 const Eigen::VectorXd& w);
62
69 Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd& eta);
70
78 Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd& y);
79
94 void updateWeightsAndWorkingResponse(Eigen::MatrixXd& w,
95 Eigen::MatrixXd& z,
96 const Eigen::MatrixXd& eta,
97 const Eigen::MatrixXd& y);
98
104 Eigen::MatrixXd link(const Eigen::MatrixXd& mu);
105
111 Eigen::MatrixXd inverseLink(const Eigen::MatrixXd& eta);
112
118 Eigen::MatrixXd predict(const Eigen::MatrixXd& eta);
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)
Computes the dual function for the quadratic loss.
Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd &y)
Preprocesses the response for the quadratic model.
Eigen::MatrixXd inverseLink(const Eigen::MatrixXd &eta)
The link function, also known as the mean function.
Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd &eta)
Calculates hessian diagonal.
double loss(const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y)
Calculates the quadratic (least-squares) loss.
Eigen::MatrixXd predict(const Eigen::MatrixXd &eta)
Return predicted response, which is the same as the linear predictor.
Eigen::MatrixXd link(const Eigen::MatrixXd &mu)
The link function.
void updateWeightsAndWorkingResponse(Eigen::MatrixXd &w, Eigen::MatrixXd &z, const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y)
Updates weights and working response for IRLS algorithm.
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