public class TrainingInfo
extends java.lang.Object
Constructor and Description |
---|
TrainingInfo()
Creates new TrainingInfo.
|
Modifier and Type | Method and Description |
---|---|
Classifier |
createClassifier()
Creates a new Classifier if all the train information have been completed,
throws exception if not.
|
void |
createGenusWordProbList(java.io.Reader reader)
Reads in the index of the genus treenode and conditional probability that genus contains a word.
|
void |
createLogWordPriorArr(java.io.Reader reader)
Reads in the log value of the word prior probability and saves to an array LogWordPriorArr.
|
void |
createProbIndexArr(java.io.Reader reader)
Reads in start index of the conditional probability of each genus,
saves to an array wordConditionalProbIndexArr.
|
void |
createTree(java.io.Reader reader)
Reads in the tree information from a reader and create all the HierarchyTrees.
|
void |
generateWordPairDiffArr(int[] word,
int beginIndex)
For a given word w1 and the reverse complement word w2,
calculates the difference between the log word prior of w1 and w2 and saves to an array.
|
HierarchyTree |
getGenusNodebyIndex(int i)
Returns a genus node from the genusNodeList at the specified position.
|
int |
getGenusNodeListSize()
Returns the number of the genus nodes.
|
HierarchyVersion |
getHierarchyInfo()
Returns the info of the taxonomy hierarchy from of the training file.
|
java.lang.String |
getHierarchyVersion()
Returns the version of the taxonomical hierarchy.
|
float |
getLogLeaveCount(int i)
Returns the log value of (number of leaves + 1) of a genus
|
float |
getLogWordPrior(int wordIndex)
Returns the log value of the prior probability of a word.
|
HierarchyTree |
getRootTree()
Returns the root of the trees.
|
int |
getStartIndex(int wordIndex)
Returns the start index of GenusIndexWordConditionalProb in the array for the
specified wordIndex.
|
int |
getStopIndex(int wordIndex)
Returns the stop index of GenusIndexWordConditionalProb in the array for the
specified wordIndex.
|
java.lang.String |
getTrainRank() |
GenusWordConditionalProb |
getWordConditionalProbObject(int posIndex)
Returns a GenusIndexWordConditionalProb from the genusIndex_wordConditionalProbList
at the specified postion in the list.
|
float |
getWordPairPriorDiff(int wordIndex)
Returns the difference between given word and its reverse complement word.
|
boolean |
isSeqReversed(ClassifierSequence seq)
Returns true if the sequence is in reverse orientation.
|
boolean |
isSeqReversed(int[] wordIndexArr,
int wordCount) |
public void createTree(java.io.Reader reader) throws java.io.IOException, TrainingDataException
java.io.IOException
TrainingDataException
public void createLogWordPriorArr(java.io.Reader reader) throws java.io.IOException, TrainingDataException
java.io.IOException
TrainingDataException
public void generateWordPairDiffArr(int[] word, int beginIndex)
public void createGenusWordProbList(java.io.Reader reader) throws java.io.IOException, TrainingDataException
java.io.IOException
TrainingDataException
public void createProbIndexArr(java.io.Reader reader) throws java.io.IOException, TrainingDataException
java.io.IOException
TrainingDataException
public Classifier createClassifier()
public HierarchyTree getRootTree()
public java.lang.String getTrainRank()
public int getGenusNodeListSize()
public HierarchyTree getGenusNodebyIndex(int i)
public float getLogWordPrior(int wordIndex)
public float getWordPairPriorDiff(int wordIndex)
public float getLogLeaveCount(int i)
public int getStartIndex(int wordIndex)
public int getStopIndex(int wordIndex)
public GenusWordConditionalProb getWordConditionalProbObject(int posIndex)
public java.lang.String getHierarchyVersion()
public HierarchyVersion getHierarchyInfo()
public boolean isSeqReversed(ClassifierSequence seq) throws java.io.IOException
java.io.IOException
public boolean isSeqReversed(int[] wordIndexArr, int wordCount)