slope 6.2.1
Loading...
Searching...
No Matches
poisson.h
Go to the documentation of this file.
1
9#pragma once
10
11#include "loss.h"
12
13namespace slope {
24class Poisson : public Loss
25{
26
27public:
28 explicit Poisson()
29 : Loss(std::numeric_limits<double>::infinity())
30 {
31 }
32
41 double loss(const Eigen::MatrixXd& eta, const Eigen::MatrixXd& y) override;
42
50 double dual(const Eigen::MatrixXd& theta,
51 const Eigen::MatrixXd& y,
52 const Eigen::VectorXd& w) override;
53
60 Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd& eta) override;
61
70 Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd& y) override;
71
82 void updateIntercept(Eigen::VectorXd& beta0,
83 const Eigen::MatrixXd& eta,
84 const Eigen::MatrixXd& y) override;
85
91 Eigen::MatrixXd link(const Eigen::MatrixXd& mu) override;
92
98 Eigen::MatrixXd inverseLink(const Eigen::MatrixXd& eta) override;
99
107 Eigen::MatrixXd predict(const Eigen::MatrixXd& eta) override;
108};
109
110} // namespace slope
Loss function interface.
Definition loss.h:21
The Poisson class represents a Poisson regression loss function.
Definition poisson.h:25
Eigen::MatrixXd predict(const Eigen::MatrixXd &eta) override
Return predicted response, that is 0 or 1 depending on the predicted probabilities.
void updateIntercept(Eigen::VectorXd &beta0, const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y) override
Updates the intercept with a gradient descent update. Unlike the Quadratic and Logistic cases,...
double dual(const Eigen::MatrixXd &theta, const Eigen::MatrixXd &y, const Eigen::VectorXd &w) override
Calculates the Fenchel conjugate (dual) of the Poisson loss.
double loss(const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y) override
Calculates the negative log-likelihood loss for the Poisson regression.
Eigen::MatrixXd inverseLink(const Eigen::MatrixXd &eta) override
The inverse link function, also known as the mean function.
Eigen::MatrixXd link(const Eigen::MatrixXd &mu) override
The link function.
Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd &y) override
Preprocesses the response for the Poisson model.
Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd &eta) override
Calculates hessian diagonal.
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