Class AbstractDyadScaler
- java.lang.Object
-
- ai.libs.jaicore.ml.dyadranking.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(DyadRankingDataset dataset)Fits the standard scaler to the dataset.voidfitTransform(DyadRankingDataset 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(DyadRankingDataset dataset)Transforms the entire dataset according to the mean and standard deviation of the data the scaler has been fit to.voidtransformAlternatives(DyadRankingDataset 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(DyadRankingDataset 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(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(Dyad 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(ai.libs.jaicore.math.linearalgebra.Vector vector, java.util.List<java.lang.Integer> ignoredIndices)Transforms an instance feature vector.voidtransformInstances(DyadRankingDataset dataset)Transforms only the instances of each dyad according to the mean and standard of the data the scaler has been fit to.voidtransformInstances(DyadRankingDataset 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(DyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)Transforms only the instances of each dyad in aDyadRankingInstanceaccording to the mean and standard deviation of the data the scaler has been fit to.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.abstract voidtransformInstances(Dyad 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(DyadRankingDataset dataset)
Fits the standard scaler to the dataset.- Parameters:
dataset- The dataset the scaler should be fit to.
-
transform
public void transform(DyadRankingDataset 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(DyadRankingDataset 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(DyadRankingDataset 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(Dyad 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(Dyad 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(ai.libs.jaicore.math.linearalgebra.Vector 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(DyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)
Transforms only the instances of each dyad in aDyadRankingInstanceaccording 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(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(DyadRankingDataset 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(DyadRankingDataset 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(DyadRankingDataset 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.
-
-