Class ExportFeatures<T extends InputFromManager,S,U extends FeatureInput>
- Type Parameters:
T- SeeTaskS- a source-of-features that is duplicated for each new thread (to prevent any concurrency issues)U- feature-input type forfeaturesbean-field
public class ExportFeatures<T extends InputFromManager,S,U extends FeatureInput>
extends Task<T,FeatureExporter<S>>
Calculates features and exports them as a CSV file.
Aggregated-features (based upon a certain grouping) can also be calculated.
The following outputs are produced:
| Output Name | Default? | Description |
|---|---|---|
| "features" | yes | a single CSV file of feature-calculations where each row is an object. |
| "features""Aggregated" | yes | a single CSV file of feature-calculations where each row is a group (with aggregated features of the objects within). |
| "features""Group" | no | a CSV file of feature-calculations per group, where each row is an object. |
| "features""AggregatedGroup" | no | a XML file of aggregated feature-calculations per group |
outputs from a sub-class of FeatureSource as used in source. | ||
outputs from Task | ||
outputs from FeatureResultsAndThumbnails |
- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FeatureOutputNamesDefault names for various outputs from the task. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterAllJobsAreExecuted(FeatureExporter<S> sharedState, InputOutputContext context) Called once after all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>).beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<T> inputs, ParametersExperiment parameters) Called once before all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>).If specified, default rules for determine which outputs are enabled or not.voiddoJobOnInput(InputBound<T, FeatureExporter<S>> input) Performs the task on a particular input.The features to be exported (after possibly some manipulation or augmentation).Features applied to each group to aggregate values (acceptingFeatureInputResults).getGroup()Includes an additional group column in CSVs, and creates group-specific feature files.getId()Translates an input file name to a unique ID.FeatureSource<T, S, U> Source of feature-values to be exported.getStyle()Visual style for how feature export occurs.booleanIs the execution-time of the task per-input expected to be very quick to execute?Highest class(es) that will function as a valid input.voidsetFeatures(List<NamedBean<FeatureListProvider<U>>> features) The features to be exported (after possibly some manipulation or augmentation).voidsetFeaturesAggregate(List<NamedBean<FeatureListProvider<FeatureInputResults>>> featuresAggregate) Features applied to each group to aggregate values (acceptingFeatureInputResults).voidIncludes an additional group column in CSVs, and creates group-specific feature files.voidsetId(DerivePath id) Translates an input file name to a unique ID.voidsetSource(FeatureSource<T, S, U> source) Source of feature-values to be exported.voidsetStyle(ExportFeaturesStyle style) Visual style for how feature export occurs.Methods inherited from class org.anchoranalysis.experiment.bean.task.Task
executeJob, isInputCompatibleWithMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Field Details
-
OUTPUT_NAMES
Default names for various outputs from the task.
-
-
Constructor Details
-
ExportFeatures
public ExportFeatures()
-
-
Method Details
-
beforeAnyJobIsExecuted
public FeatureExporter<S> beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<T> inputs, ParametersExperiment parameters) throws ExperimentExecutionException Description copied from class:TaskCalled once before all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>).- Specified by:
beforeAnyJobIsExecutedin classTask<T extends InputFromManager,FeatureExporter<S>> - Parameters:
outputter- the output-manager for the experiment (not for an individual job)concurrencyPlan- available numbers of processors that can callTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)inputs- a list of inputs, each will result in at least one call toTask.executeJob(ParametersUnbound).parameters- the experiment-parameters.- Returns:
- the shared-state that is passed to each call to
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)and toTask.afterAllJobsAreExecuted(S, org.anchoranalysis.io.output.outputter.InputOutputContext). - Throws:
ExperimentExecutionException- if a fatal error occurs executing this step of the experiment.
-
doJobOnInput
Description copied from class:TaskPerforms the task on a particular input.- Specified by:
doJobOnInputin classTask<T extends InputFromManager,FeatureExporter<S>> - Parameters:
input- the input for the job.- Throws:
JobExecutionException- if an error occurs executing a particular job, that is not otherwise suppressed.
-
afterAllJobsAreExecuted
public void afterAllJobsAreExecuted(FeatureExporter<S> sharedState, InputOutputContext context) throws ExperimentExecutionException Description copied from class:TaskCalled once after all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>).- Specified by:
afterAllJobsAreExecutedin classTask<T extends InputFromManager,FeatureExporter<S>> - Parameters:
sharedState- the shared-statecontext- IO-context for experiment (not for an individual job)- Throws:
ExperimentExecutionException- if a fatal error occurs executing this step of the experiment.
-
defaultOutputs
Description copied from class:TaskIf specified, default rules for determine which outputs are enabled or not.- Overrides:
defaultOutputsin classTask<T extends InputFromManager,FeatureExporter<S>> - Returns:
- the default rules if they exist.
-
hasVeryQuickPerInputExecution
public boolean hasVeryQuickPerInputExecution()Description copied from class:TaskIs the execution-time of the task per-input expected to be very quick to execute?- Specified by:
hasVeryQuickPerInputExecutionin classTask<T extends InputFromManager,FeatureExporter<S>> - Returns:
- true iff the execution is expected to be very quick, false otherwise.
-
inputTypesExpected
Description copied from class:TaskHighest class(es) that will function as a valid input.This is usually the class of T (or sometimes the absolute base class InputFromManager).
- Specified by:
inputTypesExpectedin classTask<T extends InputFromManager,FeatureExporter<S>> - Returns:
- the input-types that a task expects.
-
getSource
Source of feature-values to be exported. -
setSource
Source of feature-values to be exported. -
getGroup
Includes an additional group column in CSVs, and creates group-specific feature files. -
setGroup
Includes an additional group column in CSVs, and creates group-specific feature files. -
getId
Translates an input file name to a unique ID. -
setId
Translates an input file name to a unique ID. -
getFeatures
The features to be exported (after possibly some manipulation or augmentation). -
setFeatures
The features to be exported (after possibly some manipulation or augmentation). -
getFeaturesAggregate
Features applied to each group to aggregate values (acceptingFeatureInputResults).If not specified, a default list of mean, standard-deviation, min, max etc. of every feature is used.
-
setFeaturesAggregate
public void setFeaturesAggregate(List<NamedBean<FeatureListProvider<FeatureInputResults>>> featuresAggregate) Features applied to each group to aggregate values (acceptingFeatureInputResults).If not specified, a default list of mean, standard-deviation, min, max etc. of every feature is used.
-
getStyle
Visual style for how feature export occurs. -
setStyle
Visual style for how feature export occurs.
-