ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
SRMeanOfMeansStrategy.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "models/Strategy.hpp"
6
7namespace ppforest2::sr {
16 void to_json(nlohmann::json& j) const override;
17 std::string display_name() const override { return "Mean of means"; }
18
20 types::FeatureMatrix const& group_2,
21 pp::Projector const& projector) const override;
22
23 static SRStrategy::Ptr from_json(nlohmann::json const& j);
24
26 };
27
30}
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:100
types::FeatureVector Projector
Column vector of projection coefficients (one per variable).
Definition Projector.hpp:6
Split rule strategies for computing decision thresholds.
Definition SRMeanOfMeansStrategy.hpp:7
SRStrategy::Ptr mean_of_means()
Factory function for a mean-of-means split strategy.
Eigen::Matrix< Feature, Eigen::Dynamic, Eigen::Dynamic > FeatureMatrix
Dynamic-size matrix of feature values.
Definition Types.hpp:24
float Feature
Scalar type for feature values (float or double).
Definition Types.hpp:17
std::shared_ptr< SRStrategy > Ptr
Definition Strategy.hpp:24
Split threshold as the mean of two group means.
Definition SRMeanOfMeansStrategy.hpp:15
void to_json(nlohmann::json &j) const override
Serialize this strategy's configuration to JSON.
std::string display_name() const override
Human-readable name for display in summaries.
Definition SRMeanOfMeansStrategy.hpp:17
types::Feature threshold(types::FeatureMatrix const &group_1, types::FeatureMatrix const &group_2, pp::Projector const &projector) const override
Compute the split threshold for two groups.
static SRStrategy::Ptr from_json(nlohmann::json const &j)
Abstract strategy for computing the split threshold.
Definition SRStrategy.hpp:29