use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class QuantizeTransformTest method makeFeatureVector.
public FeatureVector makeFeatureVector() {
Map<String, Set<String>> stringFeatures = new HashMap<>();
Map<String, Map<String, Double>> floatFeatures = new HashMap<>();
Set list = new HashSet<String>();
list.add("aaa");
list.add("bbb");
stringFeatures.put("strFeature1", list);
Map<String, Double> map = new HashMap<>();
map.put("lat", 37.7);
map.put("long", 40.0);
floatFeatures.put("loc", map);
FeatureVector featureVector = new FeatureVector();
featureVector.setStringFeatures(stringFeatures);
featureVector.setFloatFeatures(floatFeatures);
return featureVector;
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class QuantizeTransformTest method testEmptyFeatureVector.
@Test
public void testEmptyFeatureVector() {
Config config = ConfigFactory.parseString(makeConfig());
Transform transform = TransformFactory.createTransform(config, "test_quantize");
FeatureVector featureVector = new FeatureVector();
transform.doTransform(featureVector);
assertTrue(featureVector.getStringFeatures() == null);
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class ReplaceAllStringsTransformTest method makeFeatureVector.
public FeatureVector makeFeatureVector() {
Map<String, Set<String>> stringFeatures = new HashMap<>();
Set<String> list = new HashSet<>();
list.add("I like blueberry pie, apple pie; and I also like blue!");
list.add("I'm so excited: I like blue!?!!");
stringFeatures.put("strFeature1", list);
FeatureVector featureVector = new FeatureVector();
featureVector.setStringFeatures(stringFeatures);
return featureVector;
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class ReplaceAllStringsTransformTest method testEmptyFeatureVector.
@Test
public void testEmptyFeatureVector() {
Config config = ConfigFactory.parseString(makeConfig(makeReplacements(), false));
Transform transform = TransformFactory.createTransform(config, "test_replace_all_strings");
FeatureVector featureVector = new FeatureVector();
transform.doTransform(featureVector);
assertTrue(featureVector.getStringFeatures() == null);
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class FloatCrossFloatTransformTest method testEmptyFeatureVector.
@Test
public void testEmptyFeatureVector() {
Config config = ConfigFactory.parseString(makeConfig());
Transform transform = TransformFactory.createTransform(config, "test_float_cross_float");
FeatureVector featureVector = new FeatureVector();
transform.doTransform(featureVector);
assertTrue(featureVector.getFloatFeatures() == null);
}
Aggregations