Class Detector<T extends DetectorWorker>
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.api.model.detection.Detector<T>
-
- Type Parameters:
T
-DetectorWorker
implementation used by this detector
- All Implemented Interfaces:
IDetector<T>
- Direct Known Subclasses:
PairwiseDetector
public abstract class Detector<T extends DetectorWorker> extends java.lang.Object implements IDetector<T>
Abstract implementation of the IDetector interface, this should be used as the base to construct all detectors
Supports adjustable parameters seeAdjustableParameter
-
-
Constructor Summary
Constructors Constructor Description Detector(java.lang.String displayName, java.lang.String description, PreProcessingStrategy... preProcessingStrategies)
IDetector
implementation with descriptionDetector(java.lang.String displayName, PreProcessingStrategy... preProcessingStrategies)
IDetector
implementation without description
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List<T>
buildWorkers(java.util.List<ModelDataItem> data)
Builds a set of workers on a passed dataset, these workers are executed in parallel to produce the algorithm resultjava.lang.String
getDescription()
Fetches the description string for the detectorjava.lang.String
getDisplayName()
Fetches the display name for the detectorjava.util.List<PreProcessingStrategy>
getPreProcessors()
Specify the preprocessors required for this detector.void
setDescription(java.lang.String description)
Sets the user facing description
-
-
-
Constructor Detail
-
Detector
public Detector(java.lang.String displayName, PreProcessingStrategy... preProcessingStrategies)
IDetector
implementation without description- Parameters:
displayName
- user facing display name for the detectorpreProcessingStrategies
- preprocessing strategies to use for this detector, can be one of many.
-
Detector
public Detector(java.lang.String displayName, java.lang.String description, PreProcessingStrategy... preProcessingStrategies)
IDetector
implementation with description- Parameters:
displayName
- user facing display name for the detectordescription
- user facing description for the detectorpreProcessingStrategies
- preprocessing strategies to use for this detector, can be one of many.
-
-
Method Detail
-
buildWorkers
public abstract java.util.List<T> buildWorkers(java.util.List<ModelDataItem> data)
Builds a set of workers on a passed dataset, these workers are executed in parallel to produce the algorithm result- Specified by:
buildWorkers
in interfaceIDetector<T extends DetectorWorker>
- Parameters:
data
- preprocessed dataset- Returns:
- list of configured workers ready to be executed
-
getDescription
public final java.lang.String getDescription()
Fetches the description string for the detector- Specified by:
getDescription
in interfaceIDetector<T extends DetectorWorker>
- Returns:
- the description
-
setDescription
public final void setDescription(java.lang.String description)
Sets the user facing description- Parameters:
description
- description string
-
getDisplayName
public final java.lang.String getDisplayName()
Fetches the display name for the detector- Specified by:
getDisplayName
in interfaceIDetector<T extends DetectorWorker>
- Returns:
- the display name
-
getPreProcessors
public final java.util.List<PreProcessingStrategy> getPreProcessors()
Specify the preprocessors required for this detector.
The individual strategies in the list can be produced using the generic methodsPreProcessingStrategy.of(String, Class...)
orPreProcessingStrategy.of(String, boolean, Class...)
in the interface, or using a fully customPreProcessingStrategy
class.
The string name of each of the strategies is used as the key reference in the preprocessed dataset given to theIDetector.buildWorkers(List)
method- Specified by:
getPreProcessors
in interfaceIDetector<T extends DetectorWorker>
- Returns:
- a list of the required preprocessing strategies
-
-