jpskill.com
💼 ビジネス コミュニティ

clearml

ClearMLは、機械学習の実験管理、パイプライン構築、データ管理、モデルデプロイを支援するオープンソースのMLOpsプラットフォームで、開発者が少ないコードで実験を追跡し、再現可能なパイプラインを構築、学習から提供までMLライフサイクル全体を管理するSkill。

📜 元の英語説明(参考)

Expert guidance for ClearML, the open-source MLOps platform for experiment tracking, pipeline orchestration, data management, and model deployment. Helps developers set up ML experiment tracking with minimal code, build reproducible pipelines, and manage the full ML lifecycle from training to serving.

🇯🇵 日本人クリエイター向け解説

一言でいうと

ClearMLは、機械学習の実験管理、パイプライン構築、データ管理、モデルデプロイを支援するオープンソースのMLOpsプラットフォームで、開発者が少ないコードで実験を追跡し、再現可能なパイプラインを構築、学習から提供までMLライフサイクル全体を管理するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o clearml.zip https://jpskill.com/download/14749.zip && unzip -o clearml.zip && rm clearml.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14749.zip -OutFile "$d\clearml.zip"; Expand-Archive "$d\clearml.zip" -DestinationPath $d -Force; ri "$d\clearml.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して clearml.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → clearml フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

ClearML — オープンソース ML Operations

概要

ClearMLは、実験の追跡、パイプラインのオーケストレーション、データ管理、モデルのデプロイのためのオープンソースのMLOpsプラットフォームです。開発者が最小限のコードでML実験の追跡を設定し、再現可能なパイプラインを構築し、トレーニングからサービス提供までのMLライフサイクル全体を管理するのに役立ちます。

手順

実験の追跡 (2行のコード)

# train.py — 自動実験追跡
from clearml import Task

# 以下の2行だけで、すべてが自動的にキャプチャされます。
# - Git リポジトリ、ブランチ、および差分
# - インストールされているすべてのパッケージ
# - CLI 引数
# - stdout/stderr
# - フレームワークのメトリクス (PyTorch, TensorFlow, scikit-learn)
task = Task.init(project_name="NLP", task_name="sentiment-classifier-v2")

# すべてのprint文、matplotlibプロット、およびフレームワークのメトリクスは
# 自動的にキャプチャされます — 追加のコードは不要です

import torch
from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments

model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=3)

training_args = TrainingArguments(
    output_dir="./results",
    num_train_epochs=3,
    per_device_train_batch_size=32,
    learning_rate=2e-5,
    evaluation_strategy="epoch",
    logging_steps=50,
    # ClearMLはこれらのパラメータをすべて自動的にキャプチャします
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset,
)

# トレーニングメトリクスはClearMLダッシュボードに自動的に記録されます
trainer.train()

# 追加のデータを明示的に記録します
task.get_logger().report_scalar("custom", "metric", value=0.95, iteration=100)
task.upload_artifact("model_weights", artifact_object="./results/pytorch_model.bin")

パイプラインのオーケストレーション

# pipeline.py — ClearMLを使用したMLパイプライン
from clearml import PipelineController

pipe = PipelineController(
    name="Training Pipeline",
    project="NLP",
    version="1.0",
)

# ステップ 1: データの事前処理
pipe.add_step(
    name="preprocess",
    base_task_project="NLP",
    base_task_name="data-preprocess",       # 既存のタスクテンプレートを参照します
    parameter_override={
        "General/dataset_version": "v2.1",
        "General/max_samples": 50000,
    },
)

# ステップ 2: トレーニング (事前処理に依存)
pipe.add_step(
    name="train",
    parents=["preprocess"],
    base_task_project="NLP",
    base_task_name="train-model",
    parameter_override={
        "General/epochs": 5,
        "General/learning_rate": "${preprocess.learning_rate}",  # 親の出力を参照します
    },
)

