public final class ModelUtil extends Object
MaxentModel
s.Modifier and Type | Method and Description |
---|---|
static void |
addCutoffAndIterations(Map<String,String> manifestInfoEntries,
int cutoff,
int iterations) |
static TrainingParameters |
createDefaultTrainingParameters()
Creates the default training parameters in case they are not provided.
|
static byte[] |
read(InputStream in)
Writes the provided
InputStream into a byte array
which is returned |
static boolean |
validateOutcomes(MaxentModel model,
String... expectedOutcomes)
Checks if the expected outcomes are all contained as outcomes in the given model.
|
static void |
writeModel(MaxentModel model,
OutputStream out)
Writes the given model to the given
OutputStream . |
public static void writeModel(MaxentModel model, OutputStream out) throws IOException, IllegalArgumentException
OutputStream
.
This methods does not closes the provided stream.model
- the model to be writtenout
- the stream the model should be written toIOException
IllegalArgumentException
- in case one of the parameters is nullpublic static boolean validateOutcomes(MaxentModel model, String... expectedOutcomes)
model
- expectedOutcomes
- public static byte[] read(InputStream in) throws IOException
InputStream
into a byte array
which is returnedin
- stream to read data for the byte array fromIOException
- if an exception is thrown while reading
from the provided InputStream
public static void addCutoffAndIterations(Map<String,String> manifestInfoEntries, int cutoff, int iterations)
public static TrainingParameters createDefaultTrainingParameters()
Copyright © 2020 The Apache Software Foundation. All rights reserved.