Class ReplaceUnusualValue<T extends FeatureInput>
Object
AnchorBean<Feature<T>>
InitializableBean<Feature<T>,FeatureInitialization>
Feature<T>
FeatureUnary<T,T>
FeatureUnaryGeneric<T>
WithValueBase<T>
ReplaceUnusualValue<T>
- Type Parameters:
T
- the type ofFeatureInput
this feature operates on
- Direct Known Subclasses:
ReplaceInfinity
,ReplaceNaN
Calculates the underlying feature, but replaces the result with a constant if it is an "unusual"
value.
This abstract class extends WithValueBase
to provide a mechanism for replacing
specific unusual values (e.g., NaN, Infinity) in feature calculation results with a predefined
constant.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
combineDescription
(String valueDescription, String featureDescription) Combines the descriptions of the constant value and the feature.protected double
combineValueAndFeature
(double value, double featureResult) Combines the constant value with the feature result.protected abstract boolean
isResultUnusual
(double featureResult) Determines if the feature result is considered unusual and should be replaced.Methods inherited from class org.anchoranalysis.plugin.operator.feature.bean.WithValueBase
calculate, descriptionLong, getValue, setValue
Methods inherited from class org.anchoranalysis.feature.bean.operator.FeatureUnary
getItem, inputType, setItem
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toString
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
ReplaceUnusualValue
public ReplaceUnusualValue()
-
-
Method Details
-
combineValueAndFeature
protected double combineValueAndFeature(double value, double featureResult) Description copied from class:WithValueBase
Combines the constant value with the feature result.- Specified by:
combineValueAndFeature
in classWithValueBase<T extends FeatureInput>
- Parameters:
value
- the constant value specified for this operationfeatureResult
- the result of the feature calculation- Returns:
- the combined result
-
combineDescription
Description copied from class:WithValueBase
Combines the descriptions of the constant value and the feature.- Specified by:
combineDescription
in classWithValueBase<T extends FeatureInput>
- Parameters:
valueDescription
- the description of the constant valuefeatureDescription
- the description of the feature- Returns:
- the combined description
-
isResultUnusual
protected abstract boolean isResultUnusual(double featureResult) Determines if the feature result is considered unusual and should be replaced.- Parameters:
featureResult
- the result of the feature calculation- Returns:
- true if the result is unusual and should be replaced, false otherwise
-