# `Batch`

### *class* capymoa.base.Batch[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/base/_batch.py#L6)

Bases: [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC)

Base class for batch processing in CapyMOA

#### *abstract* batch_predict(x: [Tensor](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor)) → [Tensor](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor)[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/base/_batch.py#L24)

Predict the target values for a batch of instances.

* **Parameters:**
  **x** – A batch of feature vectors of shape `(batch_size, num_features)`.
* **Returns:**
  Predicted target values, typically a vector of shape `(batch_size,)`.

#### *abstract* batch_train(x: [Tensor](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor), y: [Tensor](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor)) → [None](https://docs.python.org/3/builtins/constants.html#None)[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/base/_batch.py#L16)

Train the model with a batch of instances.

* **Parameters:**
  * **x** – A batch of feature vectors of shape `(batch_size, num_features)`.
  * **y** – A batch of target values, typically a vector of shape `(batch_size,)`.

#### device *: [device](https://docs.pytorch.org/docs/stable/tensor_attributes.html#torch.device)* *= device(type='cpu')*

Device on which the batch will be processed.

#### x_dtype *: [dtype](https://docs.pytorch.org/docs/stable/tensor_attributes.html#torch.dtype)*

Data type for the input features.

#### y_dtype *: [dtype](https://docs.pytorch.org/docs/stable/tensor_attributes.html#torch.dtype)*

Data type for the target value/labels.
