Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# EXAMPLES

In this folder, you will find use cases referenced in the playlist to illustrate specific topics. These examples are based on public datasets and, while they may not always reflect real-world scenarios, they are designed to demonstrate particular aspects of the ML lifecycle.

**Notebooks**

Notebooks under `mlflow_for_ml_dev/notebooks/local_model_serving/` are used to demonstrate how to make the API requests in an interactive way.

## Iris Classifier

This example uses the classic Iris dataset, which is included in the scikit-learn package. The dataset provides a simple, well-known classification problem, making it ideal for demonstrating machine learning workflows.

* package: `examples/iris_classifier`

* dataset source: [sklearn load_iris method](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_iris.html)


* Associated inference notebook:
`mlflow_for_ml_dev/noteboks/local_model_serving/deploying_local_iris_model.ipynb`

### Entrypoints available:

* `iris_clf_train ="examples.iris_classifier.train:main"`
Trains the model and register it in the Model registry with name **Iris_Classifier_Model**, The model is set with alias **production**

* `iris_clf_inference = "examples.iris_classifier.inference:main"`
Performs batch inference.

* `iris_clf_online_inference="examples.iris_classifier.online_inference:main"`
Performs online inference. Before running this script, ensure that the model has been trained and registered (for example, using the `iris_clf_train` script). Next, deploy the model locally by executing:

```
poetry run mlflow models serve -m models:/Iris_Classifier_Model@production --env-manager local
```





2 changes: 1 addition & 1 deletion examples/iris_classifier/online_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main() -> None:
Perform online inference using a REST API.

To deploy the model in the local server, run the following command:
`poetry run mlflow models serve -m models:/Iris_Classifier_Model@production --no-conda`
`poetry run mlflow models serve -m models:/Iris_Classifier_Model@production --env-manager local`

"""
payload, labels = get_payload(1)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mlflow_for_ml_dev"
version = "1.4.0"
version = "1.4.1"
description = "Code examples for the youtube playlist 'MLflow for Machine Learning Development' by Manuel Gil"
authors = ["Manuel Gil <[email protected]>"]
readme = "README.md"
Expand Down
Loading