modeling-and-mlflow
Operate ai-data-science-team H2O AutoML, deterministic model evaluation, MLflow tools, and optional ML dependency checks.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- modeling-and-mlflow
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operate ai-data-science-team H2O AutoML, deterministic model evaluation, MLflow tools, and optional ML dependency checks.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md13.6 KB
- 参考文档references/mlflow-tools.md10.5 KB
- 参考文档references/optional-dependencies.md6.4 KB
- 参考文档references/troubleshooting.md12.4 KB
- 参考文档references/workflows.md11.4 KB
- 脚本scripts/check_ml_optional_imports.py10.1 KB
03 SKILL.md 正文
Modeling and MLflow
Use this sub-skill when the task is to train or inspect H2O AutoML workflows, evaluate a trained H2O model deterministically, manage MLflow experiments/runs/models with the package tools, or troubleshoot optional ML dependencies for ai-data-science-team.
Route here for
H2OMLAgent,make_h2o_ml_agent, and thetrain_h2o_automlLangChain tool.- Dataset/target validation before H2O AutoML training and safe extraction of leaderboard, best model id, model path, generated function, recommended steps, and log summary.
- Deterministic holdout evaluation with
ModelEvaluationAgent, including classification metrics, regression metrics, confusion matrix, ROC curve when available, and residual plots. MLflowToolsAgent,make_mlflow_tools_agent, and directai_data_science_team.tools.mlflowhelpers for experiment/run search, logging, artifacts, prediction, model registry, and UI status.- Optional dependency triage for
h2o,mlflow, Java/H2O runtime, local MLflow UI/process issues, and import-time notebook display helpers.
Route away
- For data loading, EDA summaries, and optional EDA reports before modeling, use the sibling
data-access-and-edasub-skill. - For feature engineering, generated pandas code, wrangling, cleaning, or visualization before training, use the sibling
dataframe-code-agentssub-skill. - For supervisor teams, Streamlit apps, or cross-agent orchestration around modeling, use the sibling
multiagent-and-app-workflowssub-skill. - For SQL-backed feature extraction, use the sibling
sql-analysissub-skill first, then return here with a pandas DataFrame.
Safe operating defaults
- Treat H2O and MLflow as optional extras. Run the bundled optional import check before promising runtime availability.
- Do not launch the MLflow UI, kill UI processes, start H2O training, download artifacts, or write model/log artifacts unless the user explicitly asked for that side effect.
- Keep AutoML bounded with
max_runtime_secs,max_models,seed, and usuallyexclude_algos=["DeepLearning"]for quick local experiments. - Prefer explicit
target_variable/targetand verify the target exists, has non-null values, and has at least two classes for classification. - Use local/disposable MLflow tracking locations for experiments unless the user provides and authorizes a remote tracking/registry URI.
- Never embed API keys, service tokens, tracking-server credentials, local environment prefixes, or absolute checkout paths in generated logs or reports.
Quick routes
Check optional ML readiness without side effects
python sub-skills/modeling-and-mlflow/scripts/check_ml_optional_imports.py
python sub-skills/modeling-and-mlflow/scripts/check_ml_optional_imports.py --inspect-public-apis --require h2o mlflow
The script only checks imports, package metadata, public signatures, and Java availability. It does not train, start H2O, launch MLflow, call an LLM, download data, or write artifacts.
Train with H2OMLAgent when the caller supplies an LLM
from ai_data_science_team.ml_agents import H2OMLAgent
llm = ... # caller-provided LangChain-compatible chat model
df = ... # pandas DataFrame already loaded and cleaned
agent = H2OMLAgent(
model=llm,
log=False,
model_directory=None,
enable_mlflow=False,
bypass_recommended_steps=True,
bypass_explain_code=True,
)
agent.invoke_agent(
data_raw=df,
target_variable="target",
user_instructions="Train a bounded H2O AutoML model; use max_models=3 and seed=42.",
)
leaderboard = agent.get_leaderboard()
best_model_id = agent.get_best_model_id()
model_path = agent.get_model_path()
Use workflows before enabling model saving, MLflow logging, human review, or large AutoML budgets.
Evaluate a trained H2O model deterministically
from langchain_core.messages import HumanMessage
from ai_data_science_team.ml_agents import ModelEvaluationAgent
model_artifacts = {
"model_path": agent.get_model_path(),
"best_model_id": agent.get_best_model_id(),
}
evaluator = ModelEvaluationAgent()
evaluator.invoke_messages(
[HumanMessage(content="Evaluate the trained model on a holdout split.")],
data_raw=df,
model_artifacts=model_artifacts,
target_variable="target",
test_size=0.2,
random_state=42,
)
artifacts = evaluator.get_eval_artifacts()
ModelEvaluationAgent does not need an LLM response to compute metrics, but it does need H2O available and a resolvable saved model path or H2O model id.
Inspect MLflow without natural-language tool calling
from ai_data_science_team.tools.mlflow import mlflow_tracking_info, mlflow_search_experiments
tracking_msg, tracking_artifact = mlflow_tracking_info.invoke({})
experiments_msg, experiments_artifact = mlflow_search_experiments.invoke({"filter_string": None})
Use the direct tools for deterministic scripting. Use MLflowToolsAgent only when the user wants natural-language MLflow operations and supplies an LLM.
References and bundled checks
- API reference: public imports, constructor signatures, response fields, and API boundaries.
- Workflows: H2O AutoML training, deterministic evaluation, H2O-to-MLflow logging, and validation patterns.
- MLflow tools: tool catalog, safe direct use, agent use, UI/process behavior, artifacts, prediction, and registry operations.
- Optional dependencies: extras, runtime expectations, Java/H2O notes, and dependency gates.
- Troubleshooting: symptoms, likely causes, and recovery steps for optional ML workflows.
- Optional import check: safe readiness checker with no LLM call, service launch, download, training, or destructive write.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).