Math Library
Library oml
include Input_interfaces.Data
type class_
type feature
include Oml_util.Optional_arg_intf
type opt
val default : opt
type t

The classifier.

val eval : t -> feature -> class_ Probabilities.t

eval classifier feature assign probabilities to the possible classes based upon feature.

type samples = (class_ * feature) list

Representing training data.

val estimate : ?opt:opt -> ?classes:class_ list -> samples -> t

estimate opt classes samples estimates a classifier based upon the training samples.

classes is an optional argument to specify ahead of time the possible classes to train on (defaults to the ones found in the training data). This is useful for models where we know the population domain but may not see an example of a training datum for rare cases.

opt are the optional classifier dependent estimation/evaluation arguments.

  • raises Invalid_argument

    if classes are specified and new ones are found in the training samples.

  • raises Invalid_argument

    if samples is empty.