how can i deploy a non-ML model on azure ML ?

tarek Kerbadj 1 Reputation point
2022-08-16T11:15:29.11+00:00

okay so i built a recommendation system that doesn't rely on any ML ( only linear kernel between entries ) and I want to deploy it and make it available for users through a website, I'm confused as to how the deployment process is any different since in this case there is no machine learning being done ( so no.h5 weights or anything like that )

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,563 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 46,566 Reputation points
    2022-08-16T16:08:38.277+00:00

    Hello @tarek Kerbadj

    Thanks for using Microsoft Q&A platform. If you have a locally trained or retrained model, you can register it with Azure. After it's registered, you can continue tuning it by using Azure compute or deploy it by using Azure facilities like Azure Kubernetes Service or Triton Inference Server (Preview).

    To be used with the Azure Machine Learning Python SDK, a model must be stored as a serialized Python object in pickle format (a .pkl file). It must also implement a predict(data) method that returns a JSON-serializable object. For example, you might store a locally trained scikit-learn diabetes model with:

    import joblib  
      
    from sklearn.datasets import load_diabetes  
    from sklearn.linear_model import Ridge  
      
    dataset_x, dataset_y = load_diabetes(return_X_y=True)  
      
    sk_model = Ridge().fit(dataset_x, dataset_y)  
      
    joblib.dump(sk_model, "sklearn_regression_model.pkl")  
    

    To make the model available in Azure, you can then use the register() method of the Model class:

    from azureml.core.model import Model  
      
    model = Model.register(model_path="sklearn_regression_model.pkl",  
                           model_name="sklearn_regression_model",  
                           tags={'area': "diabetes", 'type': "regression"},  
                           description="Ridge regression model to predict diabetes",  
                           workspace=ws)  
    

    You can then find your newly registered model on the Azure Machine Learning Model tab:
    registered-model.png

    To see step by step guidance, please refer to the document - https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-local

    I hope this helps! Let me know if you have more questions, feel free to post under this tag.

    Regards,
    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.

    0 comments No comments