Import your own Keras models

Deploy-ML aims to make the process of training, testing and deploying machine learning easier and simplier. However, sometimes the model required is not directly supported, or a collegue has already defined a model. The import class is for users who define their own Keras model, but want to use the package for training and deployment reasons. To use your Keras model, import the import class. [WARNING whilst the basic neural network structure deployment is supported, the import is not yet. It will be supported in the next version]

from deployml.keras import ImportBase


  • model = Sk-Learn model that you have imported and defined
  • model_title = string describing the title of the model for deployment package

Practical Example

Below is an example of importing a logistic regression model from sk-learn, and using the deploy-ml import class:

from deployml.sklearn.models.import import ImportBase

model = ImportBase(model=defined_keras_model,
                     model_title="Logistic Regression")

Now the imported model has all the training but not deployment functions of deploy-ml.