Class TrainingParameters
public class TrainingParameters
- Inheritance
-
TrainingParameters
- Inherited Members
Constructors
TrainingParameters()
public TrainingParameters()
TrainingParameters(TrainingParameters)
public TrainingParameters(TrainingParameters trainingParameters)
Parameters
trainingParametersTrainingParameters
TrainingParameters(IDictionary<string, string>)
Initializes the parameters from a string map, inferring each value's type.
[Obsolete("Use one of the other constructors instead.")]
public TrainingParameters(IDictionary<string, string> map)
Parameters
mapIDictionary<string, string>
TrainingParameters(Stream)
public TrainingParameters(Stream @in)
Parameters
inStream
Exceptions
- IOException
if the parameters cannot be read
Fields
ALGORITHM_PARAM
public const string ALGORITHM_PARAM = "Algorithm"
Field Value
CUTOFF_PARAM
public const string CUTOFF_PARAM = "Cutoff"
Field Value
ITERATIONS_PARAM
public const string ITERATIONS_PARAM = "Iterations"
Field Value
THREADS_PARAM
public const string THREADS_PARAM = "Threads"
Field Value
TRAINER_TYPE_PARAM
public const string TRAINER_TYPE_PARAM = "TrainerType"
Field Value
Methods
Algorithm()
Retrieves the training algorithm name.
public string? Algorithm()
Returns
- string
the name or
nullif not set.
Algorithm(string?)
Retrieves the training algorithm name for a given name space.
public string? Algorithm(string? namespace_)
Parameters
namespace_string
Returns
- string
the name or
nullif not set.
DefaultParams()
public static TrainingParameters DefaultParams()
Returns
GetBooleanParameter(string, bool)
Gets a boolean parameter.
public bool GetBooleanParameter(string key, bool defaultValue)
Parameters
Returns
GetBooleanParameter(string?, string, bool)
Gets a boolean parameter in the specified namespace.
public bool GetBooleanParameter(string? namespace_, string key, bool defaultValue)
Parameters
Returns
GetDoubleParameter(string, double)
Gets a double parameter.
public double GetDoubleParameter(string key, double defaultValue)
Parameters
Returns
GetDoubleParameter(string?, string, double)
Gets a double parameter in the specified namespace.
public double GetDoubleParameter(string? namespace_, string key, double defaultValue)
Parameters
Returns
GetIntParameter(string, int)
Gets an integer parameter.
public int GetIntParameter(string key, int defaultValue)
Parameters
Returns
GetIntParameter(string?, string, int)
Gets an integer parameter in the specified namespace.
public int GetIntParameter(string? namespace_, string key, int defaultValue)
Parameters
Returns
GetObjectSettings()
Retrieves all parameters without a name space.
public IDictionary<string, object> GetObjectSettings()
Returns
- IDictionary<string, object>
the settings map
GetObjectSettings(string?)
Retrieves a map with the training parameters which have the passed name space.
public IDictionary<string, object> GetObjectSettings(string? namespace_)
Parameters
namespace_stringthe name space, or
nullfor the parameters without one
Returns
- IDictionary<string, object>
a parameter map which can be passed to the train and validate methods.
GetParameters(string?)
public TrainingParameters GetParameters(string? namespace_)
Parameters
namespace_string
Returns
GetSettings()
Retrieves all parameters without a name space.
[Obsolete("Use GetObjectSettings() instead.")]
public IDictionary<string, string> GetSettings()
Returns
- IDictionary<string, string>
the settings map
GetSettings(string?)
Retrieves a map with the training parameters which have the passed name space.
[Obsolete("Use GetObjectSettings(string) instead.")]
public IDictionary<string, string> GetSettings(string? namespace_)
Parameters
namespace_stringthe name space, or
nullfor the parameters without one
Returns
- IDictionary<string, string>
a parameter map which can be passed to the train and validate methods.
GetStringParameter(string, string?)
Gets a string parameter.
An InvalidCastException can be thrown if the value is not a string.
public string? GetStringParameter(string key, string? defaultValue)
Parameters
Returns
GetStringParameter(string?, string, string?)
Gets a string parameter in the specified namespace.
An InvalidCastException can be thrown if the value is not a string.
public string? GetStringParameter(string? namespace_, string key, string? defaultValue)
Parameters
Returns
Put(string, bool)
public void Put(string key, bool value)
Parameters
Put(string, double)
public void Put(string key, double value)
Parameters
Put(string, int)
public void Put(string key, int value)
Parameters
Put(string, string)
public void Put(string key, string value)
Parameters
Put(string?, string, bool)
public void Put(string? namespace_, string key, bool value)
Parameters
Put(string?, string, double)
public void Put(string? namespace_, string key, double value)
Parameters
Put(string?, string, int)
public void Put(string? namespace_, string key, int value)
Parameters
Put(string?, string, string)
public void Put(string? namespace_, string key, string value)
Parameters
PutIfAbsent(string, bool)
public void PutIfAbsent(string key, bool value)
Parameters
PutIfAbsent(string, double)
public void PutIfAbsent(string key, double value)
Parameters
PutIfAbsent(string, int)
public void PutIfAbsent(string key, int value)
Parameters
PutIfAbsent(string, string)
public void PutIfAbsent(string key, string value)
Parameters
PutIfAbsent(string?, string, bool)
public void PutIfAbsent(string? namespace_, string key, bool value)
Parameters
PutIfAbsent(string?, string, double)
public void PutIfAbsent(string? namespace_, string key, double value)
Parameters
PutIfAbsent(string?, string, int)
public void PutIfAbsent(string? namespace_, string key, int value)
Parameters
PutIfAbsent(string?, string, string)
public void PutIfAbsent(string? namespace_, string key, string value)
Parameters
Serialize(Stream)
public void Serialize(Stream @out)
Parameters
outStream
Exceptions
- IOException
if the parameters cannot be written