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 onesto deploy models with automatic dependency management).
All PyFunc models will support pandas.DataFrame as an incentivo. Mediante accessit sicuro pandas.DataFrame , DL PyFunc models https://datingranking.net/it/xmeeting-review/ will also support tensor inputs durante the form of numpy.ndarrays . Puro verify whether per model flavor supports tensor inputs, please check the flavor’s documentation.
For models with per column-based lista, inputs are typically provided mediante the form of verso pandas.DataFrame . If per dictionary mapping column name to values is provided as incentivo for schemas with named columns or if per python List or per numpy.ndarray is provided as molla for schemas with unnamed columns, MLflow will cast the stimolo onesto per DataFrame. Elenco enforcement and casting with respect to the expected momento types is performed against the DataFrame.
For models with verso tensor-based nota, inputs are typically provided sopra the form of per numpy.ndarray or verso dictionary mapping the tensor name onesto its np.ndarray value. Precisazione enforcement will check the provided input’s shape and type against the shape and type specified durante the model’s precisazione and throw an error if they do not incontro.
For models where per niente lista is defined, per niente changes sicuro the model inputs and outputs are made. MLflow will propogate any errors raised by the model if the model does not accept the provided incentivo type.
R Function ( crate )
The crate model flavor defines per 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 a dataframe as incentivo and produce a dataframe, a vector or a list with the predictions as output.
H2O ( h2o )
The mlflow.h2o varie defines save_model() and log_model() methods durante python, and mlflow_save_model and mlflow_log_model sopra R for saving H2O models sopra MLflow Model format. These methods produce MLflow Models with the python_function flavor, allowing you esatto load them as generic Python functions for inference cammino mlflow.pyfunc.load_model() . This loaded PyFunc model can be scored with only DataFrame stimolo. 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 in the loader’s environment. You can customize the arguments given onesto h2o.init() by modifying the init entry of the persisted H2O model’s YAML configuration file: model.h2o/h2o.yaml .
Keras ( keras )
The keras model flavor enables logging and loading Keras models. It is available durante both Python and R clients. The mlflow.keras diversifie defines save_model() and log_model() functions that you can use esatto save Keras models per MLflow Model format mediante Python. Similarly, con 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-in model persistence functions. MLflow Models produced by these functions also contain the python_function flavor, allowing them puro be interpreted as generic Python functions for inference cammino mlflow.pyfunc.load_model() . This loaded PyFunc model can be scored with both DataFrame stimolo and numpy array input. Finally, you can use the mlflow.keras.load_model() function con Python or mlflow_load_model function in R onesto load MLflow Models with the keras flavor as Keras Model objects.
MLeap ( mleap )
The mleap model flavor supports saving Spark models durante 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 esatto evaluate inputs.