2.1 Installing MLHub on Ubuntu


MLHub targets the Ubuntu platform and is implemented in Python3. All of the curated models that are registered with MLHub are tested against Ubuntu LTS (Long Term Support) with a user who has sudo access to the system (e.g., running within a Virtual machine). MLHub can be installed on MacOS and Windows using a virtual machine or WSL. MLHub also runs native on MacOS and Windows though you will need to manually install some dependencies. Many users have reported success on these platforms.

Ubuntu can be installed on almost anything from a Raspberry Pi to a desktop or laptop, running Ubuntu directly, or through a virtual machine, or via the Windows Subsystem for Linux (WSL). GNU/Linux (Ubuntu being a distribution of GNU/Linux) is the most widely deployed operating system on cloud servers and smart devices (Android) The various options for installing Ubuntu are covered in the GNU/Linux Desktop Survival Guide. Once you have Ubuntu installed, particularly on a virtual machine, MLHub is easy.

If you have a new Ubuntu install you might first install wajig to simplify using Ubuntu. First check if it is already installed (try typing wajig into a command terminal). If not then you will need system administrator privileges to install it using sudo or ask your system administrator to do so. The latest version of wajig is available from the PyPI software repository. Installation of wajig will usually take less than 5 minutes.

sudo apt update
sudo apt upgrade
sudo apt install wajig
wajig update 
wajig upgrade 
wajig install python3-pip
pip install wajig

Be sure to log out and log back in after the pip install so that the system will notice your local installations. This will refresh the PATH that is used to find applications. On Ubuntu Pip installs the wajig command in ~/.local/bin. If all else fails then the following could be useful (but not usually required):

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

We are now ready to install and configure MLHub from the PyPI software repository using the pip command:

pip install mlhub

After installation the system can be checked to ensure the required software is installed on your system by running this command:

ml configure

If you are asked for a sudo password then some system packages will need to be installed. If you do not have system privileges then you will need your system administrator to install the required packages, by running the above command for you. In this case, as a non-sudo user, simply typer Ctrl-D to continue the configuration of mlhub.

This may take 5 to 10 minutes, depending on what other dependencies are already installed.

Also install the mlhub R package. If you don’t have system administrator privileges simply drop the sudo prefix to these two commands:

sudo Rscript -e 'install.packages("testthat", quiet=TRUE)'
sudo Rscript -e 'devtools::install_github("mlhubber/mlhub@main", quiet=TRUE)'

The ml command should now be ready to use.

Getting started is now simple. Choose from amongst the packages of interest to you from the package catalogue. As a data scientist you may be interested in visualisations (ports), beeswarm, and animations (animate). For traditional machine learning there are models for rain prediction (rain) and movie recommendation (movies). For pre-built deep neural network models you can find models to colorize photos (colorize), identify objects (objects), to make you computer see with computer vision (azcv), or to detect faces (facedetect).

Explore, enjoy, share, and empower. Above all, let’s work toward a collective purpose of ensuring we have a meaningful future for humanity.

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0