# ステップ 3: 評価
pipe.add_step(
    name="evaluate",
    parents=["train"],
    base_task_project="NLP",
    base_task_name="evaluate-model",
)

# ステップ 4: メトリクスが閾値を満たす場合にデプロイ
pipe.add_step(
    name="deploy",
    parents=["evaluate"],
    base_task_project="NLP",
    base_task_name="deploy-model",
    pre_execute_callback=lambda pipeline, node, params: {
        # 精度が0.9を超える場合にのみデプロイ
        pipeline.get_step("evaluate").get_metric("accuracy") > 0.9
    },
)

# パイプラインを実行します
pipe.start()

データ管理

# data_versioning.py — データセットのバージョン管理
from clearml import Dataset

# バージョン管理されたデータセットを作成します
dataset = Dataset.create(
    dataset_name="customer-reviews-v2",
    dataset_project="NLP",
    description="感情ラベル付きの顧客レビュー、クリーニングおよび重複排除済み",
)

# ファイルを追加します
dataset.add_files(path="./data/reviews.parquet")
dataset.add_files(path="./data/labels.csv")

# アップロードして確定します (不変のバージョンを作成します)
dataset.upload()
dataset.finalize()
print(f"Dataset ID: {dataset.id}")

# トレーニングでデータセットを使用します
dataset = Dataset.get(
    dataset_name="customer-reviews-v2",
    dataset_project="NLP",
)
local_path = dataset.get_local_copy()    # ローカルにダウンロードしてキャッシュします
# local_pathはreviews.parquetとlabels.csvを含むディレクトリを指します

# 新しいバージョンを作成します (親から継承します)
new_version = Dataset.create(
    dataset_name="customer-reviews-v3",
    dataset_project="NLP",
    parent_datasets=[dataset.id],         # v2からファイルを継承します
)
new_version.add_files("./data/new_reviews.parquet")  # 新しいデータを追加します
new_version.remove_files("data/old_labels.csv")      # 古いファイルを削除します
new_version.upload()
new_version.finalize()

リモート実行 (ClearML Agent)

# ClearML Agentを使用してリモートマシンでタスクを実行します
from clearml import Task

task = Task.init(project_name="NLP", task_name="train-large-model")

# このタスクはローカルで作成されましたが、リモートでクローンして実行できます
task.execute_remotely(queue_name="gpu-queue")

# この行以降は、リモートマシンで実行されます
# ClearML Agentは以下を処理します:
# - 環境のセットアップ (pip install, git clone)
# - データセットのダウンロード
# - コードの実行
# - 結果とアーティファクトのアップロード
# GPUマシンでClearML Agentを起動します
clearml-agent daemon --queue gpu-queue --gpus 0

# またはDocker分離を使用します
clearml-agent daemon --queue gpu-queue --docker --gpus all

ハイパーパラメータ最適化

# hpo.py — 自動ハイパーパラメータ検索
from clearml import Task
from clearml.automation import HyperParameterOptimizer, UniformParameterRange, DiscreteParameterRange

optimizer = HyperParameterOptimizer(
    base_task_id="<template-task-id>",     # 最適化するタスク
    hyper_parameters=[
        UniformParameterRange("General/learning_rate", min_value=1e-5, max_value=1e-3),
        UniformParameterRange("General/weight_decay", min_value=0, max_value=0.1),
        DiscreteParameterRange("General/batch_size", values=[16, 32, 64]),
        DiscreteParameterRange("General/epochs", values=[3, 5, 10]),
    ],
    objective_metric_title="eval",
    objective_metric_series="f1",
    objective_metric_sign="max",            # F1スコアを最大化
    max_number_of_concurrent_tasks=4,
    optimizer_class="OptimizerBOHB",        # ベイズ最適化
    execution_queue="gpu-queue",
    total_max
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

ClearML — Open-Source ML Operations

Overview

ClearML, the open-source MLOps platform for experiment tracking, pipeline orchestration, data management, and model deployment. Helps developers set up ML experiment tracking with minimal code, build reproducible pipelines, and manage the full ML lifecycle from training to serving.

Instructions

Experiment Tracking (Two Lines of Code)

# train.py — Automatic experiment tracking
from clearml import Task

# Just these two lines auto-capture everything:
# - Git repo, branch, and diff
# - All installed packages
# - CLI arguments
# - stdout/stderr
# - Framework metrics (PyTorch, TensorFlow, scikit-learn)
task = Task.init(project_name="NLP", task_name="sentiment-classifier-v2")

# All print statements, matplotlib plots, and framework metrics
# are automatically captured — zero additional code needed

import torch
from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments

model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=3)

