@Override
	public double[] predictProbabilities(Instance instance) {
		if (w.length == 1) {
			double[] prob = new double[2];
			double pred = regress(intercept[0], w[0], instance);
			prob[0] = MathUtils.sigmoid(pred);
			prob[1] = 1 - prob[0];
			return prob;
		} else {
			double[] prob = new double[w.length];
			double[] pred = new double[w.length];
			double sum = 0;
			for (int i = 0; i < w.length; i++) {
				pred[i] = regress(intercept[i], w[i], instance);
				prob[i] = MathUtils.sigmoid(pred[i]);
				sum += prob[i];
			}
			for (int i = 0; i < prob.length; i++) {
				prob[i] /= sum;
			}
			return prob;
		}
	}