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.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void save(java.io.File file) throws java.io.IOException
java.io.IOException
public void save(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public static Model load(java.io.File file) throws java.io.IOException
java.io.IOException
public static Model load(java.io.Reader inputReader) throws java.io.IOException
java.io.IOException