Editing
AI Infrastructure and MLOps
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''End-to-end ML pipeline with MLflow and FastAPI:''' <syntaxhighlight lang="python"> import mlflow import mlflow.sklearn from sklearn.ensemble import GradientBoostingClassifier from sklearn.metrics import accuracy_score, roc_auc_score from sklearn.model_selection import train_test_split import pandas as pd # === EXPERIMENT TRACKING === mlflow.set_experiment("customer-churn-prediction") with mlflow.start_run(run_name="GBM-v3"): # Log parameters params = {"n_estimators": 200, "max_depth": 5, "learning_rate": 0.1} mlflow.log_params(params) # Train model X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) model = GradientBoostingClassifier(**params) model.fit(X_train, y_train) # Log metrics y_pred = model.predict(X_test) y_prob = model.predict_proba(X_test)[:, 1] mlflow.log_metric("accuracy", accuracy_score(y_test, y_pred)) mlflow.log_metric("roc_auc", roc_auc_score(y_test, y_prob)) # Log model artifact mlflow.sklearn.log_model(model, "model", registered_model_name="churn-predictor") print(f"Run ID: {mlflow.active_run().info.run_id}") # === MODEL SERVING with FastAPI === from fastapi import FastAPI import mlflow.pyfunc app = FastAPI() model = mlflow.pyfunc.load_model("models:/churn-predictor/Production") @app.post("/predict") async def predict(features: dict): df = pd.DataFrame([features]) prediction = model.predict(df) return {"churn_probability": float(prediction[0]), "will_churn": bool(prediction[0] > 0.5)} </syntaxhighlight> ; MLOps tool ecosystem : '''Experiment tracking''' β MLflow, Weights & Biases, Neptune, CometML : '''Pipeline orchestration''' β Apache Airflow, Prefect, Kubeflow Pipelines, ZenML : '''Feature store''' β Feast, Tecton, Hopsworks, Databricks Feature Store : '''Model registry''' β MLflow Model Registry, Hugging Face Hub, W&B Model Registry : '''Model serving (traditional)''' β BentoML, Seldon, TorchServe, MLflow Serving : '''LLM serving''' β vLLM, Text Generation Inference (TGI), Triton Inference Server : '''Monitoring''' β Evidently AI, WhyLabs, Arize, Fiddler : '''GPU training infrastructure''' β SLURM + GPUs, AWS SageMaker, Azure ML, Google Vertex AI </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information