Classification and Regression with the BigML Dashboard

4.7 Consuming Logistic Regressions

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

4.7.1 Downloading Logistic Regressions

You can download your logistic regression in several programming languages including JSON PML, Python or Node.js. By downloading your logistic regression 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 4.132 ), and select your preferred option (see Figure 4.133 .)

\includegraphics[]{images/logisticregression/lr-download0}
Figure 4.132 Click download icon
\includegraphics[]{images/logisticregression/lr-download}
Figure 4.133 Select language to download logistic regression

4.7.2 Using Logistic Regressions via the BigML API

Logistic regression 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 below example, see how to create a logistic regression using an existing dataset once you have properly set the BIGML_AUTH environment variable to contain your authentication credentials:

curl "https://bigml.io/logisticregression?\$BIGML_AUTH" \
    -X POST \
    -H 'content-type: application/json' \
    -d '{"dataset": "dataset/50650bdf3c19201b64000020"}'

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

4.7.3 Using Logistic Regressions via the BigML Bindings

You can also create and use logistic regressions 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 logistic regression with the Python bindings.

from bigml.api import BigML
api = BigML()
logisticrregression = api.create_logistic_regression(
    'dataset/57506c472275c1666b004b10', {"objective_field":"churn"})

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