{
  "provenance": "Original 16-row dimensionless synthetic training example; no validation/test rows or performance estimate.",
  "contract": {
    "classes": [
      0,
      1
    ],
    "routing": "x_j <= s left; x_j > s right",
    "candidate_thresholds": "Midpoints of consecutive distinct values within the active node; nonempty children.",
    "criterion": "Weighted Gini; unweighted observations.",
    "split_ties": "Lower feature index, then lower threshold.",
    "leaf_ties": "Smallest class index; differs from inclusive q>=0.5 binary threshold.",
    "entropy_log": "Natural logarithm; 0 log 0 = 0."
  },
  "rows": [
    {
      "id": "A",
      "x1": 1,
      "x2": 1,
      "y": 0
    },
    {
      "id": "B",
      "x1": 1,
      "x2": 2,
      "y": 0
    },
    {
      "id": "C",
      "x1": 1,
      "x2": 3,
      "y": 1
    },
    {
      "id": "D",
      "x1": 1,
      "x2": 4,
      "y": 1
    },
    {
      "id": "E",
      "x1": 2,
      "x2": 1,
      "y": 1
    },
    {
      "id": "F",
      "x1": 2,
      "x2": 2,
      "y": 1
    },
    {
      "id": "G",
      "x1": 2,
      "x2": 3,
      "y": 1
    },
    {
      "id": "H",
      "x1": 2,
      "x2": 4,
      "y": 1
    },
    {
      "id": "I",
      "x1": 3,
      "x2": 1,
      "y": 1
    },
    {
      "id": "J",
      "x1": 3,
      "x2": 2,
      "y": 1
    },
    {
      "id": "K",
      "x1": 3,
      "x2": 3,
      "y": 1
    },
    {
      "id": "L",
      "x1": 3,
      "x2": 4,
      "y": 1
    },
    {
      "id": "M",
      "x1": 4,
      "x2": 1,
      "y": 1
    },
    {
      "id": "N",
      "x1": 4,
      "x2": 2,
      "y": 1
    },
    {
      "id": "O",
      "x1": 4,
      "x2": 3,
      "y": 1
    },
    {
      "id": "P",
      "x1": 4,
      "x2": 4,
      "y": 1
    }
  ],
  "root": {
    "ids": [
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "G",
      "H",
      "I",
      "J",
      "K",
      "L",
      "M",
      "N",
      "O",
      "P"
    ],
    "n": 16,
    "counts": [
      2,
      14
    ],
    "p_class1": 0.875,
    "class": 1,
    "gini": 0.21875,
    "gini_exact": "7/32",
    "entropy_nats": 0.37677016125643675,
    "majority_error": 0.125
  },
  "root_candidates": [
    {
      "feature": "x1",
      "threshold": 1.5,
      "left": {
        "ids": [
          "A",
          "B",
          "C",
          "D"
        ],
        "n": 4,
        "counts": [
          2,
          2
        ],
        "p_class1": 0.5,
        "class": 0,
        "gini": 0.5,
        "gini_exact": "1/2",
        "entropy_nats": 0.6931471805599453,
        "majority_error": 0.5
      },
      "right": {
        "ids": [
          "E",
          "F",
          "G",
          "H",
          "I",
          "J",
          "K",
          "L",
          "M",
          "N",
          "O",
          "P"
        ],
        "n": 12,
        "counts": [
          0,
          12
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.125,
      "weighted_gini_exact": "1/8",
      "gini_gain": 0.09375,
      "weighted_entropy_nats": 0.17328679513998632,
      "unweighted_gini": 0.25
    },
    {
      "feature": "x1",
      "threshold": 2.5,
      "left": {
        "ids": [
          "A",
          "B",
          "C",
          "D",
          "E",
          "F",
          "G",
          "H"
        ],
        "n": 8,
        "counts": [
          2,
          6
        ],
        "p_class1": 0.75,
        "class": 1,
        "gini": 0.375,
        "gini_exact": "3/8",
        "entropy_nats": 0.5623351446188083,
        "majority_error": 0.25
      },
      "right": {
        "ids": [
          "I",
          "J",
          "K",
          "L",
          "M",
          "N",
          "O",
          "P"
        ],
        "n": 8,
        "counts": [
          0,
          8
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.1875,
      "weighted_gini_exact": "3/16",
      "gini_gain": 0.03125,
      "weighted_entropy_nats": 0.28116757230940415,
      "unweighted_gini": 0.1875
    },
    {
      "feature": "x1",
      "threshold": 3.5,
      "left": {
        "ids": [
          "A",
          "B",
          "C",
          "D",
          "E",
          "F",
          "G",
          "H",
          "I",
          "J",
          "K",
          "L"
        ],
        "n": 12,
        "counts": [
          2,
          10
        ],
        "p_class1": 0.8333333333333334,
        "class": 1,
        "gini": 0.2777777777777778,
        "gini_exact": "5/18",
        "entropy_nats": 0.45056120886630463,
        "majority_error": 0.16666666666666663
      },
      "right": {
        "ids": [
          "M",
          "N",
          "O",
          "P"
        ],
        "n": 4,
        "counts": [
          0,
          4
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.20833333333333334,
      "weighted_gini_exact": "5/24",
      "gini_gain": 0.010416666666666657,
      "weighted_entropy_nats": 0.33792090664972846,
      "unweighted_gini": 0.1388888888888889
    },
    {
      "feature": "x2",
      "threshold": 1.5,
      "left": {
        "ids": [
          "A",
          "E",
          "I",
          "M"
        ],
        "n": 4,
        "counts": [
          1,
          3
        ],
        "p_class1": 0.75,
        "class": 1,
        "gini": 0.375,
        "gini_exact": "3/8",
        "entropy_nats": 0.5623351446188083,
        "majority_error": 0.25
      },
      "right": {
        "ids": [
          "B",
          "C",
          "D",
          "F",
          "G",
          "H",
          "J",
          "K",
          "L",
          "N",
          "O",
          "P"
        ],
        "n": 12,
        "counts": [
          1,
          11
        ],
        "p_class1": 0.9166666666666666,
        "class": 1,
        "gini": 0.1527777777777778,
        "gini_exact": "11/72",
        "entropy_nats": 0.2868359830561607,
        "majority_error": 0.08333333333333337
      },
      "weighted_gini": 0.20833333333333334,
      "weighted_gini_exact": "5/24",
      "gini_gain": 0.010416666666666657,
      "weighted_entropy_nats": 0.3557107734468226,
      "unweighted_gini": 0.2638888888888889
    },
    {
      "feature": "x2",
      "threshold": 2.5,
      "left": {
        "ids": [
          "A",
          "B",
          "E",
          "F",
          "I",
          "J",
          "M",
          "N"
        ],
        "n": 8,
        "counts": [
          2,
          6
        ],
        "p_class1": 0.75,
        "class": 1,
        "gini": 0.375,
        "gini_exact": "3/8",
        "entropy_nats": 0.5623351446188083,
        "majority_error": 0.25
      },
      "right": {
        "ids": [
          "C",
          "D",
          "G",
          "H",
          "K",
          "L",
          "O",
          "P"
        ],
        "n": 8,
        "counts": [
          0,
          8
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.1875,
      "weighted_gini_exact": "3/16",
      "gini_gain": 0.03125,
      "weighted_entropy_nats": 0.28116757230940415,
      "unweighted_gini": 0.1875
    },
    {
      "feature": "x2",
      "threshold": 3.5,
      "left": {
        "ids": [
          "A",
          "B",
          "C",
          "E",
          "F",
          "G",
          "I",
          "J",
          "K",
          "M",
          "N",
          "O"
        ],
        "n": 12,
        "counts": [
          2,
          10
        ],
        "p_class1": 0.8333333333333334,
        "class": 1,
        "gini": 0.2777777777777778,
        "gini_exact": "5/18",
        "entropy_nats": 0.45056120886630463,
        "majority_error": 0.16666666666666663
      },
      "right": {
        "ids": [
          "D",
          "H",
          "L",
          "P"
        ],
        "n": 4,
        "counts": [
          0,
          4
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.20833333333333334,
      "weighted_gini_exact": "5/24",
      "gini_gain": 0.010416666666666657,
      "weighted_entropy_nats": 0.33792090664972846,
      "unweighted_gini": 0.1388888888888889
    }
  ],
  "selected_root": {
    "feature": "x1",
    "threshold": 1.5
  },
  "left_candidates": [
    {
      "feature": "x2",
      "threshold": 1.5,
      "left": {
        "ids": [
          "A"
        ],
        "n": 1,
        "counts": [
          1,
          0
        ],
        "p_class1": 0.0,
        "class": 0,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "right": {
        "ids": [
          "B",
          "C",
          "D"
        ],
        "n": 3,
        "counts": [
          1,
          2
        ],
        "p_class1": 0.6666666666666666,
        "class": 1,
        "gini": 0.4444444444444444,
        "gini_exact": "4/9",
        "entropy_nats": 0.6365141682948128,
        "majority_error": 0.33333333333333337
      },
      "weighted_gini": 0.3333333333333333,
      "weighted_gini_exact": "1/3",
      "gini_gain": 0.16666666666666669,
      "weighted_entropy_nats": 0.4773856262211096,
      "unweighted_gini": 0.2222222222222222
    },
    {
      "feature": "x2",
      "threshold": 2.5,
      "left": {
        "ids": [
          "A",
          "B"
        ],
        "n": 2,
        "counts": [
          2,
          0
        ],
        "p_class1": 0.0,
        "class": 0,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "right": {
        "ids": [
          "C",
          "D"
        ],
        "n": 2,
        "counts": [
          0,
          2
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.0,
      "weighted_gini_exact": "0",
      "gini_gain": 0.5,
      "weighted_entropy_nats": 0.0,
      "unweighted_gini": 0.0
    },
    {
      "feature": "x2",
      "threshold": 3.5,
      "left": {
        "ids": [
          "A",
          "B",
          "C"
        ],
        "n": 3,
        "counts": [
          2,
          1
        ],
        "p_class1": 0.3333333333333333,
        "class": 0,
        "gini": 0.4444444444444444,
        "gini_exact": "4/9",
        "entropy_nats": 0.6365141682948128,
        "majority_error": 0.33333333333333337
      },
      "right": {
        "ids": [
          "D"
        ],
        "n": 1,
        "counts": [
          0,
          1
        ],
        "p_class1": 1.0,
        "class": 1,
        "gini": 0.0,
        "gini_exact": "0",
        "entropy_nats": 0.0,
        "majority_error": 0.0
      },
      "weighted_gini": 0.3333333333333333,
      "weighted_gini_exact": "1/3",
      "gini_gain": 0.16666666666666669,
      "weighted_entropy_nats": 0.4773856262211096,
      "unweighted_gini": 0.2222222222222222
    }
  ],
  "selected_left": {
    "feature": "x2",
    "threshold": 2.5
  },
  "nodes": {
    "R": {
      "ids": [
        "A",
        "B",
        "C",
        "D",
        "E",
        "F",
        "G",
        "H",
        "I",
        "J",
        "K",
        "L",
        "M",
        "N",
        "O",
        "P"
      ],
      "n": 16,
      "counts": [
        2,
        14
      ],
      "p_class1": 0.875,
      "class": 1,
      "gini": 0.21875,
      "gini_exact": "7/32",
      "entropy_nats": 0.37677016125643675,
      "majority_error": 0.125
    },
    "R_L": {
      "ids": [
        "A",
        "B",
        "C",
        "D"
      ],
      "n": 4,
      "counts": [
        2,
        2
      ],
      "p_class1": 0.5,
      "class": 0,
      "gini": 0.5,
      "gini_exact": "1/2",
      "entropy_nats": 0.6931471805599453,
      "majority_error": 0.5
    },
    "R_R": {
      "ids": [
        "E",
        "F",
        "G",
        "H",
        "I",
        "J",
        "K",
        "L",
        "M",
        "N",
        "O",
        "P"
      ],
      "n": 12,
      "counts": [
        0,
        12
      ],
      "p_class1": 1.0,
      "class": 1,
      "gini": 0.0,
      "gini_exact": "0",
      "entropy_nats": 0.0,
      "majority_error": 0.0
    },
    "R_LL": {
      "ids": [
        "A",
        "B"
      ],
      "n": 2,
      "counts": [
        2,
        0
      ],
      "p_class1": 0.0,
      "class": 0,
      "gini": 0.0,
      "gini_exact": "0",
      "entropy_nats": 0.0,
      "majority_error": 0.0
    },
    "R_LR": {
      "ids": [
        "C",
        "D"
      ],
      "n": 2,
      "counts": [
        0,
        2
      ],
      "p_class1": 1.0,
      "class": 1,
      "gini": 0.0,
      "gini_exact": "0",
      "entropy_nats": 0.0,
      "majority_error": 0.0
    }
  },
  "query": {
    "id": "U",
    "x": [
      1.5,
      3.25
    ],
    "label": null,
    "path": [
      "R",
      "R_L",
      "R_LR"
    ],
    "prediction": 1
  },
  "regression": {
    "provenance": "Separate synthetic prices in millions of currency units; not classification labels.",
    "values": [
      4,
      6,
      8,
      10
    ],
    "mean": 7.0,
    "sse": 20.0,
    "mse": 5.0,
    "candidate_groups": [
      [
        4,
        6
      ],
      [
        8,
        10
      ]
    ],
    "child_means": [
      5.0,
      9.0
    ],
    "child_sse": [
      2.0,
      2.0
    ],
    "weighted_child_mse": 1.0
  }
}
