November 2018
Intermediate to advanced
556 pages
14h 42m
English
To deploy our model on the cloud, we need to write a simple Python file, train.py, with the code of our logistic regression model. For our convenience, we have reported the accuracy to the Azure portal using the logging function of the Azure ML service. The code to do this is as follows:
…run = Run.get_context()run.log('accuracy', np.float(acc))When the model has been built and trained, we can dump it in the Azure ML repository, so that we can restore it during the init() method of core.py:
from sklearn.externals import joblibjoblib.dump(value=logreg, filename='outputs/sklearn_windturbine_model.pkl')