Class Linear
java.lang.Object
de.bwaldvogel.liblinear.Linear
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcrossValidation(Problem prob, Parameter param, int nr_fold, double[] target) static voidstatic voidstatic ParameterCSearchResultfind_parameter_C(Problem prob, Parameter param_tmp, double start_C, double max_C, int[] fold_start, int[] perm, Problem[] subprob, int nr_fold) static ParameterSearchResultfindParameters(Problem prob, Parameter param, int nr_fold, double start_C, double start_p) static intstatic ModelDeprecated.static ModelLoads the model from inputReader.static ModelLoads the model from the file with ISO-8859-1 charset.static doublestatic doublepredictProbability(Model model, Feature[] x, double[] prob_estimates) static doublepredictValues(Model model, Feature[] x, double[] dec_values) static voidDeprecated.UseParameter.setRandom(Random)insteadstatic voidDeprecated.usesaveModel(Path, Model)insteadstatic voidWrites the model to the modelOutput.static voidWrites the model to the file with ISO-8859-1 charset.static voidsetDebugOutput(PrintStream debugOutput) static Model
-
Constructor Details
-
Linear
public Linear()
-
-
Method Details
-
crossValidation
-
findParameters
public static ParameterSearchResult findParameters(Problem prob, Parameter param, int nr_fold, double start_C, double start_p) -
loadModel
Loads the model from inputReader. It usesLocale.ENGLISHfor number formatting.Note: The inputReader is NOT closed after reading or in case of an exception.
- Throws:
IOException
-
loadModel
Deprecated.useloadModel(Path)insteadLoads the model from the file with ISO-8859-1 charset. It usesLocale.ENGLISHfor number formatting.- Throws:
IOException
-
loadModel
Loads the model from the file with ISO-8859-1 charset. It usesLocale.ENGLISHfor number formatting.- Throws:
IOException
-
predict
-
predictProbability
public static double predictProbability(Model model, Feature[] x, double[] prob_estimates) throws IllegalArgumentException - Throws:
IllegalArgumentException- if model is not probabilistic (seeModel.isProbabilityModel())
-
predictValues
-
saveModel
Writes the model to the modelOutput. It usesLocale.ENGLISHfor number formatting.Note: The modelOutput is closed after reading or in case of an exception.
- Throws:
IOException
-
saveModel
Deprecated.usesaveModel(Path, Model)insteadWrites the model to the file with ISO-8859-1 charset. It usesLocale.ENGLISHfor number formatting.- Throws:
IOException
-
saveModel
Writes the model to the file with ISO-8859-1 charset. It usesLocale.ENGLISHfor number formatting.- Throws:
IOException
-
train
- Throws:
IllegalArgumentException- if the feature nodes of prob are not sorted in ascending order
-
find_parameter_C
public static ParameterCSearchResult find_parameter_C(Problem prob, Parameter param_tmp, double start_C, double max_C, int[] fold_start, int[] perm, Problem[] subprob, int nr_fold) -
disableDebugOutput
public static void disableDebugOutput() -
enableDebugOutput
public static void enableDebugOutput() -
setDebugOutput
-
getVersion
public static int getVersion() -
resetRandom
public static void resetRandom()Deprecated.UseParameter.setRandom(Random)insteadresets the PRNG
-
loadModel(Path)instead