function [fea,ind] = new_feature(data,x)

y = data(:,1);
X = data(:,2:end-1);
N = data(:,end); % counts
n = length(y);

fea.x = x; 
fea.p = 0.5;

nx   = length(fea.x);
if (nx==0),
  fea.p = sum(y.*N)/sum(N); % root
else
  ind  = find(sum(abs(X(:,1:nx)-repmat(fea.x,n,1)),2)==0); % matches
  if (length(ind)>0),
    fea.p = sum(y(ind).*N(ind))/sum(N(ind)); % estimate P(y=1|x)
  end;
end;

