use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class FloatToDenseTransformTest method testFloat.
@Test
public void testFloat() {
FeatureVector featureVector = testTransform(makeFeatureVectorFloat());
Map<String, Map<String, Double>> features = featureVector.getFloatFeatures();
assertNotNull(features);
assertEquals(2, features.size());
Map<String, Double> out = features.get("floatFeature1");
assertEquals(2, out.size());
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class FloatToDenseTransformTest method testNoString.
@Test
public void testNoString() {
FeatureVector featureVector = testTransform(makeFeatureVectorString(), notStringConfig());
Map<String, Set<String>> features = featureVector.getStringFeatures();
assertNull(features);
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class FloatToDenseTransformTest method makeFeatureVectorMissFamily.
public static FeatureVector makeFeatureVectorMissFamily() {
Map<String, Map<String, Double>> floatFeatures = new HashMap<>();
Map<String, Double> floatFeature1 = new HashMap<>();
floatFeature1.put("x", 50.0);
floatFeature1.put("y", 1.3);
floatFeature1.put("s", 2000.0);
floatFeatures.put("floatFeature1", floatFeature1);
FeatureVector featureVector = new FeatureVector();
featureVector.setFloatFeatures(floatFeatures);
return featureVector;
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class FloatToDenseTransformTest method testMissFamily.
@Test
public void testMissFamily() {
FeatureVector featureVector = testTransform(makeFeatureVectorMissFamily());
Map<String, List<Double>> denseFeatures = featureVector.getDenseFeatures();
assertNull(denseFeatures);
}
use of com.airbnb.aerosolve.core.FeatureVector in project aerosolve by airbnb.
the class FloatToDenseTransformTest method makeFeatureVectorString.
public FeatureVector makeFeatureVectorString() {
Map<String, Map<String, Double>> floatFeatures = new HashMap<>();
Map<String, Double> floatFeature1 = new HashMap<>();
floatFeature1.put("s", 2000.0);
Map<String, Double> floatFeature2 = new HashMap<>();
floatFeature2.put("k", 2000.0);
floatFeatures.put("floatFeature1", floatFeature1);
floatFeatures.put("floatFeature2", floatFeature2);
FeatureVector featureVector = new FeatureVector();
featureVector.setFloatFeatures(floatFeatures);
return featureVector;
}
Aggregations