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 DataFrame

The inputs for which to predict the outputs.

required

Returns:

Type Description
DataFrame

The predicted outputs.

Source code in src/flowcean/core/model.py
17
18
19
20
21
22
23
24
25
26
27
28
29
@abstractmethod
def predict(
    self,
    input_features: pl.DataFrame,
) -> pl.DataFrame:
    """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
31
32
33
34
35
36
37
@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
39
40
41
42
43
44
45
@abstractmethod
def load(self, path: Path) -> None:
    """Load the model from path.

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

ModelWithTransform(model, transform) dataclass

Bases: Model

Model that carries a transform.

Attributes:

Name Type Description
model Model

Model

transform Transform

Transform