MaltParser 1.6.1

org.maltparser.ml.lib
Class MaltLiblinearModel

java.lang.Object
  extended by org.maltparser.ml.lib.MaltLiblinearModel
All Implemented Interfaces:
Serializable, MaltLibModel

public class MaltLiblinearModel
extends Object
implements Serializable, MaltLibModel

This class borrows code from liblinear.Model.java of the Java implementation of the liblinear package. MaltLiblinearModel stores the model obtained from the training procedure. In addition to the original code the model is more integrated to MaltParser. Instead of moving features from MaltParser's internal data structures to liblinear's data structure it uses MaltParser's data structure directly on the model.

Author:
Johan Hall
See Also:
Serialized Form

Constructor Summary
MaltLiblinearModel(File modelFile)
           
MaltLiblinearModel(int[] labels, int nr_class, int nr_feature, double[][] w, liblinear.SolverType solverType)
           
MaltLiblinearModel(Reader inputReader)
           
 
Method Summary
 boolean equals(Object obj)
           
 double getBias()
           
 int[] getLabels()
           
 int getNrClass()
           
 int getNrFeature()
           
 int hashCode()
           
 boolean isProbabilityModel()
           
 int[] predict(MaltFeatureNode[] x)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaltLiblinearModel

public MaltLiblinearModel(int[] labels,
                          int nr_class,
                          int nr_feature,
                          double[][] w,
                          liblinear.SolverType solverType)

MaltLiblinearModel

public MaltLiblinearModel(Reader inputReader)
                   throws IOException
Throws:
IOException

MaltLiblinearModel

public MaltLiblinearModel(File modelFile)
                   throws IOException
Throws:
IOException
Method Detail

getNrClass

public int getNrClass()
Returns:
number of classes

getNrFeature

public int getNrFeature()
Returns:
number of features

getLabels

public int[] getLabels()

isProbabilityModel

public boolean isProbabilityModel()
Returns:
true for logistic regression solvers

getBias

public double getBias()

predict

public int[] predict(MaltFeatureNode[] x)
Specified by:
predict in interface MaltLibModel

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

MaltParser 1.6.1

Copyright 2007-2011 Johan Hall, Jens Nilsson and Joakim Nivre.