Classification and Regression with the BigML Dashboard

6.7 Consuming Fusions

Similarly to other models in BigML, fusions are white-box models, so you can download them and use them locally to make predictions. You can also create and consume your fusions programmatically via the BigML API and bindings. The following subsections explain these three options.

6.7.1 Downloading Fusions

You can download your fusions in several programming languages including JSON PML, Python or Node.js. By downloading your fusions you will be able to compute predictions locally, free of latency and at no cost. Click on the download icon in the top menu (see Figure 6.71 ), and select your preferred option (see Figure 6.72 .)

\includegraphics[]{images/fusions/fusions-download0}
Figure 6.71 Click download icon
\includegraphics[]{images/fusions/fusions-download}
Figure 6.72 Select language to download your fusions

6.7.2 Using Fusions via the BigML API

Fusions have full citizenship in the BigML API which allows you to programmatically create, configure, retrieve, list, update, delete, and use them for predictions.

In the example below, see how to create a fusion using two existing models once you have properly set the BIGML_AUTH environment variable to contain your authentication credentials:

curl "https://bigml.io/fusion?\$BIGML_AUTH" \
    -X POST \
    -H 'content-type: application/json' \
    -d '{"models":["model/5af06df94e17277501000010"
                   "model/5af06df84e17277502000019"
                   "deepnet/5af06df84e17277502000016"
                   "ensemble/5af06df74e1727750100000d"]}'

For more information on using fusions through the BigML API, please refer to the documentation.

6.7.3 Using Fusions via the BigML Bindings

You can also create and use fusions via BigML bindings which are libraries aimed to make it easier to use the BigML API from your language of choice. BigML offers bindings in multiple languages including Python, Node.js, Java, Swift and Objective-C. See below an example to create a fusion with the Python bindings.

from bigml.api import BigML
api = BigML()
fusion = api.create_fusion(["model/5af06df94e17277501000010"
                            "model/5af06df84e17277502000019"
                            "deepnet/5af06df84e17277502000016"
                            "ensemble/5af06df74e1727750100000d"])

For more information on BigML bindings, please refer to the bindings page.