function v = AI_gain(examples,attributes,a_index)
%
% AI_gain - compute info gain for attribute
% Call:
%     v = AI_gain(ex,att,3);
% On input:
%     examples (mxn array): training set
%     attributes (structure array): attributes
%     a_index (scalar): index of attribute
% On output:
%     v (scalar): info gain for attribute
% Custom functions used:
%     none
% Author:
%     T. Henderson, UU, 11/2002
% Method:
%      

n = AI_num_neg_examples(examples,0,0);
p = AI_num_pos_examples(examples,0,0);
t = p+n;
v = AI_info_content(p/t,n/t) - AI_remainder(examples,attributes,a_index);
