Skip to content

Add regression tests for min_samples_split boundary and tree depth after #464 #465

Description

@genefold-ai

Follow-up to #464 (off-by-one fix in the tree growth loop).

Two gaps in the current coverage:

  1. No regression test for the min_samples_split boundary. A small test with min_samples_split: 3 and a node of exactly 3 samples would explicitly pin the fixed n >= min_samples_split split rule (n < min_samples_split in find_best_cutoff). The inverse case (min_samples_split: 4, 3 samples) should stay a single leaf.
  2. tree.depth() on the classifier is unverified. The full_depth test asserts nodes().len() == 7 and accuracy, but not tree.depth() == 3. Since pub fn depth() is public API and the loop no longer drives the depth counter directly, an explicit assertion would guard against silent regressions.

Not a blocker for #464, but worth a follow-up. Proposed in the same PR as a patch version bump; library code is unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions