python
import great_expectations as gx

context = gx.get_context()
data_source = context.data_sources.add_pandas(name='training_data')
asset = data_source.add_dataframe_asset(name='churn_asset')
batch_definition = asset.add_batch_definition_whole_dataframe('full_dataframe')

Great Expectations checks for dataset health before retraining

great-expectations data-quality mlops
by Dr. Elena Vasquez 1 tab
python
import pandera as pa
from pandera.typing import Series

class ChurnTrainingSchema(pa.DataFrameModel):
    customer_id: Series[int] = pa.Field(unique=True)
    age: Series[int] = pa.Field(ge=18, le=100)

Data validation contracts with Pandera for pipeline reliability

pandera data-validation schema
by Dr. Elena Vasquez 1 tab
python
import mlflow
import mlflow.sklearn
from sklearn.metrics import roc_auc_score

mlflow.set_experiment('customer-churn')

Experiment tracking and model registry workflows with MLflow

mlflow experiment-tracking model-registry
by Dr. Elena Vasquez 1 tab
python
import joblib
from skl2onnx import to_onnx
from skl2onnx.common.data_types import FloatTensorType

joblib.dump(model, 'artifacts/model.joblib')

Serializing models with joblib, pickle, and ONNX tradeoffs

model-serialization joblib onnx
by Dr. Elena Vasquez 1 tab
python
import joblib
import pandas as pd
from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI(title='Churn Prediction API')

Serving scikit-learn models behind a FastAPI prediction API

fastapi scikit-learn model-serving
by Dr. Elena Vasquez 1 tab
python
import pandas as pd
from sklearn.ensemble import IsolationForest

df = pd.read_csv('service_metrics.csv')
features = df[['latency_p95', 'error_rate', 'throughput', 'cpu_utilization']]

Anomaly detection with isolation forest and robust thresholds

anomaly-detection isolation-forest monitoring
by Dr. Elena Vasquez 1 tab
python
import pandas as pd
from statsmodels.tsa.statespace.sarimax import SARIMAX

df = pd.read_csv('daily_revenue.csv', parse_dates=['date']).set_index('date')

model = SARIMAX(

Time series forecasting with statsmodels SARIMAX baselines

time-series forecasting statsmodels
by Dr. Elena Vasquez 1 tab
python
import numpy as np
from statsmodels.stats.proportion import proportions_ztest, confint_proportions_2indep

control_conversions = 920
control_users = 12_500
treatment_conversions = 1_015

A B testing analysis with confidence intervals and guardrails

ab-testing experimentation statistics
by Dr. Elena Vasquez 1 tab
python
import numpy as np
from scipy import stats

control = np.array([21.1, 20.5, 19.9, 22.0, 20.8, 21.4])
treatment = np.array([22.8, 23.0, 22.2, 24.1, 23.5, 22.9])

Hypothesis testing for product experiments in Python

statistics hypothesis-testing scipy
by Dr. Elena Vasquez 1 tab
python
# Jupyter notebook startup cell
%load_ext autoreload
%autoreload 2
%matplotlib inline

import os

Jupyter notebook setup that stays reproducible and reviewable

jupyter notebooks reproducibility
by Dr. Elena Vasquez 1 tab
python
from datasets import Dataset
from transformers import AutoTokenizer, AutoModelForSequenceClassification, TrainingArguments, Trainer

model_name = 'distilbert-base-uncased'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=3)

Fine tuning transformer models for domain text classification

hugging-face fine-tuning transformers
by Dr. Elena Vasquez 1 tab
python
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline

model_name = 'distilbert-base-uncased-finetuned-sst-2-english'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

Using Hugging Face transformers for modern NLP inference

hugging-face transformers nlp
by Dr. Elena Vasquez 1 tab