Skip to content

Commit fa68b63

Browse files
author
Sergio Fierens
committed
Small fix on naive_bayes classifier. When we changed the each_with_index for 0.upto, the method was returning a fixnum instead of a enum
1 parent 5f517cb commit fa68b63

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/ai4r/classifiers/naive_bayes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ def calculate_class_probabilities_for_entry(data, prob)
135135
prob[prob_index] *= @pcp[index][value_index(att, index)][prob_index]
136136
end
137137
end
138+
139+
prob
138140
end
139141

140142
# normalises the array of probabilities so the sum of the array equals 1

0 commit comments

Comments
 (0)