slope 6.2.1
Loading...
Searching...
No Matches
multinomial.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "loss.h"
9
10namespace slope {
21class Multinomial : public Loss
22{
23public:
24 explicit Multinomial()
25 : Loss(1.0)
26 {
27 }
35 double loss(const Eigen::MatrixXd& eta, const Eigen::MatrixXd& y);
36
44 double dual(const Eigen::MatrixXd& theta,
45 const Eigen::MatrixXd& y,
46 const Eigen::VectorXd& w);
47
54 Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd& y);
55
62 Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd& eta);
63
69 Eigen::MatrixXd link(const Eigen::MatrixXd& mu);
70
77 Eigen::MatrixXd inverseLink(const Eigen::MatrixXd& eta);
78
85 Eigen::MatrixXd predict(const Eigen::MatrixXd& eta);
86};
87
88} // namespace slope
Loss function interface.
Definition loss.h:21
The Multinomial class represents a multinomial logistic regression loss function.
Definition multinomial.h:22
double dual(const Eigen::MatrixXd &theta, const Eigen::MatrixXd &y, const Eigen::VectorXd &w)
Calculates the dual for the multinomial loss function.
Eigen::MatrixXd hessianDiagonal(const Eigen::MatrixXd &eta)
Calculates the hessian diagonal.
Eigen::MatrixXd inverseLink(const Eigen::MatrixXd &eta)
The inverse link function.
Eigen::MatrixXd preprocessResponse(const Eigen::MatrixXd &y)
Preprocesses the response for the Multinomial model.
Eigen::MatrixXd predict(const Eigen::MatrixXd &eta)
Return predicted response, which is an integer class label based on the predicted probabilities.
Eigen::MatrixXd link(const Eigen::MatrixXd &mu)
The link function.
double loss(const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y)
Calculates the loss for the multinomial loss function.
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