training_args = TrainingArguments(
    output_dir="./results",
    num_train_epochs=3,
    per_device_train_batch_size=32,
    learning_rate=2e-5,
    evaluation_strategy="epoch",
    logging_steps=50,
    # ClearML auto-captures all these parameters
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset,
)

# Training metrics automatically logged to ClearML dashboard
trainer.train()

# Explicitly log additional data
task.get_logger().report_scalar("custom", "metric", value=0.95, iteration=100)
task.upload_artifact("model_weights", artifact_object="./results/pytorch_model.bin")

Pipeline Orchestration

# pipeline.py — ML pipeline with ClearML
from clearml import PipelineController

pipe = PipelineController(
    name="Training Pipeline",
    project="NLP",
    version="1.0",
)

# Step 1: Data preprocessing
pipe.add_step(
    name="preprocess",
    base_task_project="NLP",
    base_task_name="data-preprocess",       # Reference an existing task template
    parameter_override={
        "General/dataset_version": "v2.1",
        "General/max_samples": 50000,
    },
)

# Step 2: Training (depends on preprocessing)
pipe.add_step(
    name="train",
    parents=["preprocess"],
    base_task_project="NLP",
    base_task_name="train-model",
    parameter_override={
        "General/epochs": 5,
        "General/learning_rate": "${preprocess.learning_rate}",  # Reference parent output
    },
)

# Step 3: Evaluation
pipe.add_step(
    name="evaluate",
    parents=["train"],
    base_task_project="NLP",
    base_task_name="evaluate-model",
)

# Step 4: Deploy if metrics meet threshold
pipe.add_step(
    name="deploy",
    parents=["evaluate"],
    base_task_project="NLP",
    base_task_name="deploy-model",
    pre_execute_callback=lambda pipeline, node, params: {
        # Only deploy if accuracy > 0.9
        pipeline.get_step("evaluate").get_metric("accuracy") > 0.9
    },
)

# Run the pipeline
pipe.start()

Data Management

# data_versioning.py — Version and manage datasets
from clearml import Dataset

# Create a versioned dataset
dataset = Dataset.create(
    dataset_name="customer-reviews-v2",
    dataset_project="NLP",
    description="Customer reviews with sentiment labels, cleaned and deduplicated",
)

# Add files
dataset.add_files(path="./data/reviews.parquet")
dataset.add_files(path="./data/labels.csv")

# Upload and finalize (creates immutable version)
dataset.upload()
dataset.finalize()
print(f"Dataset ID: {dataset.id}")

# Use the dataset in training
dataset = Dataset.get(
    dataset_name="customer-reviews-v2",
    dataset_project="NLP",
)
local_path = dataset.get_local_copy()    # Downloads and caches locally
# local_path now points to a directory with reviews.parquet and labels.csv

# Create a new version (inherits from parent)
new_version = Dataset.create(
    dataset_name="customer-reviews-v3",
    dataset_project="NLP",
    parent_datasets=[dataset.id],         # Inherits files from v2
)
new_version.add_files("./data/new_reviews.parquet")  # Add new data
new_version.remove_files("data/old_labels.csv")      # Remove outdated files
new_version.upload()
new_version.finalize()

