Command Line MLHub

The command line interface can be installed on Linux, Mac, or Windows from the PyPi repository:

$ pip install mlhub

Once installed you will be able to run the sample rain model assuming that you have the free and open source R statistical software package installed.  You’ll need Python installed too, but you will probably already have it if you were able to run the pip command above.

The TL;DR version is below. Note that you type the command ml ... and that everything from the # to the end of the line is ignored (it’s a comment):

$ ml install rain # Install the model named 'rain'.
$ 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.

The following lists the commands generally available for each package and a brief description of each:

$ ml                # Show a usage message.
$ ml available      # List of pre-buld models on the MLHub.
$ ml installed      # List of pre-built models installed locally

$ ml install rain   # Install the pre-built model named 'rain'.
$ ml remove  rain   # Remove locally installed pre-built model.
$ ml remove         # Remove the local MLHub folder.

$ ml readme    rain # View background information about the model.
$ ml configure rain # Install any required packages.
$ ml commands  rain # List of commands supported by the model.
$ ml demo      rain # Run the demonstration of the pre-built model
$ ml print     rain # Textual summary of the pre-built model.
$ ml display   rain # Graphical display of pre-built model.
$ ml score     rain # Interactive model or run model on own data.
$ 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.

Command Auto Completion

The bash shell on Linux supports command line auto-completion which is pretty handy. You can download ml.bash from the MLHub and place the file into /etc/bash_completion.d/ or for later versoins of bash, into ~/.local/share/bash-completion/completions/

$ wget https://mlhub.ai/ml.bash
THEN
$ sudo install -m 0644 ml.bash /etc/bash_completion.d/
OR (for bash --version > 4.3)
$ mkdir -p ~/.local/share/bash-completion/completions/
$ mv ml.bash ~/.local/share/bash-completion/completions/

Restart the shell for the auto-completion to take effect. Then type ‘ml ‘  then the beginnings of a command, like ‘a’, and then TAB to auto-complete. Auto-completion also works for model names.