model_handler
ModelHandler(model)
Load a Flowcean model and expose its underlying ML model.
Attributes:
model: flowcean.core.model.Model The loaded Flowcean model.
Methods:
get_ml_model() Returns the underlying machine learning model from the Flowcean model.
get_model_prediction() Returns predictions from the Flowcean model as a LazyFrame.
get_model_prediction_as_lst() Returns predictions from the Flowcean model as a Python list.
Initializes the ModelHandler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
Flowcean model instance. |
required |
Source code in src/flowcean/testing/generator/ddtig/application/model_handler.py
34 35 36 37 38 39 40 41 42 43 44 | |
get_ml_model()
Extract the underlying machine learning model.
Returns:
| Type | Description |
|---|---|
SupportsPredict | Module
|
The machine learning model. |
Source code in src/flowcean/testing/generator/ddtig/application/model_handler.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
get_model_prediction(input_features)
Generates predictions using the Flowcean model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_features
|
DataFrame
|
A Polars DataFrame containing input features. |
required |
Returns:
| Type | Description |
|---|---|
LazyFrame
|
A LazyFrame with predicted outputs. |
Source code in src/flowcean/testing/generator/ddtig/application/model_handler.py
62 63 64 65 66 67 68 69 70 71 72 73 74 | |
get_model_prediction_as_lst(input_features)
Generate predictions and return them as a Python list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_features
|
DataFrame
|
A Polars DataFrame containing input features. |
required |
Returns:
| Type | Description |
|---|---|
list
|
A list of predicted output values. |
Source code in src/flowcean/testing/generator/ddtig/application/model_handler.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |