@Override
	public GAM build(Instances instances) {
		GAM gam = null;
		if (maxNumIters < 0) {
			maxNumIters = instances.dimension() * 20;
		}
		switch (task) {
			case REGRESSION:
				gam = buildRegressor(instances, maxNumIters, lambda);
				break;
			case CLASSIFICATION:
				gam = buildClassifier(instances, maxNumIters, lambda);
				break;
			default:
				break;
		}
		return gam;
	}