一键导入
mlops-prototyping
Guide to create structured, reproducible Jupyter notebooks for MLOps prototyping, emphasizing configuration management and pipeline integrity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide to create structured, reproducible Jupyter notebooks for MLOps prototyping, emphasizing configuration management and pipeline integrity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guide to refine MLOps projects with task automation, containerization, CI/CD pipelines, and robust experiment tracking.
Guide to prepare MLOps projects for sharing, collaboration, and community engagement.
Guide to transform prototypes into robust, distributable Python packages using the src layout, hybrid paradigm, and strict configuration management.
Guide to initialize a new MLOps project with standard tools (uv, git, VS Code) and best practices.
Guide to implement full stack observability including reproducibility, lineage, monitoring, alerting, and explainability.
Guide to implement rigorous validation layers including static analysis, automated testing, structured logging, and security scanning.
| name | MLOps Prototyping |
| description | Guide to create structured, reproducible Jupyter notebooks for MLOps prototyping, emphasizing configuration management and pipeline integrity. |
To create standardized, reproducible, and production-ready prototypes in Jupyter notebooks. This skill enforces a structured layout (Imports -> Configs -> Load -> EDA -> Modeling -> Eval) and robust engineering practices (Pipelines, Split-Verification) to prevent technical debt and data leakage.
uv managed project (.venv).ipynb file or converting to one.Enforce the following linear sections in every notebook to ensure readability and maintainability.
sklearn.pipeline.Pipeline objects.Expose all "knobs" at the top of the notebook for easy experimentation.
Randomness: Define RANDOM_STATE = 42 and use it in splits and model initialization.
Paths: Use pathlib for robust path handling.
from pathlib import Path
ROOT = Path("..")
DATA_PATH = ROOT / "data" / "input.parquet"
Hyperparameters: Group model params (e.g., N_ESTIMATORS, MAX_DEPTH).
Toggles: Use booleans for expensive operations (e.g., USE_GPU = True, RUN_GRID_SEARCH = False).
Ensure data integrity and prevent leakage.
pd.read_parquet for speed/types, or pd.read_csv.X_train, X_test, y_train, y_test before any data-dependent transformations (imputation, scaling).sklearn.model_selection.train_test_split with stratify for balanced classification.sklearn.model_selection.TimeSeriesSplit if data has a temporal dimension (do NOT shuffle).random_state=RANDOM_STATE.Prohibit raw data transformations on the full dataset.
Mandate: Use sklearn.pipeline.Pipeline or ColumnTransformer.
Why: Automation of fit on train and transform on test prevents data leakage.
Example:
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer
CACHE = "./.cache" # Define a cache directory
numeric_transformer = Pipeline(steps=[
('imputer', SimpleImputer(strategy='median')),
('scaler', StandardScaler())
])
preprocessor = ColumnTransformer(transformers=[
('num', numeric_transformer, numeric_features)
])
# Use 'memory' to cache transformer outputs, speeding up GridSearch
model = Pipeline(steps=[
('preprocessor', preprocessor),
('classifier', RandomForestClassifier())
], memory=CACHE)
Go beyond accuracy/MSE.
sklearn.metrics appropriate for the task (F1, ROC-AUC, RMSE, MAE).feature_importances_ or SHAP values.Facilitate the move from notebook to python package (src/).
.py file trivial later.parameters (for Papermill) or export to mark cells that should be part of the final documentation or automated pipeline.Restart Kernel and Run All) without errors before committing.Configs section?fit called ONLY on X_train?random_state set for all stochastic operations?