Class ModelResultBinaryFactory
java.lang.Object
rawDeepLearningClassifier.logging.ModelResultBinaryFactory
Handles the saving and loading of Model results from binary files.
ModelResults are generated by a classifier and may have classifier-specific fields that need saved. The model results factory allows unique subclasses of ModelResult to save and load data different data fields to binary fields.
- Author:
- Jamie Macaulay
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlag for model resstatic final intFlag for model resstatic final intFlag for model resstatic final intFlag for model res -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidgetPackedData(PredictionResult modelResult, DataOutputStream dos, int type) Write data to a binary output streamstatic intgetType(PredictionResult modelResult) Get the type flag for a model result.static PredictionResultmakePredictionResult(int type, float[] data, short[] classID, boolean isBinary) Create a prediction result object from data.static PredictionResultsinkData(DataInputStream dis) Read binary data and make a model result
-
Field Details
-
GENERIC
public static final int GENERICFlag for model res- See Also:
-
SOUND_SPOT
public static final int SOUND_SPOTFlag for model res- See Also:
-
DUMMY_RESULT
public static final int DUMMY_RESULTFlag for model res- See Also:
-
KETOS
public static final int KETOSFlag for model res- See Also:
-
-
Constructor Details
-
ModelResultBinaryFactory
public ModelResultBinaryFactory()
-
-
Method Details
-
getPackedData
Write data to a binary output stream- Parameters:
modelResult- - the model result to write.dos-
-
sinkData
Read binary data and make a model result- Parameters:
binaryObjectData-bh-moduleVersion-- Returns:
-
makePredictionResult
public static PredictionResult makePredictionResult(int type, float[] data, short[] classID, boolean isBinary) Create a prediction result object from data.- Parameters:
type- - flag indicating the type of prediction result.classID- - the classIDs associated with the predictionsisBinary- - whether the predictions was classified as being a true positive.predictions- - the predictions.- Returns:
- the prediction result object.
-
getType
Get the type flag for a model result. this is based on the class type.- Parameters:
modelResult- - the model result- Returns:
- the type flag for the subclass of the result.
-