|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsg.edu.nus.comp.nlp.ims.io.CLibLinearLexeltWriter
public class CLibLinearLexeltWriter
convert instances in a lexelt to liblinear format
Field Summary | |
---|---|
protected double |
m_Bias
|
protected int |
m_MaxIndex
|
Constructor Summary | |
---|---|
CLibLinearLexeltWriter()
constructor |
|
CLibLinearLexeltWriter(double bias)
constructor |
Method Summary | |
---|---|
double |
getBias()
get bias |
java.lang.Object |
getInstances(ILexelt p_Lexelt)
extract instances from p_iLexelt |
protected liblinear.FeatureNode[] |
getVector(IInstance p_Instance,
IStatistic p_Stat,
int[][] p_Indice)
get the vector of one instance |
protected int[][] |
loadStatistic(ILexelt p_iLexelt)
load the statistic of p_iLexelt for each feature type in statistic if feature is binary keep it else if feature is list and the number of values is less than 2 one new feature else set each value as a new feature |
protected java.util.HashSet<java.lang.Integer> |
processTags(IStatistic p_Stat,
java.util.ArrayList<java.lang.String> p_Tags)
change tags to integer (start from 1) |
void |
setBias(double p_Bias)
set bias |
protected java.lang.String |
toString(IInstance p_Instance,
IStatistic p_Stat,
int[][] p_Indice)
generate feature vector for one instance |
java.lang.String |
toString(ILexelt p_Lexelt)
write lexelt to a string |
void |
write(java.lang.String p_Filename,
ILexelt p_Lexelt)
write information of p_iLexelt to p_FileName in some format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double m_Bias
protected int m_MaxIndex
Constructor Detail |
---|
public CLibLinearLexeltWriter()
public CLibLinearLexeltWriter(double bias)
bias
- biasMethod Detail |
---|
public void setBias(double p_Bias)
p_Bias
- biaspublic double getBias()
protected int[][] loadStatistic(ILexelt p_iLexelt) throws java.lang.ClassNotFoundException
p_iLexelt
- lexelt
java.lang.ClassNotFoundException
protected liblinear.FeatureNode[] getVector(IInstance p_Instance, IStatistic p_Stat, int[][] p_Indice)
p_Instance
- input instancep_Stat
- statistic
protected java.lang.String toString(IInstance p_Instance, IStatistic p_Stat, int[][] p_Indice)
p_Instance
- input instancep_Stat
- statisitc of training data setp_Indice
- feature indice
protected java.util.HashSet<java.lang.Integer> processTags(IStatistic p_Stat, java.util.ArrayList<java.lang.String> p_Tags)
p_Stat
- statisticp_Tags
- real tags
public java.lang.Object getInstances(ILexelt p_Lexelt) throws java.lang.ClassNotFoundException
ILexeltWriter
getInstances
in interface ILexeltWriter
p_Lexelt
- lexelt
java.lang.ClassNotFoundException
public java.lang.String toString(ILexelt p_Lexelt) throws java.lang.ClassNotFoundException
ILexeltWriter
toString
in interface ILexeltWriter
p_Lexelt
- lexelt
java.lang.ClassNotFoundException
public void write(java.lang.String p_Filename, ILexelt p_Lexelt) throws java.io.IOException, java.lang.ClassNotFoundException
ILexeltWriter
write
in interface ILexeltWriter
p_Filename
- file namep_Lexelt
- lexelt
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |