Skip to content

model

Model

Bases: ABC

Base class for models.

A model is used to predict outputs for given inputs.

predict(input_features) abstractmethod

Predict outputs for the given inputs.

Parameters:

Name Type Description Default
input_features Data

The inputs for which to predict the outputs.

required

Returns:

Type Description
Data

The predicted outputs.

Source code in src/flowcean/core/model.py
17
18
19
20
21
22
23
24
25
26
@abstractmethod
def predict(self, input_features: Data) -> Data:
    """Predict outputs for the given inputs.

    Args:
        input_features: The inputs for which to predict the outputs.

    Returns:
        The predicted outputs.
    """

save(path) abstractmethod

Save the model to path.

Parameters:

Name Type Description Default
path Path

The path to save the model to.

required
Source code in src/flowcean/core/model.py
28
29
30
31
32
33
34
@abstractmethod
def save(self, path: Path) -> None:
    """Save the model to path.

    Args:
        path: The path to save the model to.
    """

load(path) abstractmethod

Load the model from path.

Parameters:

Name Type Description Default
path Path

The path to load the model from.

required
Source code in src/flowcean/core/model.py
36
37
38
39
40
41
42
@abstractmethod
def load(self, path: Path) -> None:
    """Load the model from path.

    Args:
        path: The path to load the model from.
    """

ModelWithTransform(model, input_transform, output_transform) dataclass

Bases: Model

Model that carries a transform.

Attributes:

Name Type Description
model Model

Model

transform Model

Transform