class InstanceCreator extends BaseFunction {

	@SuppressWarnings("unchecked")
	protected Instance<L> createInstance(TridentTuple tuple) {
		Instance<L> instance = null;

		if (this.withLabel) {
			L label = (L) tuple.get(0);
			double[] features = new double[tuple.size() - 1];
			for (int i = 1; i < tuple.size(); i++) {
				features[i - 1] = tuple.getDouble(i);
			}

			instance = new Instance<L>(label, features);
		} else {
			double[] features = new double[tuple.size()];
			for (int i = 0; i < tuple.size(); i++) {
				features[i] = tuple.getDouble(i);
			}

			instance = new Instance<L>(features);
		}

		return instance;
	}

	public  InstanceCreator();
	public  InstanceCreator(boolean withLabel);

}