API Reference¶
This page provides detailed documentation for all public functions in the physics_informed_ml_odw package.
Module: physics_informed_ml_odw¶
predict_2d(image, model='ML')
¶
Predict ODW values for a 2D image using a pre-trained model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
The input image from sensingpy. |
required |
model
|
Literal['ML', 'CS_ML']
|
The model type to use for prediction: - "ML": Machine Learning model - "CS_ML": Caballero&Stumpf Machine Learning model |
"ML"
|
Returns:
| Type | Description |
|---|---|
ndarray
|
2D array with predicted ODW values. |
Source code in src\physics_informed_ml_odw\predict.py
load_model(model)
¶
Load a pre-trained model from the package resources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Literal['ML', 'CS_ML']
|
The model type to load. |
required |
Returns:
| Type | Description |
|---|---|
Pipeline
|
The loaded scikit-learn pipeline. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model type is not recognized. |
Source code in src\physics_informed_ml_odw\predict.py
Functions¶
predict_2d¶
Predict ODW values for a 2D image using a pre-trained model.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
image |
Image |
required | The input image from sensingpy |
model |
Literal["ML", "CS_ML"] |
"ML" |
The model type to use for prediction |
Returns
| Type | Description |
|---|---|
np.ndarray |
2D array with predicted ODW values |
Model Options
"ML": Standard Machine Learning model"CS_ML": Caballero & Stumpf Machine Learning model
Example
from sensingpy import reader
from physics_informed_ml_odw import predict_2d
image = reader.open('satellite_image.tif')
odw_prediction = predict_2d(image, model='ML')
load_model¶
Load a pre-trained model from the package resources.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
model |
Literal["ML", "CS_ML"] |
required | The model type to load |
Returns
| Type | Description |
|---|---|
Pipeline |
The loaded scikit-learn pipeline |
Raises
| Exception | Description |
|---|---|
ValueError |
If the model type is not recognized |
Example
from physics_informed_ml_odw import load_model
# Load the ML model pipeline
pipeline = load_model('ML')
# Access model components
print(pipeline.feature_names_in_)
Constants¶
MODEL_FILES¶
Dictionary mapping model names to their corresponding pickle files.