Quick Start MLHub

See the Platform Guide for getting started with Ubuntu. This quick start assumes a fresh install of Ubuntu 18.04 LTS and so some of the steps may not be necessary. Let’s get started with installing MLHub, after making sure the system is up to date. You may be asked questions to confirm that you would like a package or two to be installed. This will take less than 5 minutes.

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install python3-pip
$ pip3 install mlhub

After this completes the ml command should be available. Type ml at the prompt, then enter. If the command is not found you may need to log out and back in again to refresh the PATH where commands are found. The default in Ubuntu 18.04 LTS is that the path is setup properly with the following and so this should not normally be required:

$ echo 'PATH=~/.local/bin:$PATH' >> ~/.bashrc

Once you have a working ml command you can configure the command itself and check what packages are available. The configure will install quite a comprehensive collection of AI technology to have your computer AI-ready. This will include several hundred packages (mostly small) that are downloaded and installed. For each of the major packages you will be asked to confirm that it is okay to install. This could take up to 5 minutes.

$ ml configure      # Configure the dependencies for mlhub - required only once
$ ml                # Show a usage message.
$ ml available      # List of pre-buld models on the MLHub.
$ ml installed      # List of pre-built models installed locally

Once working you will be able to run the Hello World example which is the rain model. This uses the free and open source R statistical software package

The TL;DR version is below. Note that you type the command ml install rain and that everything from the # to the end of the line is ignored (it’s a comment). The configure command will install any specific dependencies and could again take a couple of minutes. It is only needed once after the install.

$ ml install   rain # Install the pre-built model named 'rain'.
$ ml configure rain # Configure any dependencies for the model.
$ ml readme    rain # View background information about the model.
$ ml commands  rain # List of commands supported by the model.
$ ml demo      rain # Run the demonstration of the pre-built model.
$ ml display   rain # Graphical display of pre-built model.
$ ml score     rain # Interact with the model to predict rain.
$ ml train     rain # Supply own data and re-fit a model.

Different pre-built model packages will have different system dependencies and these will be installed by the configure command. Other packages recommended for new-to-AI to explore include objects and animate. More sophisticate users might review azcv.

To remove a package and to recover the disk storage used by the package:

$ ml remove rain

Next …

Refer to the Survival Guide for details of the many and flexible variations available for installing packages through the install command. The available MLHub curated packages are listed using the available command.

The Tips and Tricks page of the Survival Guide is a useful guide to some shortcuts in using MLHub.