slope 0.29.0
Loading...
Searching...
No Matches
setup_loss.cpp
1#include "setup_loss.h"
2#include "logistic.h"
3#include "multinomial.h"
4#include "poisson.h"
5#include "quadratic.h"
6
7namespace slope {
8
9std::unique_ptr<Loss>
10setupLoss(const std::string& loss)
11{
12 if (loss == "logistic")
13 return std::make_unique<Logistic>();
14 else if (loss == "poisson")
15 return std::make_unique<Poisson>();
16 else if (loss == "multinomial")
17 return std::make_unique<Multinomial>();
18
19 // else Quadratic
20 return std::make_unique<Quadratic>();
21}
22
23}
Logistic loss function implementation for SLOPE algorithm.
Multinomial loss function implementation for SLOPE algorithm.
Namespace containing SLOPE regression implementation.
Definition clusters.cpp:5
std::unique_ptr< Loss > setupLoss(const std::string &loss)
Factory function to create the appropriate loss function based on the distribution family.
Poisson loss function implementation for SLOPE algorithm.
Quadratic loss function implementation for SLOPE algorithm.
Factory function to create the appropriate loss function based on.