@Override
	public GLM build(Instances instances) {
		if (groups == null) {
			throw new IllegalArgumentException("Groups are not set.");
		}
		GLM glm = null;
		if (maxNumIters < 0) {
			maxNumIters = 20;
		}
		switch (task) {
			case REGRESSION:
				glm = buildGaussianRegressor(instances, groups, maxNumIters, lambda);
				break;
			case CLASSIFICATION:
				glm = buildClassifier(instances, groups, maxNumIters, lambda);
				break;
			default:
				break;
		}
		return glm;
	}