Class StandardPrediction
java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.StandardPrediction
- All Implemented Interfaces:
PredictionResult
- Direct Known Subclasses:
DeepAcousticsPrediction,DelphinIDPrediction,KetosResult,SoundSpotResult
Result from the SoundSpot classifier.
- Author:
- Jamie Macaulay
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStandardPrediction(float[] prob) Create a result for the Sound Spot classifier.StandardPrediction(float[] prob, boolean isBinary) StandardPrediction(float[] prob, short[] classNameID, boolean isBinary) Constructor for a typical generic prediciton. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the analysis time.short[]Get the class name IDs associated with this result.double[]Get frequency limits of the prediction resultfloat[]Get the predictions for this result.String representation of the resultintGet duration in sample - this is the number of samples in the result.longGet the start sample - this is the sample number of the first sample in the result.longGet the time stamp.booleanCheck whether binary classification has passed.voidsetAnalysisTime(double analysisTime) voidsetBinaryClassification(boolean binaryResult) Set the binary classification.voidsetClassNameID(short[] classNameID) Set the IDs of the class names.voidsetDuratioSamples(int durationMillis) Set the duration in millis.voidsetFreqLimits(double[] freqLimits) Set the frequency limits of the prediction result.voidsetStartSample(Long startSample) voidsetTimeMillis(long timeMillis)
-
Field Details
-
analysisTime
public double analysisTimeAnalysis time in seconds.
-
-
Constructor Details
-
StandardPrediction
public StandardPrediction(float[] prob, short[] classNameID, boolean isBinary) Constructor for a typical generic prediciton.- Parameters:
prob- - the probability for each class.classNameID- - the ID's of the class names.isBinary- - true if the model result passed a binary test (usually one species above a threshold)
-
StandardPrediction
public StandardPrediction(float[] prob, boolean isBinary) -
StandardPrediction
public StandardPrediction(float[] prob) Create a result for the Sound Spot classifier.- Parameters:
prob- - the probability of each class.
-
-
Method Details
-
getPrediction
public float[] getPrediction()Description copied from interface:PredictionResultGet the predictions for this result. The array contains the probabilities for all classes.- Specified by:
getPredictionin interfacePredictionResult- Returns:
- the prediction.
-
isBinaryClassification
public boolean isBinaryClassification()Description copied from interface:PredictionResultCheck whether binary classification has passed.- Specified by:
isBinaryClassificationin interfacePredictionResult- Returns:
- true if binary classification has passed
-
getAnalysisTime
public double getAnalysisTime()Description copied from interface:PredictionResultGet the analysis time.- Specified by:
getAnalysisTimein interfacePredictionResult- Returns:
- the analysis time.
-
setAnalysisTime
public void setAnalysisTime(double analysisTime) -
getResultString
Description copied from interface:PredictionResultString representation of the result- Specified by:
getResultStringin interfacePredictionResult- Returns:
- a string of the result.
-
getClassNames
public short[] getClassNames()Description copied from interface:PredictionResultGet the class name IDs associated with this result. Can be null. @see DLClassNameManager to get strings of class names.- Specified by:
getClassNamesin interfacePredictionResult- Returns:
- a list of the class name ID for the result. Can be null or an array the same length as getPrediciton();
-
setClassNameID
public void setClassNameID(short[] classNameID) Set the IDs of the class names. Use a class name manager to retrieve the actual String names.- Parameters:
classNameID- - the class name IDs.
-
setBinaryClassification
public void setBinaryClassification(boolean binaryResult) Set the binary classification.- Parameters:
binaryResult- - the binary classification.
-
getTimeMillis
public long getTimeMillis()Description copied from interface:PredictionResultGet the time stamp.- Specified by:
getTimeMillisin interfacePredictionResult- Returns:
- the millis datenumber.
-
setTimeMillis
public void setTimeMillis(long timeMillis) -
getSampleDuration
public int getSampleDuration()Description copied from interface:PredictionResultGet duration in sample - this is the number of samples in the result. Note: required for object detection results where the duration is not the same as the input data- Specified by:
getSampleDurationin interfacePredictionResult- Returns:
- the duration of the result in samples.
-
getFreqLimits
public double[] getFreqLimits()Description copied from interface:PredictionResultGet frequency limits of the prediction result- Specified by:
getFreqLimitsin interfacePredictionResult- Returns:
- the frequency limits of the prediction result
-
setFreqLimits
public void setFreqLimits(double[] freqLimits) Set the frequency limits of the prediction result.- Parameters:
freqLimits- - the frequency limits of the prediction result.
-
setDuratioSamples
public void setDuratioSamples(int durationMillis) Set the duration in millis.- Parameters:
durationMillis- - the duration in millis.
-
setStartSample
-
getStartSample
public long getStartSample()Description copied from interface:PredictionResultGet the start sample - this is the sample number of the first sample in the result. * Note: required for object detection results where the start sample may not be same as the input data- Specified by:
getStartSamplein interfacePredictionResult- Returns:
- the start sample
-