UI はローカライズ済みです。スキルの紹介と説明文書は選択した言語へ AI が自動翻訳し、コード・コマンド・パス・専門用語は原文のままです。原作者の文書が優先されます。
スキルを探す
デザイン · SKILL.md

m2cgen

m2cgen

Use m2cgen to transpile fitted Python machine-learning models into standalone C, C#, Dart, Elixir, F#, Go, Haskell, Java, JavaScript, PHP, PowerShell, Python, R, Ruby, Rust, or Visual Basic code through its API or CLI.

Independent GitHub snapshot · Automated classification · Original documentation governs

スキルの説明

GitHub

name: m2cgen description: "Use m2cgen to transpile fitted Python machine-learning models into standalone C, C#, Dart, Elixir, F#, Go, Haskell, Java, JavaScript, PHP, PowerShell, Python, R, Ruby, Rust, or Visual Basic code through its API or CLI." disable-model-invocation: true metadata: disco-role: operating license: MIT

m2cgen

Use this repo skill when a task involves converting an already fitted Python estimator or booster into native source code, selecting a supported target language, or diagnosing m2cgen API/CLI export failures.

Install and verify

Install the public package in the environment that contains the fitted model:

python -m pip install m2cgen
python -c "import m2cgen; print(m2cgen.__version__)"

The package has a base NumPy dependency. The library that created a serialized model (for example scikit-learn, statsmodels, lightning, XGBoost, or LightGBM) must also be installed when the model is fitted or unpickled.

Route by task

Minimal decision process

  1. Confirm that the object is fitted and identify its runtime estimator class.
  2. Select one of the 16 supported target-language exporters; do not infer support from a similar language name.
  3. Use the Python API for an in-memory object or the CLI for pickle/joblib and shell pipelines.
  4. Pass only target-appropriate naming options, then validate the generated source before integrating it into a build.
  5. Compare generated predictions with the original model using the correct output semantics and a floating-point tolerance.

Boundaries

This skill covers public m2cgen usage and export troubleshooting. It does not train models, execute generated programs in foreign runtimes, or reproduce the repository's maintainer-only bulk example generation.

Read references/repo-provenance.md before deciding whether this skill is stale for a changed checkout. The generated skill is self-contained; the original repository's tests, examples, and tools are evidence rather than runtime dependencies.

保存したスキル