Class AbstractDyadScaler

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    DyadMinMaxScaler, DyadStandardScaler, DyadUnitIntervalScaler

    public abstract class AbstractDyadScaler
    extends java.lang.Object
    implements java.io.Serializable
    A scaler that can be fit to a certain dataset and then be used to standardize datasets, i.e. transform the data to have a mean of 0 and a standard deviation of 1 according to the data it was fit to.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.commons.math3.stat.descriptive.SummaryStatistics[] statsX  
      protected org.apache.commons.math3.stat.descriptive.SummaryStatistics[] statsY  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void fit​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
      Fits the standard scaler to the dataset.
      void fitTransform​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
      Fits the standard scaler to the dataset and transforms the entire dataset according to the mean and standard deviation of the dataset.
      java.lang.String getPrettyMeansString()
      Returns a String for the means of all features this scaler has been fit to.
      java.lang.String getPrettySTDString()
      Prints the standard devations of all features this scaler has been fit to.
      org.apache.commons.math3.stat.descriptive.SummaryStatistics[] getStatsX()  
      org.apache.commons.math3.stat.descriptive.SummaryStatistics[] getStatsY()  
      void transform​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
      Transforms the entire dataset according to the mean and standard deviation of the data the scaler has been fit to.
      void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
      Transforms only the alternatives of each dyad according to the mean and standard deviation of the data the scaler has been fit to.
      void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the alternatives of each dyad in a DyadRankingDataset according to the mean and standard deviation of the data the scaler has been fit to.
      void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the alternatives of each dyad in an IDyadRankingInstance according to the mean and standard deviation of the data the scaler has been fit to.
      abstract void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyad dyad, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the alternatives of each dyad according to the mean and standard deviation of the data the scaler has been fit to.
      abstract void transformInstaceVector​(org.api4.java.common.math.IVector vector, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms an instance feature vector.
      void transformInstances​(SparseDyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the instances of each dyad in a SparseDyadRankingInstance according to the mean and standard deviation of the data the scaler has been fit to.
      void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
      Transforms only the instances of each dyad according to the mean and standard of the data the scaler has been fit to.
      void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the instances of each dyad in a DyadRankingDataset according to the mean and standard deviation of the data the scaler has been fit to.
      void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the instances of each dyad in a DenseDyadRankingInstance according to the mean and standard deviation of the data the scaler has been fit to.
      abstract void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyad dyad, java.util.List<java.lang.Integer> ignoredIndices)
      Transforms only the instances of each dyad according to the mean and standard deviation of the data the scaler has been fit to.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • statsX

        protected org.apache.commons.math3.stat.descriptive.SummaryStatistics[] statsX
      • statsY

        protected org.apache.commons.math3.stat.descriptive.SummaryStatistics[] statsY
    • Constructor Detail

      • AbstractDyadScaler

        public AbstractDyadScaler()
    • Method Detail

      • getStatsX

        public org.apache.commons.math3.stat.descriptive.SummaryStatistics[] getStatsX()
      • getStatsY

        public org.apache.commons.math3.stat.descriptive.SummaryStatistics[] getStatsY()
      • fit

        public void fit​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
        Fits the standard scaler to the dataset.
        Parameters:
        dataset - The dataset the scaler should be fit to.
      • transform

        public void transform​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
        Transforms the entire dataset according to the mean and standard deviation of the data the scaler has been fit to.
        Parameters:
        dataset - The dataset to be standardized.
      • transformInstances

        public void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
        Transforms only the instances of each dyad according to the mean and standard of the data the scaler has been fit to.
        Parameters:
        dataset - The dataset of which the instances are to be standardized.
      • transformAlternatives

        public void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
        Transforms only the alternatives of each dyad according to the mean and standard deviation of the data the scaler has been fit to.
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
      • transformInstances

        public abstract void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyad dyad,
                                                java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the instances of each dyad according to the mean and standard deviation of the data the scaler has been fit to. The attributes with indices contained in ignoredIndices are not transformed. {
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • transformAlternatives

        public abstract void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyad dyad,
                                                   java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the alternatives of each dyad according to the mean and standard deviation of the data the scaler has been fit to.
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • transformInstaceVector

        public abstract void transformInstaceVector​(org.api4.java.common.math.IVector vector,
                                                    java.util.List<java.lang.Integer> ignoredIndices)
        Transforms an instance feature vector.
        Parameters:
        Instance - vector to be transformed
        ignoredIndices -
      • transformInstances

        public void transformInstances​(SparseDyadRankingInstance drInstance,
                                       java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the instances of each dyad in a SparseDyadRankingInstance according to the mean and standard deviation of the data the scaler has been fit to. The attributes with indices contained in ignoredIndices are not transformed. {
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • transformInstances

        public void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance drInstance,
                                       java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the instances of each dyad in a DenseDyadRankingInstance according to the mean and standard deviation of the data the scaler has been fit to. The attributes with indices contained in ignoredIndices are not transformed. {
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • transformAlternatives

        public void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance drInstance,
                                          java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the alternatives of each dyad in an IDyadRankingInstance according to the mean and standard deviation of the data the scaler has been fit to. The attributes with indices contained in ignoredIndices are not transformed. {
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • transformInstances

        public void transformInstances​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset,
                                       java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the instances of each dyad in a DyadRankingDataset according to the mean and standard deviation of the data the scaler has been fit to. The attributes with indices contained in ignoredIndices are not transformed. {
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • transformAlternatives

        public void transformAlternatives​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset,
                                          java.util.List<java.lang.Integer> ignoredIndices)
        Transforms only the alternatives of each dyad in a DyadRankingDataset according to the mean and standard deviation of the data the scaler has been fit to. The attributes with indices contained in ignoredIndices are not transformed. {
        Parameters:
        dataset - The dataset of which the alternatives are to be standardized.
        ignoredIndices - The List of indices that are been ignored by the scaler.
      • fitTransform

        public void fitTransform​(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
        Fits the standard scaler to the dataset and transforms the entire dataset according to the mean and standard deviation of the dataset.
        Parameters:
        dataset - The dataset to be standardized.
      • getPrettySTDString

        public java.lang.String getPrettySTDString()
        Prints the standard devations of all features this scaler has been fit to.
      • getPrettyMeansString

        public java.lang.String getPrettyMeansString()
        Returns a String for the means of all features this scaler has been fit to.