|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulb.mlg.utils.DefaultRenormalizer
public class DefaultRenormalizer
DefaultRenormalizer supports custom or columns summing renormalization with features (row to be ignorated) and can handle non-overlapping groups (division of input vectors into subsets where elements of each subset are normalized only with others from the same group)
Field Summary | |
---|---|
static double |
SUM_NORMILIZER
Sentinel value meaning that the renormalizer use the sum function on columns |
Constructor Summary | |
---|---|
DefaultRenormalizer()
Construct a new DefaultRenormalizer without groups, without features and with sum normalization shuffles are disable |
Method Summary | |
---|---|
void |
addFeature(int dataIndex)
|
int |
countFeatures()
Count the number of features |
int |
countGroups()
Count the number of groups |
int |
groupOf(int row)
Get the group of a row |
boolean |
hasNativeImplementation()
Know if the current renormalizer owns a native implementation |
boolean |
isUsingCustomNormalizer()
Know if the configuration of the DefaultRenormalizer uses custom renormalization values |
boolean |
isUsingFeatures()
Know if the configuration of the DefaultRenormalizer use the feature renormalization |
boolean |
isUsingGroups()
Know if the configuration of the DefaultRenormalizer use the group renormalization |
void |
noFeatures()
Specifies to no longer use the features renormalization |
void |
noGroups()
Specifies to no longer use the group renormalization but preserve renormalization values by group to rester them, use resetNormalizer() |
double[][] |
normalizeInput(double[][] input)
Apply the normalization process on the given vector of data vectors |
double[][] |
normalizeOutput(double[][] input,
double[][] output,
Measure measure)
Apply the normalization process on the given vector of data vectors and result measures |
boolean |
processInput()
Know if the renormalizer can handle input (call normalizeInput has effect) |
boolean |
processOutput()
Know if the renormalizer can handle output (call normalizeOutput has effect) |
void |
resetNormalizer()
Reset the custom renormalizer to use the default method (sum by columns) |
void |
setGroup(int row,
int group)
Define the group for one input data vector |
void |
setGroup(int row,
String groupName)
Define the group for one input data vector |
void |
setGroups(int[] groups,
int groupCount)
Define the group of all input data vectors by their indexes |
void |
setGroupsNames(int rows,
String[] names)
Define groups and associate them a label. |
void |
setNormalizer(int column,
double divider)
Define a specific value to use instead of the sum by column |
void |
setNormalizer(int group,
int column,
double divider)
Define a specific value to use instead of the sum by column for groups |
void |
setNormalizer(String groupName,
int column,
double divider)
Define a specific value to use instead of the sum by column for groups |
boolean |
shufflePair()
Know if the measurer use pre-shuffle |
void |
simulateRenormalization(double[] shuffledFirst,
double[] shuffledSecond,
int first,
int second)
Method called when pairwise renormalization is used in order to obtain a normalized version of the shuffled vector as if it was in the original input matrix |
void |
updateRenormalization(double[] vect,
int row,
boolean ignore)
Method called when pairwise renormalization is used in order to ignore or not a row from the original input matrix |
void |
usePairShuffle(boolean shuffle)
Enable or disable pairwise shuffle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double SUM_NORMILIZER
Constructor Detail |
---|
public DefaultRenormalizer()
Method Detail |
---|
public void addFeature(int dataIndex)
public boolean isUsingGroups()
public void noGroups()
public void resetNormalizer()
public boolean isUsingFeatures()
public boolean isUsingCustomNormalizer()
public void noFeatures()
public void setGroup(int row, String groupName)
row
- The index of the input data vector (used with Measurer
)groupName
- The name of the group of the input data vectorpublic void setGroup(int row, int group)
row
- The index of the input data vector (used with Measurer
)group
- The index of the group of the input data vectorpublic void setGroupsNames(int rows, String[] names)
rows
- The number of input data vectors to be processednames
- The name of all existing groupspublic void setGroups(int[] groups, int groupCount)
groups
- The array mapping each for index i, the input data vector i to the group groups[i]groupCount
- The number of groupspublic void setNormalizer(String groupName, int column, double divider)
groupName
- The name of the groupcolumn
- The column index (for an input data vector v, it's i of v[i])divider
- The specific value to use as normalizerpublic void setNormalizer(int group, int column, double divider)
group
- The index of the groupcolumn
- The column index (for an input data vector v, it's i of v[i])divider
- The specific value to use as normalizerpublic void setNormalizer(int column, double divider)
column
- The column index (for an input data vector v, it's i of v[i])divider
- The specific value to use as normalizerpublic int countFeatures()
public int countGroups()
public int groupOf(int row)
row
- The row index
public double[][] normalizeInput(double[][] input)
Renormalizer
normalizeInput
in interface Renormalizer
input
- The given vector of data vectors
public void updateRenormalization(double[] vect, int row, boolean ignore)
Renormalizer
updateRenormalization
in interface Renormalizer
vect
- A vector which is considerate as a row from the original input matrix corresponding to the row at the given indexrow
- The index of the vector to map it into the original matrix at this indexignore
- A boolean to tell if the values of the vector must be ignored (typically remove these values from the normalization process as if it was the row "index" from the original input matrix) with the true value (typically false to add it into renormalization)public void simulateRenormalization(double[] shuffledFirst, double[] shuffledSecond, int first, int second)
Renormalizer
simulateRenormalization
in interface Renormalizer
shuffledFirst
- The first vector of the pairwise comparison (shuffled version)shuffledSecond
- The second vector of the pairwise comparison (shuffled version)first
- The index of the first vector from the original input matrixsecond
- The index of the second vector from the original input matrixpublic double[][] normalizeOutput(double[][] input, double[][] output, Measure measure)
Renormalizer
normalizeOutput
in interface Renormalizer
input
- The given vector of data vectorsoutput
- The result vector (measures of data vectors)measure
- The corresponding measure
public boolean hasNativeImplementation()
Renormalizer
hasNativeImplementation
in interface Renormalizer
public boolean processInput()
Renormalizer
processInput
in interface Renormalizer
public boolean processOutput()
Renormalizer
processOutput
in interface Renormalizer
public void usePairShuffle(boolean shuffle)
shuffle
- true to enable, false to disablepublic boolean shufflePair()
Renormalizer
shufflePair
in interface Renormalizer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |