Class FeatureSource<T extends InputFromManager,S,U extends FeatureInput>
- Type Parameters:
T
- input-type from which one or more rows of features are derivedS
- row-source that is duplicated for each new thread (to prevent any concurrency issues)U
- feature-input type forfeatures
bean-field
- Direct Known Subclasses:
SingleRowPerInput
public abstract class FeatureSource<T extends InputFromManager,S,U extends FeatureInput>
extends AnchorBean<FeatureSource<T,S,U>>
Extracts features from some kind of inputs to produce one or more rows in a feature-table.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
calculateAndOutput
(T input, FeatureCalculationContext<S> context) Processes one input to calculate feature-results and output them to the file-system.abstract FeatureExporter
<S> createExporter
(LabelHeaders metadataHeaders, List<NamedBean<FeatureListProvider<U>>> features, FeatureOutputNames outputNames, Optional<InputGrouper> grouper, FeatureExporterContext context) Creates theFeatureExporter
to be used for calculating and exporting feature-results.abstract LabelHeaders
headers
(boolean groupsEnabled) Generates label-headers for the non-feature-result columns in the CSV.abstract boolean
includeGroupInExperiment
(boolean groupGeneratorDefined) Determines if group columns should be added to the CSV exports and other group exports may occur in sub-directories.abstract InputTypesExpected
Specifies the highest class(es) that will function as a valid input.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
FeatureSource
public FeatureSource()
-
-
Method Details
-
createExporter
public abstract FeatureExporter<S> createExporter(LabelHeaders metadataHeaders, List<NamedBean<FeatureListProvider<U>>> features, FeatureOutputNames outputNames, Optional<InputGrouper> grouper, FeatureExporterContext context) throws CreateException Creates theFeatureExporter
to be used for calculating and exporting feature-results.- Parameters:
metadataHeaders
- headers to use for additional "metadata" before feature-results.features
- the features to calculate.outputNames
- the names of various kind of outputs.grouper
- when defined, assigns each input to a group.context
- IO-context.- Returns:
- a newly created
FeatureExporter
as matches this source of features. - Throws:
CreateException
- if it cannot be created.
-
includeGroupInExperiment
public abstract boolean includeGroupInExperiment(boolean groupGeneratorDefined) Determines if group columns should be added to the CSV exports and other group exports may occur in sub-directories.- Parameters:
groupGeneratorDefined
- has a group-generator been defined for this experiment?- Returns:
- true if a group-generator has been defined, false otherwise
-
headers
Generates label-headers for the non-feature-result columns in the CSV.- Parameters:
groupsEnabled
- whether groups are enabled- Returns:
- a
LabelHeaders
object for the non-feature-result columns
-
calculateAndOutput
public abstract void calculateAndOutput(T input, FeatureCalculationContext<S> context) throws OperationFailedException Processes one input to calculate feature-results and output them to the file-system.- Parameters:
input
- one particular input that will create one or more "rows" in a feature-tablecontext
- theFeatureCalculationContext
for calculation- Throws:
OperationFailedException
- if the operation fails
-
inputTypesExpected
Specifies the highest class(es) that will function as a valid input.This is usually the class of T (or sometimes the absolute base class
InputFromManager
)- Returns:
- an
InputTypesExpected
object specifying the expected input types
-