11 const std::string& loss,
17 std::string solver_choice = solver_type;
19 if (solver_type ==
"auto") {
22 solver_choice = loss ==
"multinomial" ?
"fista" :
"hybrid";
25 if (loss ==
"multinomial" && solver_choice ==
"hybrid") {
26 throw std::invalid_argument(
"multinomial loss is currently not "
27 "supported with the hybrid solver");
30 if (solver_choice ==
"pgd") {
31 return std::make_unique<PGD>(jit_normalization, intercept,
"pgd");
32 }
else if (solver_choice ==
"fista") {
33 return std::make_unique<PGD>(jit_normalization, intercept,
"fista");
34 }
else if (solver_choice ==
"hybrid") {
35 return std::make_unique<Hybrid>(
36 jit_normalization, intercept, update_clusters, cd_iterations);
38 throw std::invalid_argument(
"solver type not recognized");
std::unique_ptr< SolverBase > setupSolver(const std::string &solver_type, const std::string &loss, JitNormalization jit_normalization, bool intercept, bool update_clusters, int cd_iterations)
Factory function to create and configure a SLOPE solver.