Class RoccaClassifier
- Author:
- Michael Oswald
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRoccaClassifier
(RoccaProcess roccaProcess) Create RoccaClassifier object for RoccaProcess -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
NO LONGER USED, since the addition of the RoccaRFModel objectvoid
Classifies the passed contourclassifySighting
(String detectionHeader, String detectionStats) Use the event classifier to classify the current sightingvoid
Clears the species list for this classifierString[]
generates list of species classes.String[]
generates list of species classes.String[]
returns list of species classes.weka.core.DenseInstance
Sets up the available datablock fields to match the classifier modelweka.core.DenseInstance
setAttributes
(RoccaContourDataBlock rcdb, weka.core.Instances trainedDataset) Sets up the available datablock fields to match the classifier modelvoid
setFieldsSet
(boolean fieldsSet) void
setRFModel
(RoccaRFModel rfModel) boolean
Loads the Classifier model from the file specified in RoccaParameters
-
Field Details
-
AMBIG
- See Also:
-
NOCLASS
- See Also:
-
-
Constructor Details
-
RoccaClassifier
Create RoccaClassifier object for RoccaProcess- Parameters:
roccaProcess
-
-
-
Method Details
-
classifyContour
NO LONGER USED, since the addition of the RoccaRFModel objectClassifies the passed contour
Checks to make sure a classifier has been loaded, then runs the setAttributes method to match the passed contour to the parameter list expected by the classifier. Once the attribute vector has been created, the classifier is run and the results are saved to the datablock's classifiedAs field.
- Parameters:
rcdb
-RoccaContourDataBlock
to be classified
-
classifyContour2
Classifies the passed contourChecks to make sure a classifier has been loaded, then calls the RoccaRFModel object to classify the contour. Clears the rcdb tree votes first, since the RccaRFModel object adds to the votes as it iterates through the different classifiers
- Parameters:
rcdb
-RoccaContourDataBlock
to be classified
-
classifySighting
Use the event classifier to classify the current sighting- Parameters:
detectionStats
- a String generated in the RoccaSidePanel object, containing- Returns:
- the species classification
-
setUpClassifier
public boolean setUpClassifier()Loads the Classifier model from the file specified in RoccaParameters- Returns:
- boolean flag indicating success or failure of load
-
setAttributes
Sets up the available datablock fields to match the classifier modelCompares the fields in the passed RoccaContourDataBlack to the fields required for the classifier. If any fields are missing, an error is displayed and the method returns false. If all the fields are available, an Instance is created matching the order of the datablock fields to the order of the classifier fields.
- Parameters:
rcdb
-RoccaContourDataBlock
to be classified- Returns:
Instance
containing the values of the rcdb parameters that match the classifier attributes
-
setAttributes
public weka.core.DenseInstance setAttributes(RoccaContourDataBlock rcdb, weka.core.Instances trainedDataset) Sets up the available datablock fields to match the classifier modelCompares the fields in the passed RoccaContourDataBlack to the fields required for the classifier. If any fields are missing, an error is displayed and the method returns false. If all the fields are available, an Instance is created matching the order of the datablock fields to the order of the classifier fields.
- Parameters:
rcdb
-RoccaContourDataBlock
to be classifiedtrainedDataset
-Instances
containing the training data set- Returns:
Instance
containing the values of the rcdb parameters that match the classifier attributes
-
areFieldsSet
public boolean areFieldsSet() -
setFieldsSet
public void setFieldsSet(boolean fieldsSet) -
getClassifierSpList
returns list of species classes. If variable is null, creates the list first- Returns:
- String[] list of species
-
clearSpeciesList
public void clearSpeciesList()Clears the species list for this classifier -
generateSpList
generates list of species classes. serialVersionUID = 24 2016/08/10 added check for whistle or click classifier 2021/05/11 instead of returning a null if we are not using classifiers, return a "No Classifier" species.- Returns:
- String[] list of species
-
generateSpList_orig
generates list of species classes. If there are two classifiers, both lists will be combined into single list based on trigger class NOTE: this method is the original version, which loaded 2 separate classifier files. No longer used since RoccaRFModel class has been implemented, but I hate to delete the code...- Returns:
- String[] list of species
-
getRFModel
- Returns:
- the random forest model
-
setRFModel
- Parameters:
rfModel
- the random forest Model to set
-