Class Normalizer
java.lang.Object
qupath.opencv.ml.objects.features.Normalizer
Class to help with simple feature normalization, by adding an offset and then multiplying by a scaling factor.
- 
Method SummaryModifier and TypeMethodDescriptionstatic NormalizercreateNormalizer(double[] offsets, double[] scales, double missingValue) Create aNormalizerwith the specified parameters.doubleReturn the value that will be output after normalization if the computed value is not finite.doublegetOffset(int ind) Get the offset for the specified featuredoublegetScale(int ind) Get the scale factor for the specified featurebooleanReturns true if this normalizer does not actually do anything.intThe total number of features supported by thisNormalizerdoublenormalizeFeature(int idx, double originalValue) Normalize a single feature.
- 
Method Details- 
createNormalizerCreate aNormalizerwith the specified parameters.- Parameters:
- offsets- value to add to each feature
- scales- value to multiply each feature, after applying the offset
- missingValue- replacement value for non-finite features
- Returns:
- a Normalizerinitialized accordingly
 
- 
normalizeFeaturepublic double normalizeFeature(int idx, double originalValue) Normalize a single feature.- Parameters:
- idx- the index of the feature; this is required to identify the corresponding offset and scale
- originalValue- the original value of the feature
- Returns:
- the normalized value of the feature
 
- 
isIdentitypublic boolean isIdentity()Returns true if this normalizer does not actually do anything. This is the case if all offsets are zero and all scales are 1.- Returns:
 
- 
getMissingValuepublic double getMissingValue()Return the value that will be output after normalization if the computed value is not finite.- Returns:
 
- 
nFeaturespublic int nFeatures()The total number of features supported by thisNormalizer- Returns:
 
- 
getOffsetpublic double getOffset(int ind) Get the offset for the specified feature- Parameters:
- ind- index of the feature
- Returns:
 
- 
getScalepublic double getScale(int ind) Get the scale factor for the specified feature- Parameters:
- ind- index of the feature
- Returns:
 
 
-