class RegressionQuery extends BaseQueryFunction<MapState<Regressor>, Double> {

	@SuppressWarnings("unchecked")
	@Override
	public List<Double> batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples) {
		List<Double> labels = new ArrayList<Double>();

		List<Regressor> regressors = state.multiGet(KeysUtil.toKeys(this.regressorName));
		if (regressors != null && !regressors.isEmpty()) {
			Regressor regressor = regressors.get(0);
			if (regressor == null) {
				for (int i = 0; i < tuples.size(); i++) {
					labels.add(null);
				}
			} else {
				Double label;
				Instance<Double> instance;
				for (TridentTuple tuple : tuples) {
					instance = (Instance<Double>) tuple.get(0);
					label = regressor.predict(instance.features);
					labels.add(label);
				}
			}
		} else {
			for (int i = 0; i < tuples.size(); i++) {
				labels.add(null);
			}
		}

		return labels;
	}

	public  RegressionQuery(String regressorName);

}