Handle order dependency in online learning
mainWhen using add_examples to perform true online learning (adding examples incrementally), the order of addition can affect predictions because the underlying neural network learns incrementally.
To achieve strict order independence, you can switch from the default hybrid approach to a Prototype-Only configuration. This makes predictions based solely on similarity to class prototypes (mean embeddings) rather than the neural network component.
# Scenario 1
classifier.add_examples(["fish example"], ["aquatic"])
classifier.add_examples(["bird example"], ["aerial"])
# Scenario 2
classifier.add_examples(["bird example"], ["aerial"])
classifier.add_examples(["fish example"], ["aquatic"])
# These may produce slightly different models due to incremental training.