You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The XGBBoostJsonParser fails to parse XGBoost models that have binary (or what XGB calls indicator features) nodes in the tree due to lacking the threshold/split condition attribute. I believe then the fix will also require the decision tree model to also handle this situation where there is no split condition.
From https://relevancy.slack.com/archives/C47DYV6AW/p1642636695016000
The XGBBoostJsonParser fails to parse XGBoost models that have binary (or what XGB calls indicator features) nodes in the tree due to lacking the threshold/split condition attribute. I believe then the fix will also require the decision tree model to also handle this situation where there is no split condition.
Example (field_i_match is the offending item, which in my dataset was a flag indicating whether an item was on sale or not -- the workaround is for me to encode the difference in sales price from regular price):
[ { "nodeid": 0, "depth": 0, "split": "field_c_match", "split_condition": 9.38559723, "yes": 1, "no": 2, "missing": 1 , "children": [ { "nodeid": 1, "depth": 1, "split": "field_c_match", "split_condition": 6.62043333, "yes": 3, "no": 4, "missing": 3 , "children": [ { "nodeid": 3, "leaf": -0.599145591 }, { "nodeid": 4, "depth": 2, "split": "field_a_match", "split_condition": 38.5, "yes": 7, "no": 8, "missing": 7 , "children": [ { "nodeid": 7, "depth": 3, "split": "field_g_match", "split_condition": 9.67657852, "yes": 13, "no": 14, "missing": 13 , "children": [ { "nodeid": 13, "depth": 4, "split": "field_d_match", "split_condition": 15.9899998, "yes": 19, "no": 20, "missing": 19 , "children": [ { "nodeid": 19, "leaf": -0 }, { "nodeid": 20, "leaf": -0.547169864 } ]}, { "nodeid": 14, "depth": 4, "split": "field_d_match", "split_condition": 131.990005, "yes": 21, "no": 22, "missing": 21 , "children": [ { "nodeid": 21, "leaf": -0.381818205 }, { "nodeid": 22, "depth": 5, "split": "field_c_match", "split_condition": 7.49087095, "yes": 27, "no": 28, "missing": 27 , "children": [ { "nodeid": 27, "leaf": -0 }, { "nodeid": 28, "leaf": -0.0947368443 } ]} ]} ]}, { "nodeid": 8, "leaf": -0.593161702 } ]} ]}, { "nodeid": 2, "depth": 1, "split": "field_a_match", "split_condition": 10920.5, "yes": 5, "no": 6, "missing": 5 , "children": [ { "nodeid": 5, "depth": 2, "split": "field_a_match", "split_condition": 6, "yes": 9, "no": 10, "missing": 9 , "children": [ { "nodeid": 9, "leaf": -0.0666666701 }, { "nodeid": 10, "depth": 3, "split": "field_c_match", "split_condition": 14.864233, "yes": 15, "no": 16, "missing": 15 , "children": [ { "nodeid": 15, "depth": 4, "split": "field_g_match", "split_condition": 22.414566, "yes": 23, "no": 24, "missing": 23 , "children": [ { "nodeid": 23, "leaf": -0.57049185 }, { "nodeid": 24, "leaf": -0.150000006 } ]}, { "nodeid": 16, "depth": 4, "split": "field_a_match", "split_condition": 10837.5, "yes": 25, "no": 26, "missing": 25 , "children": [ { "nodeid": 25, "depth": 5, "split": "field_h_match", "split_condition": 19, "yes": 29, "no": 30, "missing": 29 , "children": [ { "nodeid": 29, "leaf": -0 }, { "nodeid": 30, "leaf": -0.531021893 } ]}, { "nodeid": 26, "leaf": -0 } ]} ]} ]}, { "nodeid": 6, "depth": 2, "split": "field_g_match", "split_condition": 25.5321712, "yes": 11, "no": 12, "missing": 11 , "children": [ { "nodeid": 11, "leaf": -0.591832042 }, { "nodeid": 12, "depth": 3, "split": "field_c_match", "split_condition": 20.2128487, "yes": 17, "no": 18, "missing": 17 , "children": [ { "nodeid": 17, "leaf": -0.300000012 }, { "nodeid": 18, "leaf": -0 } ]} ]} ]} ]}, { "nodeid": 0, "depth": 0, "split": "field_c_match", "split_condition": 10.1865664, "yes": 1, "no": 2, "missing": 1 , "children": [ { "nodeid": 1, "depth": 1, "split": "field_c_match", "split_condition": 6.53145027, "yes": 3, "no": 4, "missing": 3 , "children": [ { "nodeid": 3, "leaf": -0.463867605 }, { "nodeid": 4, "depth": 2, "split": "field_a_match", "split_condition": 38.5, "yes": 7, "no": 8, "missing": 7 , "children": [ { "nodeid": 7, "depth": 3, "split": "field_a_match", "split_condition": 37.5, "yes": 13, "no": 14, "missing": 13 , "children": [ { "nodeid": 13, "depth": 4, "split": "field_d_match", "split_condition": 14.9899998, "yes": 21, "no": 22, "missing": 21 , "children": [ { "nodeid": 21, "leaf": -0 }, { "nodeid": 22, "depth": 5, "split": "field_g_match", "split_condition": 10.6205177, "yes": 29, "no": 30, "missing": 29 , "children": [ { "nodeid": 29, "leaf": -0.428864509 }, { "nodeid": 30, "leaf": -0.215590537 } ]} ]}, { "nodeid": 14, "leaf": 0.0692209601 } ]}, { "nodeid": 8, "depth": 3, "split": "field_a_match", "split_condition": 104730.5, "yes": 15, "no": 16, "missing": 15 , "children": [ { "nodeid": 15, "depth": 4, "split": "field_f_match", "split_condition": 3249.98999, "yes": 23, "no": 24, "missing": 23 , "children": [ { "nodeid": 23, "depth": 5, "split": "field_a_match", "split_condition": 104692, "yes": 31, "no": 32, "missing": 31 , "children": [ { "nodeid": 31, "leaf": -0.453925639 }, { "nodeid": 32, "leaf": -0.14346692 } ]}, { "nodeid": 24, "leaf": -0.118292242 } ]}, { "nodeid": 16, "leaf": -0.463047773 } ]} ]} ]}, { "nodeid": 2, "depth": 1, "split": "field_a_match", "split_condition": 10920.5, "yes": 5, "no": 6, "missing": 5 , "children": [ { "nodeid": 5, "depth": 2, "split": "field_c_match", "split_condition": 20.5579643, "yes": 9, "no": 10, "missing": 9 , "children": [ { "nodeid": 9, "depth": 3, "split": "field_h_match", "split_condition": 23, "yes": 17, "no": 18, "missing": 17 , "children": [ { "nodeid": 17, "depth": 4, "split": "field_c_match", "split_condition": 14.8020973, "yes": 25, "no": 26, "missing": 25 , "children": [ { "nodeid": 25, "leaf": -0.330031306 }, { "nodeid": 26, "leaf": 0.204493269 } ]}, { "nodeid": 18, "leaf": -0.432371944 } ]}, { "nodeid": 10, "depth": 3, "split": "field_c_match", "split_condition": 20.8367767, "yes": 19, "no": 20, "missing": 19 , "children": [ { "nodeid": 19, "depth": 4, "split": "field_g_match", "split_condition": 16.6927834, "yes": 27, "no": 28, "missing": 27 , "children": [ { "nodeid": 27, "leaf": 0.159097001 }, { "nodeid": 28, "leaf": -0.174456537 } ]}, { "nodeid": 20, "leaf": -0.358644366 } ]} ]}, { "nodeid": 6, "depth": 2, "split": "field_g_match", "split_condition": 25.5321712, "yes": 11, "no": 12, "missing": 11 , "children": [ { "nodeid": 11, "leaf": -0.45524174 }, { "nodeid": 12, "leaf": -0.171490133 } ]} ]} ]}, { "nodeid": 0, "depth": 0, "split": "field_c_match", "split_condition": 9.38559723, "yes": 1, "no": 2, "missing": 1 , "children": [ { "nodeid": 1, "depth": 1, "split": "field_c_match", "split_condition": 6.62043333, "yes": 3, "no": 4, "missing": 3 , "children": [ { "nodeid": 3, "leaf": -0.402510256 }, { "nodeid": 4, "depth": 2, "split": "field_a_match", "split_condition": 38.5, "yes": 7, "no": 8, "missing": 7 , "children": [ { "nodeid": 7, "depth": 3, "split": "field_a_match", "split_condition": 23.5, "yes": 11, "no": 12, "missing": 11 , "children": [ { "nodeid": 11, "leaf": -0.385997713 }, { "nodeid": 12, "depth": 4, "split": "field_b_match", "split_condition": 82, "yes": 19, "no": 20, "missing": 19 , "children": [ { "nodeid": 19, "depth": 5, "split": "field_g_match", "split_condition": 7.41891336, "yes": 29, "no": 30, "missing": 29 , "children": [ { "nodeid": 29, "leaf": -0.189276293 }, { "nodeid": 30, "leaf": 0.0879062116 } ]}, { "nodeid": 20, "depth": 5, "split": "field_a_match", "split_condition": 37.5, "yes": 31, "no": 32, "missing": 31 , "children": [ { "nodeid": 31, "leaf": -0.346249014 }, { "nodeid": 32, "leaf": -0.0294444878 } ]} ]} ]}, { "nodeid": 8, "depth": 3, "split": "field_a_match", "split_condition": 104715.5, "yes": 13, "no": 14, "missing": 13 , "children": [ { "nodeid": 13, "depth": 4, "split": "field_f_match", "split_condition": 3249.98999, "yes": 21, "no": 22, "missing": 21 , "children": [ { "nodeid": 21, "depth": 5, "split": "field_a_match", "split_condition": 104371, "yes": 33, "no": 34, "missing": 33 , "children": [ { "nodeid": 33, "leaf": -0.39199996 }, { "nodeid": 34, "leaf": -0.141364545 } ]}, { "nodeid": 22, "leaf": -0.068766892 } ]}, { "nodeid": 14, "leaf": -0.400931478 } ]} ]} ]}, { "nodeid": 2, "depth": 1, "split": "field_a_match", "split_condition": 65422.5, "yes": 5, "no": 6, "missing": 5 , "children": [ { "nodeid": 5, "depth": 2, "split": "field_c_match", "split_condition": 20.1838856, "yes": 9, "no": 10, "missing": 9 , "children": [ { "nodeid": 9, "depth": 3, "split": "field_a_match", "split_condition": 578.5, "yes": 15, "no": 16, "missing": 15 , "children": [ { "nodeid": 15, "depth": 4, "split": "field_c_match", "split_condition": 17.8459396, "yes": 23, "no": 24, "missing": 23 , "children": [ { "nodeid": 23, "depth": 5, "split": "field_a_match", "split_condition": 571, "yes": 35, "no": 36, "missing": 35 , "children": [ { "nodeid": 35, "leaf": -0.353899211 }, { "nodeid": 36, "leaf": -0.138573319 } ]}, { "nodeid": 24, "depth": 5, "split": "field_e_match", "split_condition": 3.56738424, "yes": 37, "no": 38, "missing": 37 , "children": [ { "nodeid": 37, "leaf": -0.244308457 }, { "nodeid": 38, "leaf": 0.222370073 } ]} ]}, { "nodeid": 16, "depth": 4, "split": "field_i_match", "yes": 26, "no": 25 , "children": [ { "nodeid": 25, "depth": 5, "split": "field_c_match", "split_condition": 9.40549278, "yes": 39, "no": 40, "missing": 39 , "children": [ { "nodeid": 39, "leaf": -0.168005154 }, { "nodeid": 40, "leaf": -0.379883796 } ]}, { "nodeid": 26, "depth": 5, "split": "field_g_match", "split_condition": 21.8321171, "yes": 41, "no": 42, "missing": 41 , "children": [ { "nodeid": 41, "leaf": -0.340734303 }, { "nodeid": 42, "leaf": 0.161771044 } ]} ]} ]}, { "nodeid": 10, "depth": 3, "split": "field_b_match", "split_condition": 80336.5, "yes": 17, "no": 18, "missing": 17 , "children": [ { "nodeid": 17, "depth": 4, "split": "field_a_match", "split_condition": 841.5, "yes": 27, "no": 28, "missing": 27 , "children": [ { "nodeid": 27, "depth": 5, "split": "field_b_match", "split_condition": 963.5, "yes": 43, "no": 44, "missing": 43 , "children": [ { "nodeid": 43, "leaf": -0.259337127 }, { "nodeid": 44, "leaf": 0.154739201 } ]}, { "nodeid": 28, "depth": 5, "split": "field_d_match", "split_condition": 15.4899998, "yes": 45, "no": 46, "missing": 45 , "children": [ { "nodeid": 45, "leaf": -0.0671852902 }, { "nodeid": 46, "leaf": -0.335014611 } ]} ]}, { "nodeid": 18, "leaf": 0.218070105 } ]} ]}, { "nodeid": 6, "leaf": -0.396733612 } ]} ]}, { "nodeid": 0, "depth": 0, "split": "field_c_match", "split_condition": 9.38559723, "yes": 1, "no": 2, "missing": 1 , "children": [ { "nodeid": 1, "depth": 1, "split": "field_c_match", "split_condition": 6.62043333, "yes": 3, "no": 4, "missing": 3 , "children": [ { "nodeid": 3, "leaf": -0.367891043 }, { "nodeid": 4, "depth": 2, "split": "field_a_match", "split_condition": 38.5, "yes": 7, "no": 8, "missing": 7 , "children": [ { "nodeid": 7, "depth": 3, "split": "field_a_match", "split_condition": 23.5, "yes": 13, "no": 14, "missing": 13 , "children": [ { "nodeid": 13, "leaf": -0.344622195 }, { "nodeid": 14, "depth": 4, "split": "field_b_match", "split_condition": 82, "yes": 23, "no": 24, "missing": 23 , "children": [ { "nodeid": 23, "depth": 5, "split": "field_g_match", "split_condition": 7.41891336, "yes": 37, "no": 38, "missing": 37 , "children": [ { "nodeid": 37, "leaf": -0.161840469 }, { "nodeid": 38, "leaf": 0.0647001788 } ]}, { "nodeid": 24, "depth": 5, "split": "field_a_match", "split_condition": 37.5, "yes": 39, "no": 40, "missing": 39 , "children": [ { "nodeid": 39, "leaf": -0.299340248 }, { "nodeid": 40, "leaf": -0.022701852 } ]} ]} ]}, { "nodeid": 8, "depth": 3, "split": "field_a_match", "split_condition": 104715.5, "yes": 15, "no": 16, "missing": 15 , "children": [ { "nodeid": 15, "depth": 4, "split": "field_f_match", "split_condition": 3249.98999, "yes": 25, "no": 26, "missing": 25 , "children": [ { "nodeid": 25, "depth": 5, "split": "field_a_match", "split_condition": 104371, "yes": 41, "no": 42, "missing": 41 , "children": [ { "nodeid": 41, "leaf": -0.354661107 }, { "nodeid": 42, "leaf": -0.117012136 } ]}, { "nodeid": 26, "leaf": -0.0566267148 } ]}, { "nodeid": 16, "leaf": -0.365629971 } ]} ]} ]}, { "nodeid": 2, "depth": 1, "split": "field_a_match", "split_condition": 10920.5, "yes": 5, "no": 6, "missing": 5 , "children": [ { "nodeid": 5, "depth": 2, "split": "field_c_match", "split_condition": 13.5947285, "yes": 9, "no": 10, "missing": 9 , "children": [ { "nodeid": 9, "depth": 3, "split": "field_c_match", "split_condition": 9.40549278, "yes": 17, "no": 18, "missing": 17 , "children": [ { "nodeid": 17, "depth": 4, "split": "field_h_match", "split_condition": 2567.5, "yes": 27, "no": 28, "missing": 27 , "children": [ { "nodeid": 27, "depth": 5, "split": "field_b_match", "split_condition": 109, "yes": 43, "no": 44, "missing": 43 , "children": [ { "nodeid": 43, "leaf": 0.0856591985 }, { "nodeid": 44, "leaf": -0.316387564 } ]}, { "nodeid": 28, "leaf": 0.232133731 } ]}, { "nodeid": 18, "depth": 4, "split": "field_g_match", "split_condition": 22.1667786, "yes": 29, "no": 30, "missing": 29 , "children": [ { "nodeid": 29, "depth": 5, "split": "field_f_match", "split_condition": 49.9950027, "yes": 45, "no": 46, "missing": 45 , "children": [ { "nodeid": 45, "leaf": -0.348133177 }, { "nodeid": 46, "leaf": -0.32055375 } ]}, { "nodeid": 30, "depth": 5, "split": "field_b_match", "split_condition": 3753.5, "yes": 47, "no": 48, "missing": 47 , "children": [ { "nodeid": 47, "leaf": 0.189783528 }, { "nodeid": 48, "leaf": -0.244213223 } ]} ]} ]}, { "nodeid": 10, "depth": 3, "split": "field_a_match", "split_condition": 439, "yes": 19, "no": 20, "missing": 19 , "children": [ { "nodeid": 19, "depth": 4, "split": "field_e_match", "split_condition": 13.1575279, "yes": 31, "no": 32, "missing": 31 , "children": [ { "nodeid": 31, "depth": 5, "split": "field_a_match", "split_condition": 418.5, "yes": 49, "no": 50, "missing": 49 , "children": [ { "nodeid": 49, "leaf": -0.23573789 }, { "nodeid": 50, "leaf": 0.0273653306 } ]}, { "nodeid": 32, "depth": 5, "split": "field_d_match", "split_condition": 34.9900017, "yes": 51, "no": 52, "missing": 51 , "children": [ { "nodeid": 51, "leaf": -0.202630058 }, { "nodeid": 52, "leaf": 0.24591808 } ]} ]}, { "nodeid": 20, "depth": 4, "split": "field_a_match", "split_condition": 10837.5, "yes": 33, "no": 34, "missing": 33 , "children": [ { "nodeid": 33, "depth": 5, "split": "field_c_match", "split_condition": 13.606616, "yes": 53, "no": 54, "missing": 53 , "children": [ { "nodeid": 53, "leaf": 0.0228535701 }, { "nodeid": 54, "leaf": -0.308719814 } ]}, { "nodeid": 34, "leaf": 0.0709611923 } ]} ]} ]}, { "nodeid": 6, "depth": 2, "split": "field_c_match", "split_condition": 19.698349, "yes": 11, "no": 12, "missing": 11 , "children": [ { "nodeid": 11, "leaf": -0.359261036 }, { "nodeid": 12, "depth": 3, "split": "field_c_match", "split_condition": 19.8397293, "yes": 21, "no": 22, "missing": 21 , "children": [ { "nodeid": 21, "leaf": 0.0999638885 }, { "nodeid": 22, "depth": 4, "split": "field_a_match", "split_condition": 32313, "yes": 35, "no": 36, "missing": 35 , "children": [ { "nodeid": 35, "depth": 5, "split": "field_b_match", "split_condition": 29260, "yes": 55, "no": 56, "missing": 55 , "children": [ { "nodeid": 55, "leaf": -0.285922348 }, { "nodeid": 56, "leaf": 0.313931972 } ]}, { "nodeid": 36, "depth": 5, "split": "field_d_match", "split_condition": 7.48999977, "yes": 57, "no": 58, "missing": 57 , "children": [ { "nodeid": 57, "leaf": -0.0485280752 }, { "nodeid": 58, "leaf": -0.331965744 } ]} ]} ]} ]} ]} ]}, { "nodeid": 0, "depth": 0, "split": "field_c_match", "split_condition": 7.53896999, "yes": 1, "no": 2, "missing": 1 , "children": [ { "nodeid": 1, "depth": 1, "split": "field_c_match", "split_condition": 5.19981384, "yes": 3, "no": 4, "missing": 3 , "children": [ { "nodeid": 3, "leaf": -0.346667469 }, { "nodeid": 4, "depth": 2, "split": "field_h_match", "split_condition": 38.5, "yes": 7, "no": 8, "missing": 7 , "children": [ { "nodeid": 7, "depth": 3, "split": "field_h_match", "split_condition": 37.5, "yes": 13, "no": 14, "missing": 13 , "children": [ { "nodeid": 13, "depth": 4, "split": "field_g_match", "split_condition": 10.9160385, "yes": 21, "no": 22, "missing": 21 , "children": [ { "nodeid": 21, "leaf": -0.322095007 }, { "nodeid": 22, "depth": 5, "split": "field_e_match", "split_condition": 2.82696819, "yes": 33, "no": 34, "missing": 33 , "children": [ { "nodeid": 33, "leaf": -0.190846622 }, { "nodeid": 34, "leaf": 0.067995064 } ]} ]}, { "nodeid": 14, "leaf": 0.18070507 } ]}, { "nodeid": 8, "leaf": -0.341366798 } ]} ]}, { "nodeid": 2, "depth": 1, "split": "field_a_match", "split_condition": 51406, "yes": 5, "no": 6, "missing": 5 , "children": [ { "nodeid": 5, "depth": 2, "split": "field_c_match", "split_condition": 13.6035595, "yes": 9, "no": 10, "missing": 9 , "children": [ { "nodeid": 9, "depth": 3, "split": "field_c_match", "split_condition": 7.53964806, "yes": 15, "no": 16, "missing": 15 , "children": [ { "nodeid": 15, "depth": 4, "split": "field_g_match", "split_condition": 8.79651451, "yes": 23, "no": 24, "missing": 23 , "children": [ { "nodeid": 23, "leaf": 0.153530166 }, { "nodeid": 24, "leaf": -0.130072385 } ]}, { "nodeid": 16, "depth": 4, "split": "field_a_match", "split_condition": 575.5, "yes": 25, "no": 26, "missing": 25 , "children": [ { "nodeid": 25, "depth": 5, "split": "field_a_match", "split_condition": 571.5, "yes": 35, "no": 36, "missing": 35 , "children": [ { "nodeid": 35, "leaf": -0.292476654 }, { "nodeid": 36, "leaf": 0.0340178311 } ]}, { "nodeid": 26, "depth": 5, "split": "field_i_match", "yes": 38, "no": 37 , "children": [ { "nodeid": 37, "leaf": -0.322950184 }, { "nodeid": 38, "leaf": -0.276057214 } ]} ]} ]}, { "nodeid": 10, "depth": 3, "split": "field_a_match", "split_condition": 580, "yes": 17, "no": 18, "missing": 17 , "children": [ { "nodeid": 17, "depth": 4, "split": "field_b_match", "split_condition": 597, "yes": 27, "no": 28, "missing": 27 , "children": [ { "nodeid": 27, "depth": 5, "split": "field_e_match", "split_condition": 13.1575279, "yes": 39, "no": 40, "missing": 39 , "children": [ { "nodeid": 39, "leaf": -0.203423932 }, { "nodeid": 40, "leaf": 0.0365442559 } ]}, { "nodeid": 28, "depth": 5, "split": "field_c_match", "split_condition": 13.8936234, "yes": 41, "no": 42, "missing": 41 , "children": [ { "nodeid": 41, "leaf": 0.357154071 }, { "nodeid": 42, "leaf": -0.110503271 } ]} ]}, { "nodeid": 18, "depth": 4, "split": "field_c_match", "split_condition": 20.1838856, "yes": 29, "no": 30, "missing": 29 , "children": [ { "nodeid": 29, "depth": 5, "split": "field_c_match", "split_condition": 13.6626883, "yes": 43, "no": 44, "missing": 43 , "children": [ { "nodeid": 43, "leaf": -0.12644662 }, { "nodeid": 44, "leaf": -0.290225089 } ]}, { "nodeid": 30, "depth": 5, "split": "field_b_match", "split_condition": 80336.5, "yes": 45, "no": 46, "missing": 45 , "children": [ { "nodeid": 45, "leaf": -0.191062674 }, { "nodeid": 46, "leaf": 0.257994533 } ]} ]} ]} ]}, { "nodeid": 6, "depth": 2, "split": "field_c_match", "split_condition": 19.698349, "yes": 11, "no": 12, "missing": 11 , "children": [ { "nodeid": 11, "leaf": -0.340053827 }, { "nodeid": 12, "depth": 3, "split": "field_c_match", "split_condition": 19.8645248, "yes": 19, "no": 20, "missing": 19 , "children": [ { "nodeid": 19, "leaf": 0.077472277 }, { "nodeid": 20, "depth": 4, "split": "field_d_match", "split_condition": 7.48999977, "yes": 31, "no": 32, "missing": 31 , "children": [ { "nodeid": 31, "leaf": -0.0417254232 }, { "nodeid": 32, "leaf": -0.299112439 } ]} ]} ]} ]} ]}]
The text was updated successfully, but these errors were encountered: