// elements of the input set belonging to the i^th class!
// Note: np.mean is vectorized i.e. computes the nr_x means
// simultaneously.
means[i,0:2]=np.mean(x[idx,:],0)
// Note: Remark 1.2 explains that the parameters of a Naive
// Bayes classifier can be expressed as a linear classifier. We
// will return the parameters in that format to be used later.
params = np.zeros((nr_f+1,nr_c))
for i in xrange(nr_c):
params[0,i] = -1/2 * np.dot(means[i,:],means[i,:]) + np.log(prior[i])
params[1:,i] = means[i].transpose()
// Store classifier parameters.
self.means = means