PHP code example of necromant2005 / bigml-php-sdk

1. Go to this page and download the library: Download necromant2005/bigml-php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

necromant2005 / bigml-php-sdk example snippets


use BigMl\Client\BigMl;

$source = BigMl::factory('source', array(
    'username' => 'alfred',
    'api_key'  => '79138a622755a2383660347f895444b1eb927730',
));

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array(
    'username' => 'alfred',
    'api_key'  => '79138a622755a2383660347f895444b1eb927730',
    'access_point' => 'https://bigml.io/dev/',
    'version' => 'andromeda',
));

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array(
    'username' => 'alfred',
    'api_key'  => '79138a622755a2383660347f895444b1eb927730',
    'access_point' => 'https://bigml.io/dev/',
    'access_point_prediction' => 'https://prediction.dev.bigml.io/',
    'version' => 'andromeda',
));

use BigMl\Client\BigMl;

BigMl::factory('source', array( ... )); // source
BigMl::factory('dataset', array( ... )); // dataset
BigMl::factory('model', array( ... )); // model
BigMl::factory('prediction', array( ... )); // prediction
BigMl::factory('evaluation', array( ... )); // evaluation

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->create(array('data' => array(
    'a', 'b', 'c',
    1, 2, 3,
    4, 5, 7
)));

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->create(array('remote' => 's3://bigml-public/csv/iris.csv'));

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->retrieve('source/4f510d2003ce895676000069');

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->wait('source/4f510d2003ce895676000069', 10);

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->retrieve('source', array(
    'name' => 'iris'
));

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->update('source/4f510d2003ce895676000069', array(
    'name' => 'iris-new'
));

use BigMl\Client\BigMl;

$source = BigMl::factory('source', array( ... ));
$source->delete('source/4f510d2003ce895676000069');

use BigMl\Client\BigMl;

$service = BigMl::factory('prediction', array( ... ));
$service->create(array(
    'model' => 'model/57510d2003ce895676000069',
    'input_data' => array(
        '000000' => 'value1',
        '000001' => 'valu2',
    ),
    'name' => 'my-prediction',
));
json
""necromant2005/bigml-php-sdk": "1.*",
}
bash
$ php composer.phar update