// Path: ensemble-clustering/src/main/java/com/oculusinfo/ml/feature/numeric/NumericVectorFeature.java
// public class NumericVectorFeature extends Feature {
// 	private static final long serialVersionUID = 4845380498652903996L;
// 	private double[] vector;
// 	
// 	private String vectorToString() {
// 		StringBuilder str = new StringBuilder();
// 		str.append("[");
// 		for (int i=0; i < vector.length; i++) {
// 			str.append(vector[i]);
// 			if (i < vector.length - 1) str.append(";");
// 		}
// 		str.append("]");
// 		return str.toString();
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return (this.getName() + ":" + vectorToString());
// 	}
// 	
// 	public NumericVectorFeature() {
// 		super();
// 	}
// 	
// 	public NumericVectorFeature(String name) {
// 		super(name);
// 	}
// 
// 	public void setValue(double[] vector) {
// 		this.vector = vector;
// 	}
// 	
// 	public void setValue(List<Double> vector) {
// 		setValue(new ArrayList<Double>(vector));
// 	}
// 	
// 	public double[] getValue() {
// 		return this.vector;
// 	}
// }
// 
// Path: ensemble-clustering/src/main/java/com/oculusinfo/ml/feature/spatial/GeoSpatialFeature.java
// public class GeoSpatialFeature extends Feature {
// 	private static final long serialVersionUID = 7917681828048658982L;
// 	private double latitude;
// 	private double longitude;
// 	
// 	@Override
// 	public String toString() {
// 		return (this.getName() + ":[" + latitude + ";" + longitude + "]");
// 	}
// 	
// 	public GeoSpatialFeature() {
// 		super();
// 	}
// 	
// 	public GeoSpatialFeature(String name) {
// 		super(name);
// 	}
// 
// 	public void setValue(double latitude, double longitude) {
// 		this.latitude = latitude;
// 		this.longitude = longitude;
// 	}
// 	
// 	public double getLatitude() {
// 		return latitude;
// 	}
// 	
// 	public void setLatitude(double latitude) {
// 		this.latitude = latitude;
// 	}
// 	
// 	public double getLongitude() {
// 		return longitude;
// 	}
// 	
// 	public void setLongitude(double longitude) {
// 		this.longitude = longitude;
// 	}
// }


import com.oculusinfo.ml.feature.numeric.NumericVectorFeature;
import com.oculusinfo.ml.feature.spatial.GeoSpatialFeature;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import com.oculusinfo.ml.feature.bagofwords.BagOfWordsFeature;
		catch (Exception e) {
			e.printStackTrace();
		}
		return feature;
	}
	
	public GeoSpatialFeature fieldToGeoSpatialFeature(String name) {
		Field field = fields.get(name);
		
		if (field == null) return null;
		
		GeoSpatialFeature feature = null;
		
		try {
			feature = new GeoSpatialFeature(field.name);
		
			String val = field.value.substring(1, field.value.length()-1);  // strip off enclosing [ ]
		
			if (val.isEmpty()) return null;
			
			String[] tokens = val.split(";");
		
			feature.setValue(Double.parseDouble(tokens[0]), Double.parseDouble(tokens[1]));
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return feature;
	}
	
// Path: ensemble-clustering/src/main/java/com/oculusinfo/ml/feature/numeric/NumericVectorFeature.java
// public class NumericVectorFeature extends Feature {
// 	private static final long serialVersionUID = 4845380498652903996L;
// 	private double[] vector;
// 	
// 	private String vectorToString() {
// 		StringBuilder str = new StringBuilder();
// 		str.append("[");
// 		for (int i=0; i < vector.length; i++) {
// 			str.append(vector[i]);
// 			if (i < vector.length - 1) str.append(";");
// 		}
// 		str.append("]");
// 		return str.toString();
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return (this.getName() + ":" + vectorToString());
// 	}
// 	
// 	public NumericVectorFeature() {
// 		super();
// 	}
// 	
// 	public NumericVectorFeature(String name) {
// 		super(name);
// 	}
// 
// 	public void setValue(double[] vector) {
// 		this.vector = vector;
// 	}
// 	
// 	public void setValue(List<Double> vector) {
// 		setValue(new ArrayList<Double>(vector));
// 	}
// 	
// 	public double[] getValue() {
// 		return this.vector;
// 	}
// }
// 
// Path: ensemble-clustering/src/main/java/com/oculusinfo/ml/feature/spatial/GeoSpatialFeature.java
// public class GeoSpatialFeature extends Feature {
// 	private static final long serialVersionUID = 7917681828048658982L;
// 	private double latitude;
// 	private double longitude;
// 	
// 	@Override
// 	public String toString() {
// 		return (this.getName() + ":[" + latitude + ";" + longitude + "]");
// 	}
// 	
// 	public GeoSpatialFeature() {
// 		super();
// 	}
// 	
// 	public GeoSpatialFeature(String name) {
// 		super(name);
// 	}
// 
// 	public void setValue(double latitude, double longitude) {
// 		this.latitude = latitude;
// 		this.longitude = longitude;
// 	}
// 	
// 	public double getLatitude() {
// 		return latitude;
// 	}
// 	
// 	public void setLatitude(double latitude) {
// 		this.latitude = latitude;
// 	}
// 	
// 	public double getLongitude() {
// 		return longitude;
// 	}
// 	
// 	public void setLongitude(double longitude) {
// 		this.longitude = longitude;
// 	}
// }


// Path: ensemble-clustering-spark/src/main/java/com/oculusinfo/ml/spark/SparkInstanceParserHelper.java
import com.oculusinfo.ml.feature.numeric.NumericVectorFeature;
import com.oculusinfo.ml.feature.spatial.GeoSpatialFeature;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import com.oculusinfo.ml.feature.bagofwords.BagOfWordsFeature;

		catch (Exception e) {
			e.printStackTrace();
		}
		return feature;
	}
	
	public GeoSpatialFeature fieldToGeoSpatialFeature(String name) {
		Field field = fields.get(name);
		
		if (field == null) return null;
		
		GeoSpatialFeature feature = null;
		
		try {
			feature = new GeoSpatialFeature(field.name);
		
			String val = field.value.substring(1, field.value.length()-1);  // strip off enclosing [ ]
		
			if (val.isEmpty()) return null;
			
			String[] tokens = val.split(";");
		
			feature.setValue(Double.parseDouble(tokens[0]), Double.parseDouble(tokens[1]));
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return feature;
	}
	
	public NumericVectorFeature fieldToNumericVectorFeature(String name) {