|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectliblinear.Model
public final class Model
Model stores the model obtained from the training procedure
use Linear#loadModel(String) and Linear#saveModel(String, 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(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()
|
static Model |
load(java.io.File file)
see Linear.loadModel(File) |
static Model |
load(java.io.Reader inputReader)
see Linear.loadModel(Reader) |
void |
save(java.io.File file)
see Linear.saveModel(java.io.File, Model) |
void |
save(java.io.Writer writer)
see Linear.saveModel(Writer, Model) |
java.lang.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 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.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(java.io.File file)
throws java.io.IOException
Linear.saveModel(java.io.File, Model)
java.io.IOException
public void save(java.io.Writer writer)
throws java.io.IOException
Linear.saveModel(Writer, Model)
java.io.IOException
public static Model load(java.io.File file)
throws java.io.IOException
Linear.loadModel(File)
java.io.IOException
public static Model load(java.io.Reader inputReader)
throws java.io.IOException
Linear.loadModel(Reader)
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||