@Override public void setProbes(int probes) { super.setProbes(probes); initCaches(); }
@Override public void setProbes(int probes) { super.setProbes(probes); initCaches(); }
public CachingTextValueEncoder(String name, int dataSize) { super(name); setWordEncoder(new CachingStaticWordValueEncoder(name, dataSize)); } }
/** * Sets the number of locations in the feature vector that a value should be in. * This causes the cached probe locations to be recomputed. * * @param probes Number of locations to increment. */ @Override public void setProbes(int probes) { super.setProbes(probes); cacheProbeLocations(getSeed()); }
@Test public void testAsString() { FeatureVectorEncoder enc = new ContinuousValueEncoder("foo"); assertEquals("foo:123", enc.asString("123")); }
@Test public void testAsString() { FeatureVectorEncoder enc = new ConstantValueEncoder("foo"); assertEquals("foo", enc.asString("123")); }
/** * 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 CachingStaticWordValueEncoder(String name, int dataSize) { super(name); this.dataSize = dataSize; initCaches(); }
@Override protected int hashForProbe(byte[] originalForm, int dataSize, String name, int probe) { return hash(name, probe, dataSize); } }
/** * Converts a value into a form that would help a human understand the internals of how the value * is being interpreted. For text-like things, this is likely to be a list of the terms found with * associated weights (if any). * * @param originalForm The original form of the value as a string. * @return A string that a human can read. */ @Override public String asString(String originalForm) { return getName() + ':' + originalForm; }
public CachingContinuousValueEncoder(String name, int dataSize) { super(name); this.dataSize = dataSize; initCaches(); }
/** * Sets the number of locations in the feature vector that a value should be in. * This causes the cached probe locations to be recomputed. * * @param probes Number of locations to increment. */ @Override public void setProbes(int probes) { super.setProbes(probes); cacheProbeLocations(getSeed()); }
public CachingTextValueEncoder(String name, int dataSize) { super(name); setWordEncoder(new CachingStaticWordValueEncoder(name, dataSize)); } }
@Override public void setProbes(int probes) { super.setProbes(probes); initCaches(); }
@Override public void setProbes(int probes) { super.setProbes(probes); initCaches(); }
public CachingStaticWordValueEncoder(String name, int dataSize) { super(name); this.dataSize = dataSize; initCaches(); }
/** * Sets the number of locations in the feature vector that a value should be in. * This causes the cached probe locations to be recomputed. * * @param probes Number of locations to increment. */ @Override public void setProbes(int probes) { super.setProbes(probes); cacheProbeLocations(getSeed()); }
public CachingTextValueEncoder(String name, int dataSize) { super(name); setWordEncoder(new CachingStaticWordValueEncoder(name, dataSize)); } }
@Override public void setProbes(int probes) { super.setProbes(probes); initCaches(); }
@Override public void setProbes(int probes) { super.setProbes(probes); initCaches(); }