/** * Construct a parser for CSV lines that encodes the parsed data in vector form. * @param targetName The name of the target variable. * @param typeMap A map describing the types of the predictor variables. */ public CsvRecordFactory(String targetName, Map<String, String> typeMap) { this.targetName = targetName; this.typeMap = typeMap; targetDictionary = new Dictionary(); }
/** * Construct a parser for CSV lines that encodes the parsed data in vector form. * @param targetName The name of the target variable. * @param typeMap A map describing the types of the predictor variables. */ public CsvRecordFactory(String targetName, Map<String, String> typeMap) { this.targetName = targetName; this.typeMap = typeMap; targetDictionary = new Dictionary(); }
/** * Construct a parser for CSV lines that encodes the parsed data in vector form. * @param targetName The name of the target variable. * @param typeMap A map describing the types of the predictor variables. */ public CsvRecordFactory(String targetName, Map<String, String> typeMap) { this.targetName = targetName; this.typeMap = typeMap; targetDictionary = new Dictionary(); }
public static Dictionary fromList(Iterable<String> values) { Dictionary dict = new Dictionary(); for (String value : values) { dict.intern(value); } return dict; } }
public static Dictionary fromList(Iterable<String> values) { Dictionary dict = new Dictionary(); for (String value : values) { dict.intern(value); } return dict; } }
public static Dictionary fromList(Iterable<String> values) { Dictionary dict = new Dictionary(); for (String value : values) { dict.intern(value); } return dict; } }
FeatureVectorEncoder lines = new ConstantValueEncoder("Lines"); lines.setTraceDictionary(traceDictionary); Dictionary newsGroups = new Dictionary();
Dictionary newsGroups = new Dictionary();
Dictionary dict = new Dictionary();
@Test public void testDictionaryOrder() { Dictionary dict = new Dictionary(); dict.intern("a"); dict.intern("d"); dict.intern("c"); dict.intern("b"); dict.intern("qrz"); assertEquals("[a, d, c, b, qrz]", dict.values().toString()); Dictionary dict2 = Dictionary.fromList(dict.values()); assertEquals("[a, d, c, b, qrz]", dict2.values().toString()); } }