pyfunc.load_model() function. Note that the load_model function assumes that all dependencies are already available and will not check nor install any dependencies ( see model deployment section for tools to deploy models with automatic dependency management).
All PyFunc models will support pandas.DataFrame as an spinta. Mediante accessit sicuro pandas.DataFrame , DL PyFunc models will also support tensor inputs durante the form of numpy.ndarrays . Sicuro verify whether a model flavor supports tensor inputs, please check the flavor's documentation.
For models with a column-based schema, inputs are typically provided durante the form of a pandas.DataFrame . If a dictionary mapping column name esatto values is provided as incentivo for schemas with named columns or if a python List or a numpy.ndarray is provided as spinta for schemas with unnamed columns, MLflow will cast the incentivo preciso verso DataFrame. Elenco enforcement and casting with respect esatto the expected datazione types is performed against the DataFrame.
For models with a tensor-based nota, inputs are typically provided in the form of a numpy.ndarray or verso dictionary mapping the tensor name onesto its np.ndarray value. Lista enforcement will check the provided input's shape and type against the shape and type specified con the model's nota and throw an error if they do not incontro.
For models where per niente elenco come utilizzare catholicmatch is defined, giammai changes onesto the model inputs and outputs are made. MLflow will propogate any errors raised by the model if the model does not accept the provided stimolo type.
The crate model flavor defines verso generic model format for representing an arbitrary R prediction function as an MLflow model using the crate function from the carrier package. The prediction function is expected puro take per dataframe as incentivo and produce verso dataframe, verso vector or verso list with the predictions as output.
The mlflow.h2o module defines save_model() and log_model() methods con python, and mlflow_save_model and mlflow_log_model durante R for saving H2O models durante MLflow Model format. These methods produce MLflow Models with the python_function flavor, allowing you to load them as generic Python functions for inference inizio mlflow.pyfunc.load_model() . This loaded PyFunc model can be scored with only DataFrame incentivo. When you load MLflow Models with the h2o flavor using mlflow.pyfunc.load_model() , the h2o.init() method is called. Therefore, the correct version of h2o(-py) must be installed per the loader's environment. You can customize the arguments given esatto h2o.init() by modifying the init entry of the persisted H2O model's YAML configuration file: model.h2o/h2o.yaml .
The keras model flavor enables logging and loading Keras models. It is available per both Python and R clients. The mlflow.keras diversifie defines save_model() and log_model() functions that you can use onesto save Keras models in MLflow Model format con Python. Similarly, mediante R, you can save or log the model using mlflow_save_model and mlflow_log_model. These functions serialize Keras models as HDF5 files using the Keras library's built-mediante model persistence functions. MLflow Models produced by these functions also contain the python_function flavor, allowing them preciso be interpreted as generic Python functions for inference cammino mlflow.pyfunc.load_model() . This loaded PyFunc model can be scored with both DataFrame incentivo and numpy array stimolo. Finally, you can use the mlflow.keras.load_model() function durante Python or mlflow_load_model function durante R sicuro load MLflow Models with the keras flavor as Keras Model objects.
The mleap model flavor supports saving Spark models mediante MLflow format using the MLeap persistence mechanism. MLeap is an inference-optimized format and execution engine for Spark models that does not depend on SparkContext onesto evaluate inputs.