|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectliblinear.Linear
public class Linear
The usage should be pretty similar to the C version of liblinear.
Please consider reading the README file of liblinear.
The port was done by Benedikt Waldvogel (mail at bwaldvogel.de)
| Constructor Summary | |
|---|---|
Linear()
|
|
| Method Summary | |
|---|---|
static double[] |
copyOf(double[] original,
int newLength)
Java5 'backport' of Arrays.copyOf |
static int[] |
copyOf(int[] original,
int newLength)
Java5 'backport' of Arrays.copyOf |
static void |
crossValidation(Problem prob,
Parameter param,
int nr_fold,
int[] target)
|
static void |
disableDebugOutput()
|
static void |
enableDebugOutput()
|
static Model |
loadModel(java.io.File modelFile)
Loads the model from the file with ISO-8859-1 charset. |
static Model |
loadModel(java.io.Reader inputReader)
Loads the model from inputReader. |
static int |
predict(Model model,
FeatureNode[] x)
|
static int |
predictProbability(Model model,
FeatureNode[] x,
double[] prob_estimates)
|
static int |
predictValues(Model model,
FeatureNode[] x,
double[] dec_values)
|
static void |
resetRandom()
resets the PRNG this is i.a. needed for regression testing (eg. the Weka wrapper) |
static void |
saveModel(java.io.File modelFile,
Model model)
Writes the model to the file with ISO-8859-1 charset. |
static void |
saveModel(java.io.Writer modelOutput,
Model model)
Writes the model to the modelOutput. |
static void |
setDebugOutput(java.io.PrintStream debugOutput)
|
static Model |
train(Problem prob,
Parameter param)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Linear()
| Method Detail |
|---|
public static void crossValidation(Problem prob,
Parameter param,
int nr_fold,
int[] target)
target - predicted classes
public static double[] copyOf(double[] original,
int newLength)
public static int[] copyOf(int[] original,
int newLength)
public static Model loadModel(java.io.Reader inputReader)
throws java.io.IOException
Locale.ENGLISH for number formatting.
Note: The inputReader is closed after reading or in case of an exception.
java.io.IOException
public static Model loadModel(java.io.File modelFile)
throws java.io.IOException
Locale.ENGLISH for number formatting.
java.io.IOException
public static int predict(Model model,
FeatureNode[] x)
public static int predictProbability(Model model,
FeatureNode[] x,
double[] prob_estimates)
public static int predictValues(Model model,
FeatureNode[] x,
double[] dec_values)
public static void saveModel(java.io.Writer modelOutput,
Model model)
throws java.io.IOException
Locale.ENGLISH for number formatting.
Note: The modelOutput is closed after reading or in case of an exception.
java.io.IOException
public static void saveModel(java.io.File modelFile,
Model model)
throws java.io.IOException
Locale.ENGLISH for number formatting.
java.io.IOException
public static Model train(Problem prob,
Parameter param)
java.lang.IllegalArgumentException - if the feature nodes of prob are not sorted in ascending orderpublic static void disableDebugOutput()
public static void enableDebugOutput()
public static void setDebugOutput(java.io.PrintStream debugOutput)
public static void resetRandom()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||