public class MaltLiblinearModel extends java.lang.Object implements java.io.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.
Constructor and Description |
---|
MaltLiblinearModel(java.io.File modelFile) |
MaltLiblinearModel(int[] labels,
int nr_class,
int nr_feature,
double[][] w,
de.bwaldvogel.liblinear.SolverType solverType) |
MaltLiblinearModel(java.io.Reader inputReader) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
double |
getBias() |
int[] |
getLabels() |
int |
getNrClass() |
int |
getNrFeature() |
int |
hashCode() |
boolean |
isProbabilityModel() |
int |
predict_one(MaltFeatureNode[] x) |
int[] |
predict(MaltFeatureNode[] x) |
java.lang.String |
toString() |
public MaltLiblinearModel(int[] labels, int nr_class, int nr_feature, double[][] w, de.bwaldvogel.liblinear.SolverType solverType)
public MaltLiblinearModel(java.io.Reader inputReader) throws java.io.IOException
java.io.IOException
public MaltLiblinearModel(java.io.File modelFile) throws java.io.IOException
java.io.IOException
public int getNrClass()
public int getNrFeature()
public int[] getLabels()
public boolean isProbabilityModel()
public double getBias()
public int[] predict(MaltFeatureNode[] x)
predict
in interface MaltLibModel
public int predict_one(MaltFeatureNode[] x)
predict_one
in interface MaltLibModel
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.