File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,15 @@ def traverse_tree_predict(tree, X):
2121 X = np .dot (np .subtract (X , tree ["rotDetails" ]["muX" ]), tree ["rotDetails" ]["R" ])
2222
2323 if ('featureExpansion' in tree .keys ()):
24+ if len (tree ["decisionProjection" ].shape ) < 2 :
25+ decisionProjection = np .expand_dims (tree ["decisionProjection" ], axis = 1 )
26+ else :
27+ decisionProjection = tree ["decisionProjection" ]
28+ # Check if the function exists
2429 if inspect .isfunction (tree ["featureExpansion" ]):
25- bLessChild = np .dot (tree ["featureExpansion" ](X [:, tree ["iIn" ]]), tree [ " decisionProjection" ] ) <= tree ["paritionPoint" ]
30+ bLessChild = np .dot (tree ["featureExpansion" ](X [:, tree ["iIn" ]]), decisionProjection ) <= tree ["paritionPoint" ]
2631 else :
27- bLessChild = np .dot (( X [:, tree ["iIn" ]]), tree [ " decisionProjection" ] ) <= tree ["paritionPoint" ]
32+ bLessChild = np .dot (X [:, tree ["iIn" ]], decisionProjection ) <= tree ["paritionPoint" ]
2833 else :
2934 if len (tree ["decisionProjection" ].shape ) < 2 :
3035 decisionProjection = np .expand_dims (tree ["decisionProjection" ], axis = 1 )
You can’t perform that action at this time.
0 commit comments