Class ModelUtil
Utility class for handling of IMaxentModels.
public static class ModelUtil
- Inheritance
-
ModelUtil
- Inherited Members
Methods
AddCutoffAndIterations(Dictionary<string, string>, int, int)
public static void AddCutoffAndIterations(Dictionary<string, string> manifestInfoEntries, int cutoff, int iterations)
Parameters
manifestInfoEntriesDictionary<string, string>cutoffintiterationsint
CreateDefaultTrainingParameters()
Creates the default training parameters in case they are not provided.
Note: Do not use this method, internal use only!
public static TrainingParameters CreateDefaultTrainingParameters()
Returns
- TrainingParameters
training parameters instance
Read(Stream)
Writes the provided Stream into a byte array which is returned
public static byte[] Read(Stream @in)
Parameters
inStreamstream to read data for the byte array from
Returns
- byte[]
byte array with the contents of the stream
Exceptions
- IOException
if an exception is thrown while reading from the provided Stream
ValidateOutcomes(IMaxentModel, params string[])
Checks if the expected outcomes are all contained as outcomes in the given model.
public static bool ValidateOutcomes(IMaxentModel model, params string[] expectedOutcomes)
Parameters
modelIMaxentModelexpectedOutcomesstring[]
Returns
- bool
true if all expected outcomes are the only outcomes of the model.
WriteModel(IMaxentModel, Stream)
Writes the given model to the given Stream.
This methods does not closes the provided stream.
public static void WriteModel(IMaxentModel model, Stream @out)
Parameters
modelIMaxentModelthe model to be written
outStreamthe stream the model should be written to
Exceptions
- IOException
- ArgumentNullException
in case one of the parameters is null