Skip to content

jeff1evesque/machine-learning

Repository files navigation

Machine Learning Build Status Coverage Status

This project provides a web-interface, as well as a programmatic-api for various machine learning algorithms. Some of it's general applications, have been outlined within index.rst.

Supported algorithms:

Contributing

Please adhere to contributing.md, when contributing code. Pull requests that deviate from the contributing.md, could be labelled as invalid, and closed (without merging to master). These best practices will ensure integrity, when revisions of code, or issues need to be reviewed.

Note: support, and philantropy can be inquired, to further assist with development.

Configuration

Fork this project, using of the following methods:

  • simple clone: clone the remote master branch.
  • commit hash: clone the remote master branch, then checkout a specific commit hash.
  • release tag: clone the remote branch, associated with the desired release tag.

Installation

To proceed with the installation for this project, both docker and rancher must be installed. Installing docker must be done manually, to fulfill a set of dependencies. Once completed, rancher can be installed, and automatically configured, by simply executing a provided bash script, from the docker quickstart terminal:

cd /path/to/machine-learning
./install-rancher

Note: the installation, and the configuration of rancher, has been outlined if more explicit instructions are needed.

Execution

Both the web-interface, and the programmatic-api, have corresponding unit tests which can be reviewed, and implemented.

Web Interface

The web-interface, or GUI implementation, allow users to implement the following sessions:

  • data_new: store the provided dataset(s), within the implemented sql database.
  • data_append: append additional dataset(s), to an existing representation (from an earlier data_new session), within the implemented sql database.
  • model_generate: using previous stored dataset(s) (from an earlier
  • data_new, or data_append session), generate a corresponding model into
  • model_predict: using a previous stored model (from an earlier model_predict session), from the implemented nosql datastore, along with user supplied values, generate a corresponding prediction.

When using the web-interface, it is important to ensure the csv, xml, or json file(s), representing the corresponding dataset(s), are properly formatted. Dataset(s) poorly formatted will fail to create respective json dataset representation(s). Subsequently, the dataset(s) will not succeed being stored into corresponding database tables; therefore, no model, or prediction can be made.

The following are acceptable syntax:

Note: each dependent variable value (for JSON datasets), is an array (square brackets), since each dependent variable may have multiple observations.

As mentioned earlier, the web application can be accessed after subsequent vagrant up command, followed by using a browser referencing localhost:8080, on the host machine.

Programmatic Interface

The programmatic-interface, or set of API, allow users to implement the following sessions:

  • data_new: store the provided dataset(s), within the implemented sql database.
  • data_append: append additional dataset(s), to an existing representation (from an earlier data_new session), within the implemented sql database.
  • model_generate: using previous stored dataset(s) (from an earlier
  • data_new, or data_append session), generate a corresponding model into
  • model_predict: using a previous stored model (from an earlier model_predict session), from the implemented nosql datastore, along with user supplied values, generate a corresponding prediction.

A post request, can be implemented in python, as follows:

import requests

endpoint = 'https://localhost:9090/load-data'
headers = {
    'Authorization': 'Bearer ' + token,
    'Content-Type': 'application/json'
}

requests.post(endpoint, headers=headers, data=json_string_here)

Note: more information, regarding how to obtain a valid token, can be further reviewed, in the /login documentation.

Note: various data attributes can be nested in above POST request.

It is important to remember that the Vagrantfile, as denoted by the above snippet, has defined two port forwards. Specifically, on the host, 8080 is reserved for the web-interface, while 9090, is reserved for the programmatic rest-api.