CLIPDF version

Preparing to manage models for using the model CLI

Before you can start using the model CLI to automate model deployment or to perform any other tasks, you must install the scikit-learn machine learning library for Python through the Cloudera AI web UI.

You must perform this task through the Cloudera AI web UI.

  1. Create a new project with Python through the web UI.
    Python provides sample files that you can use to create models using CLI.
  2. To start a new session, go to the Sessions page from the left navigation panel and click new session.
    The Start the new session page is displayed.
  3. On Start the new session page, select, for example, Python 3 from the Kernel drop-down menu.
  4. Enable or disable Spark ML Runtimes Addons. If you enable that option, select the ID for the Spark ML Runtime Addon from the drop-down list.
    Figure 1. Enabling Spark ML Runtimes Addon
  5. Select Start Session to create the session.
  6. From the input prompt, install the scikit-learn machine learning library for Python by running the following command:
    !pip3 install sklearn
  7. Open the fit.py file available within your project from the left navigation panel.
    You can use the fit.py file to create a fitted model which creates a model.pkl file that you can use to deploy the actual model.
  8. Run the fit.py file by clicking Run > Run all.
    The model.pkl directory is created that you can see within your project on the left navigation pane.
  9. Close the session by clicking Stop.

We want your opinion

How can we improve this page?

What kind of feedback do you have?