|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulb.mlg.utils.DefaultRenormalizer
be.ac.ulb.mlg.utils.TaxonRenormalizer
public class TaxonRenormalizer
This class represents a normalization with taxa.
Each main taxon must be defined by calling addTaxa() method in order to normalize them and assemble them to their own root.
Thus, if it exists a main root, you need to pre-remove it before to add taxons otherwise all data will be reduced to one row containing only an array of 1.0.
For each row of the next input matrix, the lowest taxa level must be specified with the setTaxa() method after the definition of taxons.
To design this class, some hypothesis are assumed:
- Taxon are fully specified
- Taxon doesn't contain overlaps (can be represented with a Tree: parents to children) => For each taxa, only one highest level
All taxa/taxon is not case sensitive (according to the String
case specification).
Field Summary | |
---|---|
static String |
DEFAULT_SEPARATOR
Default Taxa separator |
Fields inherited from class be.ac.ulb.mlg.utils.DefaultRenormalizer |
---|
SUM_NORMILIZER |
Constructor Summary | |
---|---|
TaxonRenormalizer()
Construct a new TaxonRenormalizer without predefined values Default applied renormalization is the default renormalization of the DefaultRenormalizer |
Method Summary | |
---|---|
void |
addTaxa(String taxa)
Add a taxa defintion of the main taxon according to the string format with the DEFAULT_SEPARATOR |
void |
addTaxa(String lineage,
String separator)
Add a taxa defintion of the main taxon according to the string format |
int[] |
getGroupResult()
Get the mapping from (index) to (groups index identifier) for the new input matrix |
int |
getTaxaIdentifier(String taxa)
|
boolean |
hasNativeImplementation()
Know if the current renormalizer owns a native implementation |
boolean |
isHighestLevel(int taxa)
|
boolean |
isHighestLevel(String taxa)
|
boolean |
isHighLevel(int taxa)
|
boolean |
isHighLevel(String taxa)
|
boolean |
isLowLevel(int taxa)
|
boolean |
isLowLevel(String taxa)
|
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 |
reset()
Reset only (no call to inherited reset methods) all data relative to taxa/taxon and mappings of last results |
void |
setTaxa(String[] taxas)
Set the taxa for all row (null or out of taxon results in considering the row as a feature) |
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 |
Methods inherited from class be.ac.ulb.mlg.utils.DefaultRenormalizer |
---|
addFeature, countFeatures, countGroups, groupOf, isUsingCustomNormalizer, isUsingFeatures, isUsingGroups, noFeatures, noGroups, resetNormalizer, setGroup, setGroup, setGroups, setGroupsNames, setNormalizer, setNormalizer, setNormalizer, shufflePair, simulateRenormalization, usePairShuffle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_SEPARATOR
Constructor Detail |
---|
public TaxonRenormalizer()
DefaultRenormalizer
Method Detail |
---|
public void reset()
public int getTaxaIdentifier(String taxa)
taxa
- The name of a defined taxa level
public boolean isLowLevel(String taxa)
taxa
- The name of a defined taxa level
public boolean isHighLevel(String taxa)
taxa
- The name of a defined taxa level
public boolean isHighestLevel(String taxa)
taxa
- The index (according to the ordre of definition, see getTaxaIdentifier() method) of a definedtaxa level
public boolean isLowLevel(int taxa)
taxa
- The index (according to the ordre of definition, see getTaxaIdentifier() method) of a defined taxa level
public boolean isHighLevel(int taxa)
taxa
- The index (according to the ordre of definition, see getTaxaIdentifier() method) of a defined taxa level
public boolean isHighestLevel(int taxa)
taxa
- The name of a defined taxa level
public void setTaxa(String[] taxas)
taxas
- Taxa names of all row, one lowest level mapping for each row of the next input matrixpublic void addTaxa(String taxa)
taxa
- The taxa definition from the highest level to the lowest levelpublic void addTaxa(String lineage, String separator)
lineage
- The taxa definition from the highest level to the lowest level (cannot contains spaces see \s in RegularExpression)separator
- Specify the used separator (literal string)public double[][] normalizeInput(double[][] input)
Renormalizer
normalizeInput
in interface Renormalizer
normalizeInput
in class DefaultRenormalizer
input
- The given vector of data vectors
public void updateRenormalization(double[] vect, int row, boolean ignore)
Renormalizer
updateRenormalization
in interface Renormalizer
updateRenormalization
in class DefaultRenormalizer
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 int[] getGroupResult()
public double[][] normalizeOutput(double[][] input, double[][] output, Measure measure)
Renormalizer
normalizeOutput
in interface Renormalizer
normalizeOutput
in class DefaultRenormalizer
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
hasNativeImplementation
in class DefaultRenormalizer
public boolean processInput()
Renormalizer
processInput
in interface Renormalizer
processInput
in class DefaultRenormalizer
public boolean processOutput()
Renormalizer
processOutput
in interface Renormalizer
processOutput
in class DefaultRenormalizer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |