public final class Model
extends java.lang.Object
implements java.io.Serializable
Model stores the model obtained from the training procedure
use Linear.loadModel(File) and Linear.saveModel(File, Model) to load/save it
| Constructor and Description | 
|---|
Model()  | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
equals(java.lang.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(java.io.File file)
 | 
static Model | 
load(java.io.Reader inputReader)
 | 
void | 
save(java.io.File file)
 | 
void | 
save(java.io.Writer writer)
 | 
java.lang.String | 
toString()  | 
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 java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void save(java.io.File file)
          throws java.io.IOException
java.io.IOExceptionpublic void save(java.io.Writer writer)
          throws java.io.IOException
java.io.IOExceptionpublic static Model load(java.io.File file) throws java.io.IOException
java.io.IOExceptionpublic static Model load(java.io.Reader inputReader) throws java.io.IOException
java.io.IOException