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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper class to apply PCA projection. -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
Preprocessing
public Preprocessing()
-
-
Method Details
-
createPCAProjector
public 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 projectorretainedVariance- 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
-
createNormalizer
public static Normalizer createNormalizer(Normalization normalization, Mat samples, double missingValue) Create a simple normalizer to rescale input data.- Parameters:
normalization- the method of normalization to applysamples- the input samples used to determine the normalization parametermissingValue- 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
-
normalize
Apply aNormalizerto new training data samples. Features may be either columns or channels.- Parameters:
samples- the input datanormalizer- the normalizer to apply
-