11 #include <spdlog/spdlog.h>
17 auto minimizer = std::make_unique<solvers::NewtonWithLineSearch>(data->num_features());
19 auto loss_fn =
make_loss(loss, data->get_features(), std::move(reg));
25 spdlog::info(
"Starting to calculate OVA-Primal init vector");
26 auto result = minimizer->minimize(*loss_fn, target);
28 spdlog::info(
"OVA-Primal init vector has been calculated in {} ms. Loss {} -> {}",
29 result.Duration.count(), result.InitialValue, result.FinalValue);
Base class for objectives that use a linear classifier.
BinaryLabelVector & get_label_ref()
std::shared_ptr< WeightInitializationStrategy > create_constant_initializer(DenseRealVector vec)
std::shared_ptr< WeightInitializationStrategy > create_ova_primal_initializer(const std::shared_ptr< DatasetBase > &data, RegularizerSpec regularizer, LossType loss)
std::unique_ptr< Objective > make_regularizer(const SquaredNormConfig &config)
auto visit(F &&f, Variants &&... variants)
std::shared_ptr< objective::Objective > make_loss(LossType type, std::shared_ptr< const GenericFeatureMatrix > X, std::unique_ptr< objective::Objective > regularizer)
std::variant< objective::SquaredNormConfig, objective::HuberConfig, objective::ElasticConfig > RegularizerSpec
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.