This commit is contained in:
Christian Mantha
2026-03-02 19:10:52 -05:00
commit 2ca0b9ef7c
28907 changed files with 5233713 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
"""Export and import of generic R models.
This module defines generic filesystem format for R models and provides utilities
for saving and loading to and from this format. The format is self contained in the sense
that it includes all necessary information for anyone to load it and use it. Dependencies
are either stored directly with the model or referenced via a Conda environment.
The convention for rfunc models is to have a ``predict`` method or function with the following
signature::
predict(data: DataFrame) -> DataFrame
This convention is relied on by other MLflow components.
Rfunc model format is defined as a directory structure containing all required data, code, and
configuration:
.. code::
./dst-path/
./MLmodel: configuration
It must contain MLmodel file in its root with "r_function" format.
Example:
.. code:: shell
>tree R/mlflow/R/inst/examples/R/lm/model
├── MLmodel
└── r_model.bin
>cat R/mlflow/R/inst/examples/R/lm/model/MLmodel
time_created: 1.5337659e+09
flavors:
r_function:
version: 0.1.0
model: r_model.bin
"""
FLAVOR_NAME = "crate"