|
MaltParser 1.4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.maltparser.ml.liblinear.Liblinear
public class Liblinear
Nested Class Summary | |
---|---|
static class |
Liblinear.Verbostity
|
Field Summary | |
---|---|
protected boolean |
excludeNullValues
|
protected int |
learnerMode
|
static String |
LIBLINEAR_VERSION
|
protected String |
name
|
protected int |
numberOfInstances
|
protected InstanceModel |
owner
|
protected String |
pathExternalLiblinearTrain
|
protected boolean |
saveInstanceFiles
|
Fields inherited from interface org.maltparser.ml.LearningMethod |
---|
BATCH, CLASSIFY |
Constructor Summary | |
---|---|
Liblinear(InstanceModel owner,
Integer learnerMode)
Constructs a Liblinear learner. |
Method Summary | |
---|---|
void |
addInstance(SingleDecision decision,
FeatureVector featureVector)
|
protected void |
closeInstanceWriter()
|
Map<Integer,Integer> |
createFeatureIdToCountMap(ArrayList<Integer> divideFeatureIndexVector)
|
double |
crossValidate(FeatureVector featureVector,
int nrOfSplits)
This method does a cross validation of the training instances added and return the average score over the nrOfSplit divisions. |
void |
decreaseNumberOfInstances()
|
void |
divideByFeatureSet(Set<Integer> featureIdsToCreateSeparateBranchesForSet,
ArrayList<Integer> divideFeatureIndexVector,
String otherId)
|
protected void |
finalize()
|
void |
finalizeSentence(DependencyStructure dependencyGraph)
|
double |
getBias()
|
protected JarEntry |
getConfigFileEntry(String suffix)
|
DependencyParserConfig |
getConfiguration()
Returns the current configuration |
protected File |
getFile(String suffix)
|
protected InputStreamReader |
getInstanceInputStreamReader(String suffix)
|
protected InputStreamReader |
getInstanceInputStreamReaderFromConfigFile(String suffix)
|
protected OutputStreamWriter |
getInstanceOutputStreamWriter(String suffix)
|
BufferedWriter |
getInstanceWriter()
|
int |
getLearnerMode()
|
String |
getLearningMethodName()
|
String |
getLibLinearOptions()
|
liblinear.Parameter |
getLiblinearParameters()
|
String[] |
getLibLinearParamStringArray()
|
int |
getNumberOfInstances()
|
InstanceModel |
getOwner()
|
String |
getParamString()
Returns the parameter string for used for configure Liblinear |
void |
increaseNumberOfInstances()
|
void |
initLiblinearOptions()
|
protected void |
initSpecialParameters()
|
void |
liblinear_predict_with_kbestlist(liblinear.Model model,
liblinear.FeatureNode[] x,
KBestList kBestList)
|
static void |
maltSVMFormat2OriginalSVMFormat(InputStreamReader isr,
OutputStreamWriter osw,
int[] cardinalities)
Converts the instance file (Malt's own SVM format) into the Liblinear (SVMLight) format. |
void |
moveAllInstances(LearningMethod method,
FeatureFunction divideFeature,
ArrayList<Integer> divideFeatureIndexVector)
|
void |
noMoreInstances()
|
void |
parseParameters(String paramstring)
|
boolean |
predict(FeatureVector featureVector,
SingleDecision decision)
|
liblinear.Problem |
readLibLinearProblem(InputStreamReader isr,
int[] cardinalities)
Reads an instance file into a svm_problem object according to the Malt-SVM format, which is column fixed format (tab-separated). |
void |
setLearnerMode(int learnerMode)
|
protected void |
setLearningMethodName(String name)
|
protected void |
setNumberOfInstances(int numberOfInstances)
|
protected void |
setOwner(InstanceModel owner)
|
void |
terminate()
|
String |
toString()
|
void |
train(FeatureVector featureVector)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String LIBLINEAR_VERSION
protected InstanceModel owner
protected int learnerMode
protected String name
protected int numberOfInstances
protected boolean saveInstanceFiles
protected boolean excludeNullValues
protected String pathExternalLiblinearTrain
Constructor Detail |
---|
public Liblinear(InstanceModel owner, Integer learnerMode) throws MaltChainedException
owner
- the guide model ownerlearnerMode
- the mode of the learner TRAIN or CLASSIFY
MaltChainedException
Method Detail |
---|
public void addInstance(SingleDecision decision, FeatureVector featureVector) throws MaltChainedException
addInstance
in interface LearningMethod
MaltChainedException
public void finalizeSentence(DependencyStructure dependencyGraph) throws MaltChainedException
finalizeSentence
in interface LearningMethod
MaltChainedException
public void noMoreInstances() throws MaltChainedException
noMoreInstances
in interface LearningMethod
MaltChainedException
public void train(FeatureVector featureVector) throws MaltChainedException
train
in interface LearningMethod
MaltChainedException
public double crossValidate(FeatureVector featureVector, int nrOfSplits) throws MaltChainedException
LearningMethod
crossValidate
in interface LearningMethod
MaltChainedException
public void moveAllInstances(LearningMethod method, FeatureFunction divideFeature, ArrayList<Integer> divideFeatureIndexVector) throws MaltChainedException
moveAllInstances
in interface LearningMethod
MaltChainedException
public boolean predict(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
predict
in interface LearningMethod
MaltChainedException
public void terminate() throws MaltChainedException
terminate
in interface LearningMethod
MaltChainedException
public BufferedWriter getInstanceWriter()
getInstanceWriter
in interface LearningMethod
protected void closeInstanceWriter() throws MaltChainedException
MaltChainedException
public String getParamString()
public InstanceModel getOwner()
protected void setOwner(InstanceModel owner)
public int getLearnerMode()
public void setLearnerMode(int learnerMode) throws MaltChainedException
MaltChainedException
public String getLearningMethodName()
public DependencyParserConfig getConfiguration() throws MaltChainedException
MaltChainedException
public int getNumberOfInstances() throws MaltChainedException
MaltChainedException
public void increaseNumberOfInstances()
increaseNumberOfInstances
in interface LearningMethod
public void decreaseNumberOfInstances()
decreaseNumberOfInstances
in interface LearningMethod
protected void setNumberOfInstances(int numberOfInstances)
protected void setLearningMethodName(String name)
protected OutputStreamWriter getInstanceOutputStreamWriter(String suffix) throws MaltChainedException
MaltChainedException
protected InputStreamReader getInstanceInputStreamReader(String suffix) throws MaltChainedException
MaltChainedException
protected InputStreamReader getInstanceInputStreamReaderFromConfigFile(String suffix) throws MaltChainedException
MaltChainedException
protected File getFile(String suffix) throws MaltChainedException
MaltChainedException
protected JarEntry getConfigFileEntry(String suffix) throws MaltChainedException
MaltChainedException
public liblinear.Problem readLibLinearProblem(InputStreamReader isr, int[] cardinalities) throws MaltChainedException
isr
- the instance stream reader for the instance filecardinalities
- a array containing the number of distinct values for a particular column.
LiblinearException
MaltChainedException
protected void initSpecialParameters() throws MaltChainedException
MaltChainedException
public String getLibLinearOptions()
public void parseParameters(String paramstring) throws MaltChainedException
MaltChainedException
public double getBias() throws MaltChainedException
MaltChainedException
public liblinear.Parameter getLiblinearParameters() throws MaltChainedException
MaltChainedException
public void initLiblinearOptions()
public String[] getLibLinearParamStringArray()
public void liblinear_predict_with_kbestlist(liblinear.Model model, liblinear.FeatureNode[] x, KBestList kBestList) throws MaltChainedException
MaltChainedException
public static void maltSVMFormat2OriginalSVMFormat(InputStreamReader isr, OutputStreamWriter osw, int[] cardinalities) throws MaltChainedException
isr
- the input stream reader for the source instance fileosw
- the output stream writer for the destination instance filecardinalities
- a vector containing the number of distinct values for a particular column
LiblinearException
MaltChainedException
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public String toString()
toString
in class Object
public void divideByFeatureSet(Set<Integer> featureIdsToCreateSeparateBranchesForSet, ArrayList<Integer> divideFeatureIndexVector, String otherId) throws MaltChainedException
divideByFeatureSet
in interface LearningMethod
MaltChainedException
public Map<Integer,Integer> createFeatureIdToCountMap(ArrayList<Integer> divideFeatureIndexVector) throws MaltChainedException
createFeatureIdToCountMap
in interface LearningMethod
MaltChainedException
|
MaltParser 1.4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |