|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.bwaldvogel.liblinear.Model
public final class Model
Model stores the model obtained from the training procedure
use Linear.loadModel(File) and Linear.saveModel(File, Model) to load/save it
| Constructor Summary | |
|---|---|
Model()
|
|
| Method Summary | |
|---|---|
protected static boolean |
equals(double[] a,
double[] a2)
don't use Arrays.equals(double[], double[]) here, cause 0.0 and -0.0 should be handled the same |
boolean |
equals(Object obj)
|
double |
getBias()
|
double[] |
getFeatureWeights()
The nr_feature*nr_class array w gives feature weights. |
int[] |
getLabels()
|
int |
getNrClass()
|
int |
getNrFeature()
|
int |
hashCode()
|
boolean |
isProbabilityModel()
|
static Model |
load(File file)
see Linear.loadModel(File) |
static Model |
load(Reader inputReader)
see Linear.loadModel(Reader) |
void |
save(File file)
see Linear.saveModel(java.io.File, Model) |
void |
save(Writer writer)
see Linear.saveModel(Writer, Model) |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Model()
| Method Detail |
|---|
public int getNrClass()
public int getNrFeature()
public int[] getLabels()
public double[] getFeatureWeights()
+------------------+------------------+------------+ | nr_class weights | nr_class weights | ... | for 1st feature | for 2nd feature | +------------------+------------------+------------+If bias >= 0, x becomes [x; bias]. The number of features is increased by one, so w is a (nr_feature+1)*nr_class array. The value of bias is stored in the variable bias.
getBias()public boolean isProbabilityModel()
public double getBias()
getFeatureWeights()public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
protected static boolean equals(double[] a,
double[] a2)
Arrays.equals(double[], double[]) here, cause 0.0 and -0.0 should be handled the same
Linear.saveModel(java.io.Writer, Model)
public void save(File file)
throws IOException
Linear.saveModel(java.io.File, Model)
IOException
public void save(Writer writer)
throws IOException
Linear.saveModel(Writer, Model)
IOException
public static Model load(File file)
throws IOException
Linear.loadModel(File)
IOException
public static Model load(Reader inputReader)
throws IOException
Linear.loadModel(Reader)
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||