Class AbstractTrainer
Base class for trainers, holding the training parameters and the report map.
public abstract class AbstractTrainer
- Inheritance
-
AbstractTrainer
- Derived
- Inherited Members
Constructors
AbstractTrainer()
protected AbstractTrainer()
AbstractTrainer(TrainingParameters)
protected AbstractTrainer(TrainingParameters parameters)
Parameters
parametersTrainingParameters
Fields
ALGORITHM_PARAM
public const string ALGORITHM_PARAM = "Algorithm"
Field Value
CUTOFF_DEFAULT
public const int CUTOFF_DEFAULT = 5
Field Value
CUTOFF_PARAM
public const string CUTOFF_PARAM = "Cutoff"
Field Value
ITERATIONS_DEFAULT
public const int ITERATIONS_DEFAULT = 100
Field Value
ITERATIONS_PARAM
public const string ITERATIONS_PARAM = "Iterations"
Field Value
TRAINER_TYPE_PARAM
public const string TRAINER_TYPE_PARAM = "TrainerType"
Field Value
VERBOSE_DEFAULT
public const bool VERBOSE_DEFAULT = true
Field Value
VERBOSE_PARAM
public const string VERBOSE_PARAM = "PrintMessages"
Field Value
printMessages
protected bool printMessages
Field Value
reportMap
protected IDictionary<string, string> reportMap
Field Value
trainingParameters
protected TrainingParameters trainingParameters
Field Value
Properties
Algorithm
Gets the configured algorithm name, defaulting to maxent.
public virtual string Algorithm { get; }
Property Value
Cutoff
Gets the configured cutoff.
public virtual int Cutoff { get; }
Property Value
Iterations
Gets the configured number of iterations.
public virtual int Iterations { get; }
Property Value
Methods
AddToReport(string, string)
Adds the key/value pair to the report map.
protected virtual void AddToReport(string key, string value)
Parameters
Display(string)
protected virtual void Display(string s)
Parameters
sstring
Init(TrainingParameters, IDictionary<string, string>?)
Initializes this trainer with the given parameters and report map.
public virtual void Init(TrainingParameters trainingParameters, IDictionary<string, string>? reportMap)
Parameters
trainingParametersTrainingParametersreportMapIDictionary<string, string>
Validate()
Checks the parameters. If a subclass overrides this, it should call the base implementation.
public virtual void Validate()
Exceptions
- ArgumentException
Thrown if a parameter is not valid.