function v = AI_prob_examples(examples)
%
% AI_num_neg_examples - get probability of each class in examples
% Call:
%     n = AI_get_prob_examples(ex,ai,v);
% On input:
%     examples (mxn array): training examples
% On output:
%     v (scalar): probability of each class in examples
% Custom functions used:
%     none
% Author:
%     T. Henderson
%     UU
%     Fall 2012
%

[num_examples, num_cols] = size(examples);
classes = [];
for e = 1:num_examples
    c = examples(e,num_cols);
    if isempty(find(c==classes))
        classes = [classes; c];
    end
end
num_classes = length(classes);
v = zeros(num_classes,1);
for c = 1:num_classes
    indexes = find(classes(c)==examples(:,num_cols));
    v(c) = length(indexes)/num_examples;
end
