using System; using System.Collections.Generic; namespace BotSharp.Algorithm.Bayesian { /// /// Interface IClassifier /// public interface IClassifier { /// /// Additive smoothing parameter. If set to zero, no Laplace smoothing will be applied. /// /// Laplace smoothing is required in the context or rare (i.e. untrained) tokens or tokens /// that do not appear in some classes. With smoothing disabled, these tokens result /// in a zero probability for the whole class. To counter that, a positive ("alpha") /// value for smoothing can be set. /// /// double SmoothingAlpha { get; set; } /// /// Calculates the probability of having the /// given the occurrence of the . /// /// The class under test. /// The token. /// Additive smoothing parameter. If set to zero, no Laplace smoothing will be applied, setting to defaults to the values set in . /// System.Double. double CalculateProbability(IClass classUnderTest, IToken token, double? alpha = null); /// /// Calculates the probability of having the /// /// given the occurrence of the /// . /// /// The token. /// Additive smoothing parameter. If set to zero, no Laplace smoothing will be applied, setting to defaults to the values set in . /// System.Double. IEnumerable CalculateProbabilities(IToken token, double? alpha = null); /// /// Calculates the probability of having the /// /// given the occurrence of the /// . /// /// The tokens. /// Additive smoothing parameter. If set to zero, no Laplace smoothing will be applied, setting to defaults to the values set in . /// System.Double. IEnumerable CalculateProbabilities(ICollection tokens, double? alpha = null); } }