moa-multiflow

Documentation for moa-flow

View the Project on GitHub Waikato/moa-multiflow

Welcome to moa-multiflow’s documentation!

Introduction

The idea of this project is creating a more flexible tool for testing, learning machine learning algorithms by combining the strength of MOA via moa-flow API with the dynamic and interactive abilities of script languages. You can export a IPYNB file for a task from MOA, then run it interactively on a web-browser with Jupyter Notebook. Jupyter Notebooks nowadays can run the code written in various programming languages by connecting to the corresponding kernels. MOA use Java language, so that we will use a Jupyter kernel for Java called IJava.

Image Image Image

This tutorial will show you how to export Jupyter Notebooks from MOA as well as how to configure the Jupyter Notebooks for running the exported tasks. We expect that you have already Python and Jupyter Notebooks installed on your machine. If not, please install them before reading further more. This tutorial describes the configuration process on a Windows 10 computer, but it is possibly applied as well for other operating systems without much modifications.

moa-flow API

With moa-flow API, you can simlify your work with MOA by using a predesigned workflow API. You can find documentation for moa-flow API here

MOA Notebook

Try it online with Binder

Binder Click the Binder icon to start the Binder service to play around with the MOA Notebook.

Docker image

If you have Docker installed on your local machine, please run the command bellow to pull the MOA Notebook image from Docker Hub:

docker pull truongtd6285/moanotebook

Set it up offline

Getting started

You can download and install the latest version of IJava from IJava Github repository.

To avoid getting in troubles with the whole installation process, please note some points as follow:

Click new and choose Java: Image

We will get Kernel error as the correct path for the IJava kernel was not we configured: Image

To see available kernels for Jupyter Notebooks, run jupyter kernelspec list from the Windows console: Image

We edit the configuration file for Java kernel in the folder C:\ProgramData\jupyter\kernels\java: Image

Open it by any text editor and change “java” to the absolute path to where Java is currently installed on your computer, do not forget to change “\” in the path to “/” or “\” which is the path format used by JSON. Image

Refresh the Jupyter Notebooks again, it will work properly: Image

Exporting tasks from MOA GUI to a IPYNB files

At that moment, there are 6 tasks that can be exported to Jupyter Notebooks files:

From MOA, under tab “Other Tasks” select WriteConfigurationToJupyterNotebook: Image

Select “Configure” to open “Configure task”. In the field “NotebookFile”, locate the place where you want to save the exported file and input its name. Image

You can click “Edit” button and configure the task with desired parameters Image

You can export IPYNB files with or without running the tasks by tick or untick the runConfig option corresponding. By default, MOA exports the files without running the task. Image

Open the exported IPYNB file on Jupyter Notebooks and run all codes cell. At that step, you have successfully export a task from MOA GUI and run it on Jupyter Notebooks. Example of the running results can be found [here].

Displaying the output result in table format

The result table has long rows, but the CSS style of Jupyter Notebooks is designed to wrap the long rows by default, which makes the table distorted. To come up with that, we need to customise the default CSS file of Jupyter Notebooks by adding a file named custom.css following the instruction as bellow: