技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
modeling-and-mlflow【数据与研究】Operate ai-data-science-team H2O AutoML, deterministic model evaluation, MLflow tools, and optional ML dependency checks.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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.
H2OMLAgent, make_h2o_ml_agent, and the train_h2o_automl LangChain tool.ModelEvaluationAgent, including classification metrics, regression metrics, confusion matrix, ROC curve when available, and residual plots.MLflowToolsAgent, make_mlflow_tools_agent, and direct ai_data_science_team.tools.mlflow helpers for experiment/run search, logging, artifacts, prediction, model registry, and UI status.h2o, mlflow, Java/H2O runtime, local MLflow UI/process issues, and import-time notebook display helpers.data-access-and-eda sub-skill.dataframe-code-agents sub-skill.multiagent-and-app-workflows sub-skill.sql-analysis sub-skill first, then return here with a pandas DataFrame.max_runtime_secs, max_models, seed, and usually exclude_algos=["DeepLearning"] for quick local experiments.target_variable/target and verify the target exists, has non-null values, and has at least two classes for classification.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.
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.
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.
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.