PHPackages                             bigml/bigml-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bigml/bigml-php

ActiveLibrary[API Development](/categories/api)

bigml/bigml-php
===============

API bindings for BigML

v4.2.0(3y ago)915.1k↓39.3%13[1 issues](https://github.com/bigmlcom/bigml-php/issues)Apache-2.0PHPPHP &gt;=8.0CI failing

Since Dec 7Pushed 3y ago9 watchersCompare

[ Source](https://github.com/bigmlcom/bigml-php)[ Packagist](https://packagist.org/packages/bigml/bigml-php)[ RSS](/packages/bigml-bigml-php/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (13)Used By (0)

BigML PHP Bindings
==================

[](#bigml-php-bindings)

In this repository you'll find an open source PHP library that gives you a simple way to interact with [BigML](https://bigml.com) using its [API](https://bigml.io).

This module is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).\*\*

**Notice: the BigML PHP bindings are not entirely backwards compatible with versions prior to 2.0. In particular, all static methods have been removed from the BigML class. So, if you ever used the syntaxis, e.g.:**

```
BigML::create_source(...);
```

**you will get an error. On the other hand, if you followed the syntaxis which was documented in this README, i.e.,**

```
$api->create_source(...)
```

**you will be fine.**

**Additionally, notice that the old constructor which accepted all of its parameters as individual arguments has been deprecated in favour of a new one supporting the specification of named parameters. Use the new syntaxis instead, as described below. The old constructor syntaxis will be maintained until version 3.0, then removed.**

Table of Contents

- [Requirements](#requirements)
- [Importing the module](#importing-the-module)
    - [Using Composer](#using-composer)
    - [Cloning from GitHub](#cloning-from-github)
- [Authentication](#authentication)
- [Caching](#caching)
- [Virtual Private Clouds](#virtual-private-clouds)
- [Projects and Organizations](#projects-and-organizations)
- [Quick Start](#quick-start)
- [Dataset](#dataset)
- [Model](#model)
- [Evaluation](#evaluation)
- [Cluster](#cluster)
- [Anomaly detector](#anomaly-detector)
- [Samples](#samples)
- [Correlations](#correlations)
- [Statistical Tests](#statistical-tests)
- [Logistic Regressions](#logistic-regressions)
- [Associations](#associations)
- [Topic Models](#topic-models)
- [Whizzml Resources](#whizzml-resources)
- [Scripts](#scripts)
- [Executions](#executions)
- [Libraries](#libraries)
- [Statuses](#statuses)
- [Projects](#projects)
- [Creating sources](#creating-sources)
- [Creating datasets](#creating-datasets)
- [Creating models](#creating-models)
- [Creating clusters](#creating-clusters)
- [Creating anomaly detectors](#creating-anomaly-detectors)
- [Creating associations](#creating-associations)
- [Creating topic models](#creating-topic-models)
- [Creating predictions](#creating-predictions)
- [Creating centroids](#creating-centroids)
- [Creating anomaly scores](#creating-anomaly-scores)
- [Creating association sets](#creating-association-sets)
- [Creating evaluations](#creating-evaluations)
- [Creating ensembles](#creating-ensembles)
- [Creating logistic regressions](#creating-logistic-regressions)
- [Creating deepnets](#creating-deepnets)
- [Creating batch predictions](#creating-batch-predictions)
- [Creating batch centroids](#creating-batch-centroids)
- [Creating batch anomaly scores](#creating-batch-anomaly-scores)
- [Listing Resources](#listing-resources)
- [Filtering Resources](#filtering-resources)
- [Ordering Resources](#ordering-resources)
- [Updating Resources](#updating-resources)
- [Deleting Resources](#deleting-resources)
- [Local Models](#local-models)
- [Local Predictions](#local-predictions)
- [Local Clusters](#local-clusters)
- [Local Centroids](#local-centroids)
- [Local Anomaly Detector](#local-anomaly-detector)
- [Local Anomaly Scores](#local-anomaly-scores)
- [Local Deepnet](#local-deepnet)
- [Local Deepnet Predictions](#local-deepnet-predictions)
- [Local Topic Model](#local-topic-model)
- [Multi Models](#multi-models)
- [Local Ensembles](#local-ensembles)
- [Rule Generation](#rule-generation)
- [Testing](#testing)

[Requirements](#id6)
--------------------

[](#requirements)

PHP 8.0 or higher is currently supported by these bindings.

You will also need to have the non-default extensions [mbstring](http://php.net/manual/en/book.mbstring.php), [cURL](http://php.net/manual/en/book.curl.php), and [OpenSSL](http://php.net/manual/en/book.openssl.php) installed. Depending on how you installed PHP, you may already have one or more of these extensions.

To check which modules you have currently installed, run

```
php -m
```

To install with Linux:

At the command line, run

```
sudo apt-get install phpXY-mbstring
sudo apt-get install phpXY-curl
```

where XY is the PHP version currently installed on your system (e.g., php72-curl).

To install with MacOS:

At the command line, run

```
sudo port install phpXY-mbstring
sudo port install phpXY-curl
sudo port install phpXY-openssl
```

where XY is the PHP version currently installed on your system (e.g., php72-curl).

If you installed PHP by tapping homebrew-php, mbstring should already be installed. You will still need to install curl and openssl using

```
brew install --with-openssl curl
```

To install with Windows:

If you have access to the php.ini, remove the semicolon in front of these lines in the php.ini

```
extension = php_mbstring.dll
extension = php_curl.dll
extension = php_openssl.dll
```

You will have to be sure you have these dll files, and they are available on your PATH. You may also need to check that libeay32.dll and ssleay32.dll are in your php directory.

Once you have made the changes, don't forget to restart your server for them to take effect.

[Importing the module](#id7)
----------------------------

[](#importing-the-module)

### [Using Composer](#id8)

[](#using-composer)

If you are currently using Composer to manage your project's libraries, simply add the following to your current composer.json

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/bigmlcom/bigml-php/"
        }
    ],
    "require": {
        "bigml/bigml-php": "dev-master",
        "wamania/php-stemmer": "@dev"
    },
    "autoload":{
        "classmap": ["vendor/bigml/bigml-php/bigml/"]
    }
}
```

At the command line, run the command

```
php composer.phar install
```

This will install this library and all required library dependencies (but not extensions such as mbstring).

In your code:

At the beginning of your file include the line

```
