Class Preprocessing
java.lang.Object
qupath.opencv.ml.objects.features.Preprocessing
Helper class for preprocessing input for machine learning algorithms using OpenCV Mats.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classHelper class to apply PCA projection.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic NormalizercreateNormalizer(Normalization normalization, Mat samples, double missingValue) Create a simple normalizer to rescale input data.static Preprocessing.PCAProjectorcreatePCAProjector(Mat data, double retainedVariance, boolean normalize) Create a principle components analysis projection to reduce features.static voidnormalize(Mat samples, Normalizer normalizer) Apply aNormalizerto new training data samples.
- 
Constructor Details- 
Preprocessingpublic Preprocessing()
 
- 
- 
Method Details- 
createPCAProjectorpublic static Preprocessing.PCAProjector createPCAProjector(Mat data, double retainedVariance, boolean normalize) Create a principle components analysis projection to reduce features.- Parameters:
- data- input data used to create the projector
- retainedVariance- variance to retain (determines the number of output features)
- normalize- if true, normalize the output features
- Returns:
- a Preprocessing.PCAProjectorthat can be applied to new data
 
- 
createNormalizerpublic static Normalizer createNormalizer(Normalization normalization, Mat samples, double missingValue) Create a simple normalizer to rescale input data.- Parameters:
- normalization- the method of normalization to apply
- samples- the input samples used to determine the normalization parameter
- missingValue- an optional value that may be used to replace non-finite (i.e. missing) feature values
- Returns:
- a Normalizerthat may be applied to new data
 
- 
normalizeApply aNormalizerto new training data samples. Features may be either columns or channels.- Parameters:
- samples- the input data
- normalizer- the normalizer to apply
 
 
-