GDumb#
- class capymoa.ocl.strategy.GDumb[source]#
Bases:
BatchClassifier
,TestTaskAware
Greedy sampler and a dumb learner.
Greedy sampler and a dumb learner (GDumb) [1] is a baseline replay strategy. It works by down sampling the dataset and training offline. Since online learners do not have an inference time, GDumb is an offline algorithm, but GDumb remains a useful baseline.
- __init__(
- schema: Schema,
- model: Module,
- epochs: int,
- batch_size: int,
- capacity: int,
- lr: float = 0.001,
- device: str | device = 'cpu',
- seed: int = 0,
- batch_predict_proba(x: Tensor) Tensor [source]#
Predict the probabilities of the classes for a batch of instances.
- predict(instance: Instance) int | None [source]#
Predict the label of an instance.
The base implementation calls
predict_proba()
and returns the label with the highest probability.- Parameters:
instance – The instance to predict the label for.
- Returns:
The predicted label or
None
if the classifier is unable to make a prediction.
- predict_proba(
- instance: Instance,
Calls
batch_predict_proba()
with a batch of size 1.
- train(instance: LabeledInstance) None [source]#
Calls
batch_train()
with a batch of size 1.
- random_seed: int#
The random seed for reproducibility.
When implementing a classifier ensure random number generators are seeded.