Search in sources :

Example 26 with FloatVector

use of com.airbnb.aerosolve.core.util.FloatVector in project aerosolve by airbnb.

the class LowRankLinearModelTest method makeLabelWeightVector.

Map<String, FloatVector> makeLabelWeightVector() {
    Map<String, FloatVector> labelWeights = new HashMap<>();
    float[] animalFeature = { 1.0f, 0.0f, 0.0f };
    float[] colorFeature = { 0.0f, 1.0f, 0.0f };
    float[] fruitFeature = { 0.0f, 0.0f, 1.0f };
    labelWeights.put("A", new FloatVector(animalFeature));
    labelWeights.put("C", new FloatVector(colorFeature));
    labelWeights.put("F", new FloatVector(fruitFeature));
    return labelWeights;
}
Also used : HashMap(java.util.HashMap) FloatVector(com.airbnb.aerosolve.core.util.FloatVector)

Aggregations

FloatVector (com.airbnb.aerosolve.core.util.FloatVector)26 ModelRecord (com.airbnb.aerosolve.core.ModelRecord)8 HashMap (java.util.HashMap)5 ModelHeader (com.airbnb.aerosolve.core.ModelHeader)4 MulticlassScoringResult (com.airbnb.aerosolve.core.MulticlassScoringResult)3 Map (java.util.Map)3 LabelDictionaryEntry (com.airbnb.aerosolve.core.LabelDictionaryEntry)2 SupportVector (com.airbnb.aerosolve.core.util.SupportVector)2 ArrayList (java.util.ArrayList)2 DebugScoreRecord (com.airbnb.aerosolve.core.DebugScoreRecord)1 FeatureVector (com.airbnb.aerosolve.core.FeatureVector)1 BufferedReader (java.io.BufferedReader)1 BufferedWriter (java.io.BufferedWriter)1 CharArrayWriter (java.io.CharArrayWriter)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 java.util (java.util)1 AbstractMap (java.util.AbstractMap)1 Test (org.junit.Test)1