19 std::shared_ptr<const DatasetBase> data,
21 std::shared_ptr<const GenericFeatureMatrix> local_features,
23 m_DataSet(std::move(data)), m_LocalFeatures(std::move(local_features)),
24 m_MeanOfAll(
DenseRealVector::Zero(1)), m_PosTarget(pos), m_NegTarget(neg)
27 throw std::logic_error(
"dataset is <null>");
30 throw std::logic_error(
"local features are <null>");
45 const Eigen::Ref<DenseRealVector>& mean_of_positives)
49 real_t PP = mean_of_positives.squaredNorm();
55 if(std::abs(PA) < std::numeric_limits<real_t>::epsilon() ) {
56 if(std::abs(PA) < std::numeric_limits<real_t>::epsilon() ) {
63 if(std::abs(divide) < std::numeric_limits<real_t>::epsilon()) {
64 spdlog::warn(
"Cannot use initialization procedure, mean vectors are not linearly independent.");
78 m_DataSet(std::move(data)),
79 m_NegativeTarget(negative_target),
80 m_PositiveTarget(positive_target) {
82 throw std::logic_error(
"dataset is <null>");
std::shared_ptr< const DatasetBase > m_DataSet
real_t m_MeanAllNormSquared
std::shared_ptr< const GenericFeatureMatrix > m_LocalFeatures
DenseRealVector m_MeanOfAll
std::pair< real_t, real_t > calculate_factors(label_id_t label_id, const Eigen::Ref< DenseRealVector > &mean_of_positives)
BinaryLabelVector m_LabelBuffer
static constexpr stats::stat_id_t STAT_DURATION
SubsetFeatureMeanInitializer(std::shared_ptr< const DatasetBase > data, const DenseRealVector &mean_of_all, std::shared_ptr< const GenericFeatureMatrix > local_features, real_t pos, real_t neg)
SubsetFeatureMeanStrategy(std::shared_ptr< const DatasetBase > data, real_t negative_target, real_t positive_target)
std::shared_ptr< const DatasetBase > m_DataSet
DenseRealVector m_MeanOfAllInstances
Strong typedef for an int to signify a label id.
void declare_stat(stat_id_t index, StatisticMetaData meta)
Declares a new statistics. This function just forwards all its arguments to the internal StatisticsCo...
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.
DenseRealVector get_mean_feature(const GenericFeatureMatrix &features)
float real_t
The default type for floating point values.