Classification and Regression with the BigML Dashboard
2.7 Consuming Ensembles
In the previous sections, we have described how you can create ensembles, configure them, use them to make predictions, and more. This section will introduce a number of BigML features that enable interesting ways of taking advantages of ensembles: exporting them locally, and using them programmatically via the BigML REST API and Bindings.
2.7.1 Exporting and Downloading Ensembles
You can export your ensemble in a number of programming languages, including Python, Java, and Node.js. Just click on the download icon in the top menu and select your preferred option.
The main goal of downloading your ensemble in a programming language is to make Local predictionss faster and at no cost. (See Figure 2.97 .)
![\includegraphics[]{images/ensembles/download-ensemble}](images/img-0201.png)
2.7.2 Using Ensembles via the BigML API
Ensembles have full citizenship in the BigML API. This means you can programmatically create, update, list, delete, and use them for predictions. For example, this is how you can create en ensemble from the command line with custom values for a few available arguments. This will require you have properly set the BIGML_AUTH environment variable to contain your authentication credentials:
curl "https://bigml.io/ensemble?$BIGML_AUTH" \
-X POST \
-H 'content-type: application/json' \
-d '{"dataset": "dataset/4f66a80803ce8940c5000006",
"name": "my ensemble",
"number_of_models": 32}'
For more information on using ensembles through the BigML API, please refer to ensemble REST API documentation.
2.7.3 Using Ensembles via the BigML Bindings
BigML bindings provide a convenient way to access BigML REST API from your language of choice. They offer a higher-level view of BigML Machine Learning resources and algorithms in a number of languages, including Python, Node.js, Java, Swift, and Objective-C. For example, this is how you can create en ensemble in Python using BigML bindings:
from bigml.api import BigML
api = BigML()
prediction = api.create_ensemble("dataset/573d997058a27e0f620038df",
"number_of_models": 32,
{"name": "my Ensemble"})
For more information on using ensembles through the BigML API, please refer to BigML bindings documentation.