Class Preprocessing

java.lang.Object
qupath.opencv.ml.objects.features.Preprocessing

public class Preprocessing extends Object
Helper class for preprocessing input for machine learning algorithms using OpenCV Mats.
Author:
Pete Bankhead
  • 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 projector
      retainedVariance - variance to retain (determines the number of output features)
      normalize - if true, normalize the output features
      Returns:
      a Preprocessing.PCAProjector that 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 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 Normalizer that may be applied to new data
    • normalize

      public static void normalize(Mat samples, Normalizer normalizer)
      Apply a Normalizer to new training data samples. Features may be either columns or channels.
      Parameters:
      samples - the input data
      normalizer - the normalizer to apply