Skip to content

Commit 9239868

Browse files
author
tobybreckon
committed
remove spurious and confusing commented out line
clarify how classification is arrived at from this example with predict() in the comments
1 parent 2f0c19f commit 9239868

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ensemblelearning/boosttree.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ def unroll_responses(number_of_class, responses):
146146

147147
unrolled_testing_examples = unroll_sample(number_of_classes, testing_attributes[i,:])
148148

149-
# we perform testing over the unrolled example by specifying the returnSum parameter to
150-
# to return the sum of the number of trees that classified a given example as 1.
151-
# This is repeated over all of the unrolled examples, with the most voted for unrolled
152-
# class returned as the final classification result
149+
# we perform testing over all the unrolled examples and take the maximum result
150+
# following the example at:
151+
# https://github.com/opencv/opencv/blob/master/samples/python/letter_recog.py
152+
153+
# result should contain the number of trees that voted for each unrolled
154+
# example, hence each class
153155

154-
# _, result = np.array([boostedTree.predict(ex, returnSum = True) for ex in unrolled_testing_examples] );
155156
_, result = boostedTree.predict(unrolled_testing_examples);
156157

157158
result = result.reshape(-1, number_of_classes).argmax(1);

0 commit comments

Comments
 (0)