Remote Execution (ClearML Agent)

# Run any task on remote machines with ClearML Agent
from clearml import Task

task = Task.init(project_name="NLP", task_name="train-large-model")

# This task was created locally, but we can clone and run it remotely
task.execute_remotely(queue_name="gpu-queue")

# Everything after this line runs on the remote machine
# ClearML Agent handles:
# - Setting up the environment (pip install, git clone)
# - Downloading datasets
# - Running the code
# - Uploading results and artifacts
# Start a ClearML Agent on a GPU machine
clearml-agent daemon --queue gpu-queue --gpus 0

# Or with Docker isolation
clearml-agent daemon --queue gpu-queue --docker --gpus all

Hyperparameter Optimization

# hpo.py — Automated hyperparameter search
from clearml import Task
from clearml.automation import HyperParameterOptimizer, UniformParameterRange, DiscreteParameterRange

optimizer = HyperParameterOptimizer(
    base_task_id="<template-task-id>",     # Task to optimize
    hyper_parameters=[
        UniformParameterRange("General/learning_rate", min_value=1e-5, max_value=1e-3),
        UniformParameterRange("General/weight_decay", min_value=0, max_value=0.1),
        DiscreteParameterRange("General/batch_size", values=[16, 32, 64]),
        DiscreteParameterRange("General/epochs", values=[3, 5, 10]),
    ],
    objective_metric_title="eval",
    objective_metric_series="f1",
    objective_metric_sign="max",            # Maximize F1 score
    max_number_of_concurrent_tasks=4,
    optimizer_class="OptimizerBOHB",        # Bayesian optimization
    execution_queue="gpu-queue",
    total_max_jobs=50,
)

optimizer.start()
optimizer.wait()

# Get the best configuration
best = optimizer.get_top_experiments(top_k=1)[0]
print(f"Best F1: {best.get_metric('eval', 'f1')}")
print(f"Best params: {best.get_parameters()}")

Installation

# Python SDK
pip install clearml

# Configure (interactive — sets API credentials)
clearml-init

# Self-hosted server (Docker Compose)
docker compose -f docker-compose.yml up -d
# Dashboard at http://localhost:8080

# Or use ClearML Cloud (free tier available)
# https://app.clear.ml

Examples

Example 1: Setting up an evaluation pipeline for a RAG application

User request:

I have a RAG chatbot that answers questions from our docs. Set up Clearml to evaluate answer quality.

The agent creates an evaluation suite with appropriate metrics (faithfulness, relevance, answer correctness), configures test datasets from real user questions, runs baseline evaluations, and sets up CI integration so evaluations run on every prompt or retrieval change.

Example 2: Comparing model performance across prompts

User request:

We're testing GPT-4o vs Claude on our customer support prompts. Set up a comparison with Clearml.

The agent creates a structured experiment with the existing prompt set, configures both model providers, defines scoring criteria specific to customer support (accuracy, tone, completeness), runs the comparison, and generates a summary report with statistical significance indicators.

Guidelines

  1. Two lines to startTask.init() auto-captures everything; add explicit logging only for custom metrics
  2. Use dataset versioning — Version your training data alongside code; reproducibility requires both
  3. Remote execution for GPU work — Develop locally, run on GPU machines with execute_remotely(); no SSH needed
  4. Pipeline for reproducibility — Define training pipelines as code; each run is fully reproducible with tracked inputs/outputs
  5. Queue-based execution — Use queues to route tasks to appropriate hardware (CPU queue, GPU queue, high-memory queue)
  6. HPO with Bayesian optimization — Use BOHB optimizer for efficient hyperparameter search; better than grid/random search
  7. Self-host for privacy — Run the ClearML server on your own infrastructure; all data stays in your network
  8. Compare experiments in dashboard — Use the web UI to overlay training curves, compare hyperparameters, and identify winners