SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.22740 · 2026

Ternary Decision Trees with Locally-Adaptive Uncertainty Zones

William Smits

arXiv · PDF

Code that ran

16 of 22 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 5 honoured the contract we drafted, 2 violated it and 2 have no contract verdict; 7 failures of our instrument; 6 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2605.22740.json · badge: /api/ran/2605.22740.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
smitswil/ternary_tree community
Papers with Code archive
16 ran · 6 no recorded run
FunctionStatusWhere it lives
LeafNode Ran
ran on a synthesized input · constructed an object; no result was computed
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("d9b4d46de383d453")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LeafNode: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from dataclasses import dataclass

@dataclass
class LeafNode:
    class_proba: np.ndarray
    predicted_class: int
    n_samples: int
    is_middle_leaf: bool = False

    def __repr__(self):
        return f'LeafNode(class={self.predicted_class}, n={self.n_samples}, proba={self.class_proba.round(3)})'


# Set random seed for reproducibility
np.random.seed(0)

# Create valid arguments for LeafNode
ARGS = {
    'class_proba': np.array([0.1, 0.3, 0.6]),
    'predicted_class': 2,
    'n_samples': 42,
    'is_middle_leaf': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LeafNode — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LeafNode output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SplitNode Ran
ran on a synthesized input · constructed an object; no result was computed
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("5c414ae59e47f2bf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, SplitNode: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from dataclasses import dataclass
from typing import Optional, Union

NodeType = Union['SplitNode', 'LeafNode']

@dataclass
class LeafNode:
    value: float
    n_samples: int = 0
    impurity: float = 0.0
    
    def __repr__(self):
        return f'LeafNode(value={self.value:.4g}, n={self.n_samples})'

@dataclass
class SplitNode:
    feature_idx: int
    threshold: float
    delta: float
    left: NodeType
    right: NodeType
    middle: Optional[NodeType] = None
    n_samples: int = 0
    impurity: float = 0.0

    def __repr__(self):
        return f'SplitNode(feat={self.feature_idx}, θ={self.threshold:.4g}, δ={self.delta:.4g}, n={self.n_samples})'

# Create leaf nodes for the tree structure
left_leaf = LeafNode(value=0.5, n_samples=10, impurity=0.2)
right_leaf = LeafNode(value=1.5, n_samples=15, impurity=0.3)
middle_leaf = LeafNode(value=1.0, n_samples=5, impurity=0.1)

# Construct ARGS dictionary with all parameters
ARGS = {
    'feature_idx': 2,
    'threshold': 0.75,
    'delta': 0.05,
    'left': left_leaf,
    'right': right_leaf,
    'middle': middle_leaf,
    'n_samples': 30,
    'impurity': 0.25
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SplitNode — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SplitNode output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_clamp_delta Ran
ran; our contract draft was wrong, not the code
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("94900c8e21a28995")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct arguments for _clamp_delta function
delta = 0.5
col = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

ARGS = {
    "delta": delta,
    "col": col,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_entropy Ran
ran, honoured the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("00d98be6246b9c93")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The _entropy function takes a probability distribution as a numpy array
# and computes entropy. It filters out zero probabilities and computes
# Shannon entropy in bits using log2.

# Create a small valid probability distribution
probs = np.array([0.2, 0.3, 0.5, 0.0])

ARGS = {
    "probs": probs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_gini Ran
ran, violated the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("8e3965d6334072f6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function _gini takes a probability array and computes the Gini coefficient
# It uses: np.sum(probs ** 2) which requires a numpy array
# The array should represent probabilities, so values between 0 and 1, summing to 1

# Create a simple probability distribution
probs = np.array([0.25, 0.25, 0.25, 0.25])

ARGS = {
    "probs": probs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_split_entropy Ran
ran, honoured the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("1ae014b8576fc2da")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

def _split_entropy(left_w: float, right_w: float, total_w: float) -> float:
    """Binary entropy of the split proportions (used for gain ratio)."""
    result = 0.0
    for w in (left_w, right_w):
        p = w / total_w
        if p > 0:
            result -= p * np.log2(p)
    return result

ARGS = {
    "left_w": 30.0,
    "right_w": 70.0,
    "total_w": 100.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_class_probabilities Ran
ran, honoured the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("28facaf62bfcafb0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (3,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create small sample data
y = np.array([0, 1, 0, 1, 2, 0, 1, 2])  # class labels
sample_weight = np.array([1.0, 2.0, 1.5, 2.5, 1.0, 0.5, 1.5, 2.0])  # weights for each sample
classes = np.array([0, 1, 2])  # unique classes

ARGS = {
    "y": y,
    "sample_weight": sample_weight,
    "classes": classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (3,) — shape (3,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_sample_weight Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("4699fc60a8f27940")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (7,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small sample dataset with 3 classes
y = np.array([0, 1, 2, 0, 1, 2, 0], dtype=int)
classes = np.array([0, 1, 2])

# Test case 1: class_weight is None
ARGS = {
    'y': y,
    'class_weight': None,
    'classes': classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (7,) — shape (7,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
delta_class_overlap Ran
ran, honoured the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("aea0400d00ca24f9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct arguments for delta_class_overlap
np.random.seed(0)

# Create a feature column with some variation
col = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], dtype=np.float64)

# Create class labels - two classes with some overlap
y = np.array([0, 0, 0, 0, 1, 1, 1, 1], dtype=np.int64)

# Define all unique classes
classes = np.array([0, 1], dtype=np.int64)

# Percentile parameter
percentile = 10.0

ARGS = {
    "col": col,
    "y": y,
    "classes": classes,
    "percentile": percentile,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
delta_gain_ratio Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("03f68c8aa56c9418")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small feature column with some range
col = np.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=np.float32)

# Create realistic parameters
best_score = 0.5  # Information gain value
best_split_info = 0.8  # Split entropy value
alpha = 0.1  # Global scale parameter

ARGS = {
    "col": col,
    "best_score": best_score,
    "best_split_info": best_split_info,
    "alpha": alpha,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
delta_margin Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("cfad436faae5d3c7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create a feature column with some variation
col = np.array([1.0, 2.5, 3.0, 4.5, 5.0, 6.5, 7.0, 8.5], dtype=np.float64)

# Create class labels - binary classification
y = np.array([0, 0, 0, 0, 1, 1, 1, 1], dtype=np.int32)

# Choose a threshold that splits the data
theta = 4.7

# Get unique classes
classes = np.unique(y)

ARGS = {
    "col": col,
    "y": y,
    "theta": theta,
    "classes": classes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
delta_node_bootstrap Ran
ran, honoured the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("8c2355482782d237")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Define the helper functions that are used by delta_node_bootstrap
def _gini(probs: np.ndarray) -> float:
    return 1.0 - float(np.sum(probs ** 2))

def _entropy(probs: np.ndarray) -> float:
    p = probs[probs > 0]
    return float(-np.sum(p * np.log2(p)))

def _split_entropy(left_w: float, right_w: float, total_w: float) -> float:
    """Binary entropy of the split proportions (used for gain ratio)."""
    result = 0.0
    for w in (left_w, right_w):
        p = w / total_w
        if p > 0:
            result -= p * np.log2(p)
    return result

def evaluate_all_thresholds(col: np.ndarray, y: np.ndarray, sample_weight: np.ndarray, classes: np.ndarray, criterion: str='gini'):
    """Evaluate split quality for every candidate threshold on one feature."""
    n = len(col)
    n_classes = len(classes)
    cls_idx = {c: i for i, c in enumerate(classes)}
    sort_idx = np.argsort(col, kind='mergesort')
    col_s = col[sort_idx]
    y_s = y[sort_idx]
    sw_s = sample_weight[sort_idx]
    wc = np.zeros((n, n_classes), dtype=np.float64)
    for i in range(n):
        wc[i, cls_idx[y_s[i]]] = sw_s[i]
    cum_wc = np.cumsum(wc, axis=0)
    cum_total = np.cumsum(sw_s, dtype=float)
    total_w = float(sw_s.sum())
    total_cls_w = wc.sum(axis=0)
    parent_probs = total_cls_w / total_w
    if criterion == 'gini':
        parent_imp = _gini(parent_probs)
    else:
        parent_imp = _entropy(parent_probs)
    candidates = []
    scores = []
    split_infos = []
    for i in range(n - 1):
        if col_s[i] == col_s[i + 1]:
            continue
        theta = (col_s[i] + col_s[i + 1]) / 2.0
        left_w = float(cum_total[i])
        right_w = total_w - left_w
        if left_w < 1e-10 or right_w < 1e-10:
            continue
        left_cls_w = cum_wc[i]
        right_cls_w = total_cls_w - left_cls_w
        lp = left_cls_w / left_w
        rp = right_cls_w / right_w
        if criterion == 'gini':
            left_imp = _gini(lp)
            right_imp = _gini(rp)
        else:
            left_imp = _entropy(lp)
            right_imp = _entropy(rp)
        gain = parent_imp - (left_w / total_w * left_imp + right_w / total_w * right_imp)
        si = _split_entropy(left_w, right_w, total_w)
        candidates.append(theta)
        scores.append(gain)
        split_infos.append(si)
    return (np.array(candidates, dtype=np.float64), np.array(scores, dtype=np.float64), parent_imp, np.array(split_infos, dtype=np.float64))

# Create test data
np.random.seed(0)
col = np.array([1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0], dtype=np.float64)
y = np.array([0, 0, 0, 1, 1, 1, 2, 2, 2, 2], dtype=np.int64)
sample_weight = np.ones(10, dtype=np.float64)
classes = np.array([0, 1, 2], dtype=np.int64)

# Pre-compute candidates using evaluate_all_thresholds
candidates, _, _, _ = evaluate_all_thresholds(col, y, sample_weight, classes, criterion='gini')

ARGS = {
    'col': col,
    'y': y,
    'sample_weight': sample_weight,
    'classes': classes,
    'candidates': candidates,
    'criterion': 'gini',
    'n_bootstraps': 5,
    'rng': np.random.default_rng(42),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
delta_quality_plateau Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("cb4158509bf166ae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create candidate thresholds - sorted array of floats
candidates = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])

# Create quality scores corresponding to each candidate threshold
# Scores should be positive and have some variation
scores = np.array([0.3, 0.5, 0.7, 0.85, 0.9, 0.88, 0.82, 0.6, 0.4])

# Best score - the maximum quality achieved
best_score = 0.9

# Feature column - array of feature values for range clamping
# Use values with a reasonable range to test clamping
col = np.array([1.0, 2.5, 3.2, 4.8, 5.1, 6.3, 7.9, 8.5])

# Epsilon parameter for tolerance
epsilon = 0.05

ARGS = {
    "candidates": candidates,
    "scores": scores,
    "best_score": best_score,
    "col": col,
    "epsilon": epsilon,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate_all_thresholds Ran
ran; our contract draft was wrong, not the code
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("2035c0c6f205f2a4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small synthetic data
n_samples = 8
n_classes = 3

# Feature column: continuous values
col = np.array([1.2, 2.3, 2.5, 3.1, 3.8, 4.2, 5.1, 5.9], dtype=np.float64)

# Class labels
y = np.array([0, 1, 0, 2, 1, 0, 2, 1], dtype=np.int64)

# Sample weights (all equal in this case)
sample_weight = np.ones(n_samples, dtype=np.float64)

# Sorted unique class labels
classes = np.array([0, 1, 2], dtype=np.int64)

# Criterion for impurity
criterion = 'gini'

ARGS = {
    'col': col,
    'y': y,
    'sample_weight': sample_weight,
    'classes': classes,
    'criterion': criterion
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_best_split Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("efda451b6639d43b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seeds for reproducibility
np.random.seed(0)

# Create small sample dataset
n_samples = 8
n_features = 4
n_classes = 3

# Feature matrix: shape (n_samples, n_features)
X = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [1.5, 2.5, 3.5, 4.5],
    [2.0, 3.0, 4.0, 5.0],
    [2.5, 3.5, 4.5, 5.5],
    [3.0, 4.0, 5.0, 6.0],
    [3.5, 4.5, 5.5, 6.5],
    [4.0, 5.0, 6.0, 7.0],
    [4.5, 5.5, 6.5, 7.5],
], dtype=np.float64)

# Class labels: shape (n_samples,)
y = np.array([0, 1, 2, 0, 1, 2, 0, 1], dtype=np.int64)

# Sample weights: shape (n_samples,)
sample_weight = np.array([1.0, 1.0, 1.0, 1.0, 1.5, 1.5, 1.0, 1.0], dtype=np.float64)

# Unique sorted class labels
classes = np.array([0, 1, 2], dtype=np.int64)

# Criterion for split quality
criterion = 'gini'

# Feature indices to consider (optional, can be None)
feature_indices = np.array([0, 1, 2, 3], dtype=np.int64)

ARGS = {
    'X': X,
    'y': y,
    'sample_weight': sample_weight,
    'classes': classes,
    'criterion': criterion,
    'feature_indices': feature_indices,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_pure Ran
ran, violated the contract we drafted
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("582145c98723d35a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create test cases for is_pure function
# The function checks if all elements in a numpy array are the same (unique values <= 1)

# Case 1: Pure array - all same values
y_pure = np.array([5, 5, 5, 5])

# Case 2: Not pure - multiple different values
y_not_pure = np.array([1, 2, 3, 4])

# Case 3: Pure array with single element
y_single = np.array([42])

# Case 4: Pure array with zeros
y_zeros = np.array([0, 0, 0])

ARGS = {
    "y": y_pure
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TrinaryTree Not yet run
unverified (harvested, no recorded run)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("d63c080a421e4b93")
How it ran

no invocation recorded.

_accumulate_importances Not yet run
unverified (harvested, no recorded run)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("aacb6d6651dccc13")
How it ran

no invocation recorded.

_count_leaves Not yet run
unverified (harvested, no recorded run)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("91647e60960530a6")
How it ran

no invocation recorded.

_count_middle_leaves Not yet run
unverified (harvested, no recorded run)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("30f7e53291937ba7")
How it ran

no invocation recorded.

_tree_depth Not yet run
unverified (harvested, no recorded run)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("dc1828717973b12a")
How it ran

no invocation recorded.

compute_delta Not yet run
unverified (harvested, no recorded run)
smitswil/ternary_tree/ternary_tree/trinary_tree.py
code served (permissive licence) · get_code("5b85dcc53fc482fb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 22 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Decision trees partition the feature space using hard binary thresholds, assigning identical confidence to instances far from a decision boundary and to those directly on it. We introduce ternary decision trees, which augment each split node with an uncertainty zone of half-width δ centred on the optimal threshold. Instances whose feature value falls within this zone receive predictions formed by weighted blending of both child subtrees and are flagged as boundary-uncertain, signalling that downstream applications may wish to treat these predictions differently. Crucially, δ is computed locally at each node from statistics already available during standard CART split finding, requiring no external noise specification and no additional data. We ground this approach in a decision-theoretic framework that characterises the optimal zone half-width δ * at each node as the solution to a local costminimisation problem, and establish four formal properties: an accuracy decomposition, a sufficiency condition for decided accuracy improvement, an exact efficiency characterisation (η = Dec-Acc -Accu, the accuracy gap between decided and boundary-uncertain predictions), and asymptotic consistency of the margin method. We propose and evaluate five δ-estimation methods: quality-plateau (plateau width of the split criterion curve), class-overlap (empirical class-distribution overlap), gainratio (split quality relative to split entropy), node-bootstrap (threshold variance under node-level resampling), and margin (SVM-inspired distance to the nearest cross-class training example). Evaluated across 71 of the 72 OpenML-CC18 datasets with 5-fold cross-validation (one image dataset with d = 3,072 raw pixel features was excluded), all five methods with probabilistic routing significantly outperform standard CART on decided accuracy (Wilcoxon signed-rank, p ≤ 0.001). The margin method achieves the best efficiency (0.104 accuracy gain per unit of boundary-uncertain flagging rate), wins on 42 of 72 datasets, and requires zero additional hyperparameters. Analysis on three Breiman synthetic benchmarks with known Bayes errors reveals that the margin method is self-calibrating on geometrically clean data, while nodebootstrap and quality-plateau maintain the best ratio of flagging rate to theoretical irreducible error. Experiments on four medical and financial datasets demonstrate practical value: on mammography, node-bootstrap achieves +0.71% decided accuracy by flagging 10.8% of screening cases as boundary-uncertain.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2605.22740")
get_code_for_paper("2605.22740")
have("2605.22740")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2605.22740.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2605.22740.svg)](https://syntology.ai/paper/2605.22740)

Connect an agent — have() is free.