|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Test-only fixture that owns the storage backing a NodeContext.
More...
#include <NodeContextFixture.hpp>
Public Member Functions | |
| NodeContextFixture (NodeContextFixture &&)=delete | |
| NodeContextFixture (NodeContextFixture const &)=delete | |
| NodeContextFixture (types::FeatureMatrix x_in, stats::GroupPartition y_part_in, types::OutcomeVector y_vec_in) | |
| NodeContextFixture (types::FeatureMatrix x_in, types::GroupIdVector ids_in) | |
| NodeContextFixture (types::FeatureMatrix x_in, types::OutcomeVector y_vec_in) | |
| NodeContextFixture & | operator= (NodeContextFixture &&)=delete |
| NodeContextFixture & | operator= (NodeContextFixture const &)=delete |
Public Attributes | |
| NodeContext | ctx |
| stats::RNG | rng |
| types::FeatureMatrix | x |
| types::GroupIdVector | y_ids |
| stats::GroupPartition | y_part |
| types::OutcomeVector | y_vec |
Test-only fixture that owns the storage backing a NodeContext.
NodeContext holds non-owning references to a feature matrix, group partition, and outcome vector, so a test must keep those alive separately. This fixture bundles them with an RNG and a fully-wired NodeContext, so each strategy NVI test can stop redeclaring the boilerplate.
Three constructors:
(x, GroupIdVector ids) — classification flavour. y_vec is derived from ids via cast<Outcome>(); the partition is GroupPartition(ids).(x, OutcomeVector y_vec) — regression flavour. y_ids and the partition are a median split matching ByCutpoint::init's behaviour at the root, so tests pass only the continuous response they actually care about.(x, GroupPartition, OutcomeVector y_vec) — escape hatch for tests that need a partition shape neither default produces (e.g. gp.subset(...), custom two_groups(...) bounds). y_ids is left empty in this case since the partition came in pre-built.Public fields so tests can mutate them after construction (e.g. f.x = …, f.ctx.projector = …).
Non-copyable / non-movable: ctx references the other members of the same fixture, so any copy or move would silently produce dangling references.
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
delete |
|
delete |
| NodeContext ppforest2::test::NodeContextFixture::ctx |
| stats::RNG ppforest2::test::NodeContextFixture::rng |
| types::FeatureMatrix ppforest2::test::NodeContextFixture::x |
| types::GroupIdVector ppforest2::test::NodeContextFixture::y_ids |
| stats::GroupPartition ppforest2::test::NodeContextFixture::y_part |
| types::OutcomeVector ppforest2::test::NodeContextFixture::y_vec |