Support

Requirements

Python 2.7 and Python 3 are currently supported by these bindings.

The basic third-party dependencies are the
requests,
poster and
unidecode libraries. These
libraries are automatically installed during the setup. Support for Google
App Engine has been added as of version 3.0.0, using the urlfetch package
instead of requests.

The bindings will also use simplejson if you happen to have it
installed, but that is optional: we fall back to Python’s built-in JSON
libraries is simplejson is not found.

Additional numpy and
scipy libraries are needed in case you want to use
local predictions for regression models (including the error information)
using proportional missing strategy. As these are quite heavy libraries and
they are so seldom used, they are not included in the automatic installation
dependencies. The test suite includes some tests that will need these
libraries to be installed.

Running the Tests

The test will be run using nose ,
that is installed on setup, and you’ll need to set up your authentication
via environment variables, as explained
below. With that in place, you can run the test suite simply by issuing

$ python setup.py nosetests

Some tests need the numpy and
scipy libraries to be installed too. They are not
automatically installed as a dependency, as they are quite heavy and very
seldom used.

Importing the module

To import the module:

importbigml.api

Alternatively you can just import the BigML class:

frombigml.apiimportBigML

Authentication

All the requests to BigML.io must be authenticated using your username
and API key and are always
transmitted over HTTPS.

This module will look for your username and API key in the environment
variables BIGML_USERNAME and BIGML_API_KEY respectively. You can
add the following lines to your .bashrc or .bash_profile to set
those variables automatically when you log in:

Otherwise, you can initialize directly when instantiating the BigML
class as follows:

api=BigML('myusername','ae579e7e53fb9abd646a6ff8aa99d4afe83ac291')

Also, you can initialize the library to work in the Sandbox environment by
passing the parameter dev_mode:

api=BigML(dev_mode=True)

Quick Start

Imagine that you want to use this csv
file containing the Iris
flower dataset to
predict the species of a flower whose sepal length is 5 and
whose sepal width is 2.5. A preview of the dataset is shown
below. It has 4 numeric fields: sepal length, sepal width,
petal length, petal width and a categorical field: species.
By default, BigML considers the last field in the dataset as the
objective field (i.e., the field that you want to generate predictions
for).

The iris dataset has a small number of instances, and usually will be
instantly created, so the api.create_ calls will probably return the
finished resources outright. As BigML’s API is asynchronous,
in general you will need to ensure
that objects are finished before using them by using api.ok.

This method retrieves the remote object in its latest state and updates
the variable used as argument with this information. Note that the prediction
call is not followed by the api.ok method. Predictions are so quick to be
generated that, unlike the
rest of resouces, will be generated synchronously as a finished object.

4.5.3 (2016-05-04)

4.5.2 (2016-03-24)

Fixing bug in model’s local predictions. When the model uses text fields and
the field contents are missing in the input data, the prediction does
not return the last prediction and stop. It now follows the
“does not contain” branch.

4.5.1 (2016-03-12)

Adding method to Fields object to produce CSV summary files.

Adding method to Fields object to import changes in updatable attributes
from CSV files or strings.

4.5.0 (2016-02-08)

Adapting association object to the new syntax of missing values.

Improving docs and comments for the proportional strategy in predictions.

Fixing bug: centroid input data datetime fields are optional.

4.4.2 (2016-01-06)

Adapting logistic regression local object to the new missing_numeric
parameter.

1.2.1 (2014-03-19)

1.2.0 (2014-03-07)

Adding new output options to model’s python, rules and tableau outputs:
ability to extract the branch of the model leading to a certain node with
or without the hanging subtree.

Adding HTTP_TOO_MANY_REQUESTS error handling in REST API calls.

1.1.0 (2014-02-10)

Adding Tableau-ready ouput to local model code generators.

1.0.6 (2014-02-03)

Fixing getters: getter for batch predictions was missing.

1.0.5 (2014-01-22)

Improving BaseModel and Model. If they receive a partial model
structure with a correct model id, the needed model resource is downloaded
and stored (if storage is enabled in the given api connection).

Improving local ensemble. Adding a new fields attribute that
contains all the fields used in its models.

1.0.4 (2014-01-21)

Adding a summarize method to local ensembles with data distribution
and field importance information.

1.0.3 (2014-01-21)

Fixes bug in regressions predictions with ensembles and plurality without
confidence information. Predictions values were not normalized.