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.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
-
-
Constructor Summary
Constructors Constructor Description AbstractDyadScaler()
-
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 aDyadRankingDataset
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 anIDyadRankingInstance
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 aSparseDyadRankingInstance
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 aDyadRankingDataset
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 aDenseDyadRankingInstance
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.
-
-
-
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
- TheList
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
- TheList
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 transformedignoredIndices
-
-
transformInstances
public void transformInstances(SparseDyadRankingInstance drInstance, java.util.List<java.lang.Integer> ignoredIndices)
Transforms only the instances of each dyad in aSparseDyadRankingInstance
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
- TheList
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 aDenseDyadRankingInstance
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
- TheList
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 anIDyadRankingInstance
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
- TheList
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 aDyadRankingDataset
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
- TheList
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 aDyadRankingDataset
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
- TheList
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.
-
-