SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.11132 · ICML · 2020

Born-Again Tree Ensembles

Thibaut Vidal, Toni Pacheco, Maximilian Schiffer

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2003.11132.json · badge: /api/ran/2003.11132.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
vidalt/BA-Trees canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_info_from_dataset Ran
ran on a synthesized input
vidalt/BA-Trees/src/persistence.py
code served (permissive licence) · get_code("4eaf4c6f3327f98a")
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, ndim 2, 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

# Create small dataset
np.random.seed(0)
n_samples = 10
n_features = 4
n_classes = 3
n_outputs = 1
maxTreeDepth = 3
n_nodes = 7

# X: feature matrix (10 samples, 4 features)
X = np.random.randn(n_samples, n_features).astype(np.float32)

# y: class labels (10 samples, values 0-2)
y = np.random.randint(0, n_classes, n_samples).astype(np.int32)

# Tree structure arrays
children_left = np.array([1, 3, -1, -1, -1, -1, -1], dtype=np.int32)
children_right = np.array([2, 4, -1, -1, -1, -1, -1], dtype=np.int32)
features = np.array([0, 1, 0, 2, 3, 1, 2], dtype=np.int32)
thresholds = np.array([0.0, 0.5, 0.2, -0.3, 0.8, 0.1, -0.1], dtype=np.float32)

# values array: shape (n_nodes, n_outputs, n_classes)
values = np.zeros((n_nodes, n_outputs, n_classes), dtype=np.float32)

ARGS = {
    'X': X,
    'y': y,
    'n_features': n_features,
    'n_classes': np.array([n_classes], dtype=np.int32),
    'n_outputs': n_outputs,
    'maxTreeDepth': maxTreeDepth,
    'n_nodes': n_nodes,
    'children_left': children_left,
    'children_right': children_right,
    'features': features,
    'thresholds': thresholds,
    'values': values,
    'compute_score': True
}
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, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
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
create_nodes Ran
ran on a synthesized input
vidalt/BA-Trees/src/persistence.py
code served (permissive licence) · get_code("4ec96334e24c80af")
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

# Build small decision tree structure arrays
n_nodes_param = 7
n_outputs = 1
n_classes_param = [3]  # 3 classes
pruning = False

# Create tree structure with 7 nodes (indices 0-6)
# Tree structure: internal nodes have children, leaf nodes have children_left == children_right
children_left = np.array([1, 3, -1, 5, -1, -1, -1], dtype=np.int64)
children_right = np.array([2, 4, -1, 6, -1, -1, -1], dtype=np.int64)

# Features used at split nodes (leaf nodes don't use features, use -2)
features = np.array([0, 1, -2, 0, -2, -2, -2], dtype=np.int64)

# Thresholds for splits
thresholds = np.array([0.5, 1.5, 0.0, 2.5, 0.0, 0.0, 0.0], dtype=np.float64)

# Impurity values
impurities = np.array([0.6, 0.5, 0.0, 0.3, 0.0, 0.0, 0.0], dtype=np.float64)

# Number of samples at each node
n_samples = np.array([100, 60, 40, 30, 30, 15, 15], dtype=np.int64)

# Normalized number of samples
n_samples_norm = np.array([1.0, 0.6, 0.4, 0.3, 0.3, 0.15, 0.15], dtype=np.float64)

# Actual values (class counts) - shape (n_nodes, n_classes)
actual_values = np.array([
    [30, 40, 30],
    [25, 20, 15],
    [5, 20, 15],
    [15, 10, 5],
    [10, 10, 10],
    [8, 5, 2],
    [7, 5, 3]
], dtype=np.float64)

ARGS = {
    'n_nodes': n_nodes_param,
    'n_outputs': n_outputs,
    'n_classes': n_classes_param,
    'children_left': children_left,
    'children_right': children_right,
    'features': features,
    'thresholds': thresholds,
    'actual_values': actual_values,
    'impurities': impurities,
    'n_samples': n_samples,
    'n_samples_norm': n_samples_norm,
    'pruning': pruning
}
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
importTreeCollection Ran
ran on a synthesized input
vidalt/BA-Trees/src/persistence.py
code served (permissive licence) · get_code("6ab0f9698e827fab")
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 tempfile
import os

# Create a temporary file with the expected format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_filename = temp_file.name

# Write a valid tree collection file
file_content = """DATASET_NAME: iris
ENSEMBLE: RandomForest
NB_TREES: 2
NB_FEATURES: 4
NB_CLASSES: 3
MAX_TREE_DEPTH: 5

[TREE 0]
n_nodes: 5
0 IN 1 2 0 0.5 0 0
1 LN 3 4 1 1.5 1 1
2 LN -1 -1 2 2.5 1 2
3 LN -1 -1 3 3.5 2 1
4 LN -1 -1 4 4.5 2 0

[TREE 1]
n_nodes: 3
0 IN 1 2 1 1.2 0 1
1 LN -1 -1 0 0.8 1 0
2 LN -1 -1 2 2.1 1 2
"""

temp_file.write(file_content)
temp_file.close()

ARGS = {
    'datasetName': temp_filename,
    'silent': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
to_dot_format Ran
ran on a synthesized input
vidalt/BA-Trees/src/visualization.py
code served (permissive licence) · get_code("46e2c2857115a244")
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 str. 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 sklearn.tree import DecisionTreeClassifier

# Create a simple decision tree
X = np.array([[0, 0], [1, 1], [2, 2], [3, 3]])
y = np.array([0, 1, 0, 1])

dt = DecisionTreeClassifier(max_depth=2, random_state=42)
dt.fit(X, y)

# Extract the tree object from sklearn's internal structure
trees = [dt.tree_]

features = {
    0: 'feature_0',
    1: 'feature_1'
}

classes = {
    0: 'Class_A',
    1: 'Class_B'
}

colors = ['#ff9999', '#66b3ff', '#99ff99', '#ffcc99']

ARGS = {
    'trees': trees,
    'features': features,
    'classes': classes,
    'colors': colors,
    'simplified': True,
    'gini': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 4 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-22.

Repositories linked to this paper

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

Abstract

The use of machine learning algorithms in finance, medicine, and criminal justice can deeply impact human lives. As a consequence, research into interpretable machine learning has rapidly grown in an attempt to better control and fix possible sources of mistakes and biases. Tree ensembles offer a good prediction quality in various domains, but the concurrent use of multiple trees reduces the interpretability of the ensemble. Against this background, we study born-again tree ensembles, i.e., the process of constructing a single decision tree of minimum size that reproduces the exact same behavior as a given tree ensemble in its entire feature space. To find such a tree, we develop a dynamic-programming based algorithm that exploits sophisticated pruning and bounding rules to reduce the number of recursive calls. This algorithm generates optimal born-again trees for many datasets of practical interest, leading to classifiers which are typically simpler and more interpretable without any other form of compromise.

For agents

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

get_harvested_code_for_paper("2003.11132")
get_code_for_paper("2003.11132")
have("2003.11132")

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

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

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

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

Connect an agent — have() is free.