For this recipe, we are going to be building off of the Implementing LSTM to predict device failure recipe from Chapter 4, Deep Learning for Predictive Maintenance, where we looked at the NASA Turbofan Run to Failure dataset. You can find the Databricks notebooks in the repository for this chapter. For this recipe, we are going to be using the MLflow experiment to retrieve our model. We will convert that model into one that can be run on the frontend using TensorFlow.js. Before we get started with TensorFlow.js, you will need to run pip install tensorflowjs.
From there, you will need to find the model you downloaded from the MLflow artifact; that is, the saved Keras model. To do this, run the following command:
tensorflowjs_converter --input_format=keras model.h5 tfjs_model
Here, model.h5 is the saved Keras LSTM model from the predictive maintenance dataset and tfjs_model is the folder that the model will be placed in.
From there, open Visual Studio...