Class AbstractDyadScaler
- java.lang.Object
-
- ai.libs.jaicore.ml.ranking.dyad.learner.util.AbstractDyadScaler
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DyadMinMaxScaler,DyadStandardScaler,DyadUnitIntervalScaler
public abstract class AbstractDyadScaler extends java.lang.Object implements java.io.SerializableA 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
-
-
Constructor Summary
Constructors Constructor Description AbstractDyadScaler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidfit(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)Fits the standard scaler to the dataset.voidfitTransform(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.StringgetPrettyMeansString()Returns a String for the means of all features this scaler has been fit to.java.lang.StringgetPrettySTDString()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()voidtransform(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.voidtransformAlternatives(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.voidtransformAlternatives(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 aDyadRankingDatasetaccording to the mean and standard deviation of the data the scaler has been fit to.voidtransformAlternatives(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 anIDyadRankingInstanceaccording to the mean and standard deviation of the data the scaler has been fit to.abstract voidtransformAlternatives(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 voidtransformInstaceVector(org.api4.java.common.math.IVector vector, java.util.List<java.lang.Integer> ignoredIndices)Transforms an instance feature vector.voidtransformInstances(SparseDyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)Transforms only the instances of each dyad in aSparseDyadRankingInstanceaccording to the mean and standard deviation of the data the scaler has been fit to.voidtransformInstances(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.voidtransformInstances(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 aDyadRankingDatasetaccording to the mean and standard deviation of the data the scaler has been fit to.voidtransformInstances(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 aDenseDyadRankingInstanceaccording to the mean and standard deviation of the data the scaler has been fit to.abstract voidtransformInstances(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.
-
-
-
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- TheListof 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- TheListof 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 transformedignoredIndices-
-
transformInstances
public void transformInstances(SparseDyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)
Transforms only the instances of each dyad in aSparseDyadRankingInstanceaccording 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- TheListof 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 aDenseDyadRankingInstanceaccording 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- TheListof 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 anIDyadRankingInstanceaccording 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- TheListof 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 aDyadRankingDatasetaccording 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- TheListof 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 aDyadRankingDatasetaccording 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- TheListof 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.
-
-