A standard decision tree searches every candidate threshold for the best split. Extremely randomized trees skip that search: for a chosen feature they draw one threshold uniformly between the feature's minimum and maximum in the node, and keep the better of the random choices across features.
Implement extra_tree_split(x, y, seed) for one feature x and binary labels y in {0, 1}. Return (threshold, gain).
lo = x.min() and hi = x.max(). If lo == hi, return (None, 0.0).rng = np.random.default_rng(seed) and set threshold = rng.uniform(lo, hi).x <= threshold left and the rest right.x and y must have the same length, otherwise raise ValueError.Use the exact call rng.uniform(lo, hi) so the threshold is reproducible from the seed.
No results yet
Run your code to check it against the examples, or submit to run every test.