{"id":27431021,"url":"https://github.com/bigmlcom/bigml-php","last_synced_at":"2025-04-14T15:28:20.497Z","repository":{"id":47713789,"uuid":"20999328","full_name":"bigmlcom/bigml-php","owner":"bigmlcom","description":"BigML.io Php Bindings","archived":false,"fork":false,"pushed_at":"2023-06-09T08:25:34.000Z","size":1698,"stargazers_count":9,"open_issues_count":1,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-08T20:47:16.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigmlcom.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-19T12:23:25.000Z","updated_at":"2023-06-07T16:10:32.000Z","dependencies_parsed_at":"2022-08-23T06:40:21.519Z","dependency_job_id":null,"html_url":"https://github.com/bigmlcom/bigml-php","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmlcom%2Fbigml-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmlcom%2Fbigml-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmlcom%2Fbigml-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmlcom%2Fbigml-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigmlcom","download_url":"https://codeload.github.com/bigmlcom/bigml-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248905886,"owners_count":21181069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-14T15:28:19.467Z","updated_at":"2025-04-14T15:28:20.473Z","avatar_url":"https://github.com/bigmlcom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"BigML PHP Bindings\n==================\n\nIn this repository you'll find an open source PHP library that gives\nyou a simple way to interact with `BigML \u003chttps://bigml.com\u003e`_ using its\n`API \u003chttps://bigml.io\u003e`_.\n\nThis module is licensed under the `Apache License, Version\n2.0 \u003chttp://www.apache.org/licenses/LICENSE-2.0.html\u003e`_.**\n\n**Notice: the BigML PHP bindings are not entirely backwards compatible\nwith versions prior to 2.0. In particular, all static methods have been\nremoved from the BigML class. So, if you ever used the syntaxis, e.g.:**\n\n.. code-block:: php\n\n    BigML::create_source(...);\n\n**you will get an error. On the other hand, if you followed the syntaxis\nwhich was documented in this README, i.e.,**\n\n.. code-block:: php\n\n    $api-\u003ecreate_source(...)\n\n**you will be fine.**\n\n**Additionally, notice that the old constructor which accepted all of\nits parameters as individual arguments has been deprecated in favour\nof a new one supporting the specification of named parameters. Use the\nnew syntaxis instead, as described below. The old constructor syntaxis\nwill be maintained until version 3.0, then removed.**\n\n.. contents:: Table of Contents\n\nRequirements\n------------\n\nPHP 8.0 or higher is currently supported by these bindings.\n\nYou will also need to have the non-default extensions `mbstring\n\u003chttp://php.net/manual/en/book.mbstring.php\u003e`_, `cURL\n\u003chttp://php.net/manual/en/book.curl.php\u003e`_, and `OpenSSL\n\u003chttp://php.net/manual/en/book.openssl.php\u003e`_ installed. Depending on\nhow you installed PHP, you may already have one or more of these\nextensions.\n\nTo check which modules you have currently installed, run\n\n.. code-block:: bash\n\n  php -m\n\nTo install with Linux:\n\nAt the command line, run\n\n.. code-block:: bash\n\n  sudo apt-get install phpXY-mbstring\n  sudo apt-get install phpXY-curl\n\nwhere XY is the PHP version currently installed on your system (e.g.,\nphp72-curl).\n\nTo install with MacOS:\n\nAt the command line, run\n\n.. code-block:: bash\n\n  sudo port install phpXY-mbstring\n  sudo port install phpXY-curl\n  sudo port install phpXY-openssl\n\nwhere XY is the PHP version currently installed on your system (e.g.,\nphp72-curl).\n\nIf you installed PHP by tapping homebrew-php, mbstring should already\nbe installed. You will still need to install curl and openssl using\n\n.. code-block:: bash\n\n  brew install --with-openssl curl\n\nTo install with Windows:\n\nIf you have access to the php.ini, remove the semicolon in front of\nthese lines in the php.ini\n\n.. code-block:: bash\n\n  extension = php_mbstring.dll\n  extension = php_curl.dll\n  extension = php_openssl.dll\n\nYou will have to be sure you have these dll files, and they are\navailable on your PATH. You may also need to check that `libeay32.dll`\nand `ssleay32.dll` are in your php directory.\n\nOnce you have made the changes, don't forget to restart your server\nfor them to take effect.\n\nImporting the module\n--------------------\n\nUsing Composer\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nIf you are currently using Composer to manage your project's\nlibraries, simply add the following to your current `composer.json`\n\n.. code-block:: json\n\n    {\n        \"repositories\": [\n            {\n                \"type\": \"vcs\",\n                \"url\": \"https://github.com/bigmlcom/bigml-php/\"\n            }\n        ],\n        \"require\": {\n            \"bigml/bigml-php\": \"dev-master\",\n            \"wamania/php-stemmer\": \"@dev\"\n        },\n        \"autoload\":{\n            \"classmap\": [\"vendor/bigml/bigml-php/bigml/\"]\n        }\n    }\n\nAt the command line, run the command\n\n.. code-block:: bash\n\n    php composer.phar install\n\nThis will install this library and all required library dependencies\n(but not extensions such as mbstring).\n\nIn your code:\n\nAt the beginning of your file include the line\n\n.. code-block:: php\n\n    \u003c? php\n    require 'vendor/autoload.php';\n\nCloning from GitHub\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nIf you would prefer, you can manually clone this repo from GitHub. You\nwill still need to use Composer to install some third-party libraries.\n\nIf you haven't already done so, you will need to install `Composer\n\u003chttps://getcomposer.org/\u003e`_.\n\nLinux/OSX:\n\nFollow the instructions in the `download section \u003chttps://getcomposer.org/download/\u003e`_ to get the\n`composer.phar` file, and run\n\n.. code-block:: bash\n\n  php composer.phar install\n\nThis will install all necessary dependencies.\n\nWindows:\n\nFollow the instructions on the Composer website for `downloading \u003chttps://getcomposer.org/doc/00-intro.md#installation-windows\u003e`_ Composer, and run\n\n.. code-block:: bash\n\n  php composer.phar install\n\nThis will install all necessary dependencies.\n\nIn your code:\n\nAt the beginning of your file you will need to include the various\nfiles you will be using. If you will be making any remote calls, you\nwill need bigml.php. If you will be making any local models, you will\nneed their specific files. The most common files to include are\n\n\n.. code-block:: php\n\n  \u003c?php\n  include('bigml.php');\n  include('anomaly.php');\n  include('association.php');\n  include('boostedensemble.php');\n  include('cluster.php');\n  include('ensemble.php');\n  include('logistic.php');\n  include('model.php');\n  include('prediction.php');\n  include('topicmodel.php');\n\nAuthentication\n--------------\n\nAll the requests to BigML.io must be authenticated using your username\nand `API key \u003chttps://bigml.com/account/apikey\u003e`_. and are always\ntransmitted over HTTPS.\n\nThis module will look for your username and API key in the environment\nvariables BIGML_USERNAME and BIGML_API_KEY respectively.  You can add\nthe following lines to your .bashrc or .bash_profile to set those\nvariables automatically when you log in\n\n\n.. code-block:: bash\n\n    export BIGML_USERNAME=myusername\n    export BIGML_API_KEY=a11e579e7e53fb9abd646a6ff8aa99d4afe83ac2\n\nWith that environment and your aliases set up, connecting to BigML is\na breeze\n\n.. code-block:: php\n\n   $api = new BigML\\BigML();\n\nOtherwise, you can initialize directly when instantiating the BigML\nclass as follows by manually supplying your credentials:\n\n.. code-block:: php\n\n   $api = new BigML\\BigML([ \"username\" =\u003e \"myusername\",\n                            \"apiKey\" =\u003e \"my_api_key\"]);\n\nCaching\n-------\n\nAn important feature provided by the api constructor is the\nspecification of a local cache to speed up the retrieval of\nresources. If you supply a storage for your BigML instance, the PHP\nbindings will hit the network only once for each resource. On\nsubsequent accesses, the resource will be retrieved from the local\ncache.\n\nThis is how you can set the storage argument when you instantiate the\nBigML class:\n\n.. code-block:: php\n\n   $api = new BigML\\BigML([ \"username\" =\u003e \"myusername\",\n                            \"apiKey\" =\u003e \"my_api_key\",\n                            \"storage\" =\u003e \"storage/data\"]);\n\nOr, more succinctly:\n\n.. code-block:: php\n\n   $api = new BigML\\BigML([\"storage\" =\u003e \"storage/data\"]);\n\nif you have your environment set.\n\nAll resources will be created, updated, or retrieved in/from the chosen directory.\n\nVirtual Private Clouds\n----------------------\n\nFor Virtual Private Cloud setups, you can change the remote server domain:\n\n.. code-block:: php\n\n   $api = new BigML\\BigML([ \"username\" =\u003e \"myusername\",\n                            \"apiKey\" =\u003e \"my_api_key\",\n                            \"domain\" =\u003e \"my_VPC.bigml.io\",\n                            \"storage\" =\u003e \"storage/data\"]);\n\nNOTICE: BigML API used to provide a sandbox mode, also know as\ndevelopment mode. This has been deprecated and is not supported in the\nPHP binding anymore. To guarantee backward-compatibility, the BigML\nclass constructor still supports the specification of a ``dev_mode``\nargument, but it is now ignored.\n\n\nProjects and Organizations\n--------------------------\n\nWhen you instantiate the BigML class you can specify a project or\norganization that the instance shall default to:\n\n.. code-block:: php\n\n   $api = new BigML\\BigML([\"username\" =\u003e \"myusername\",\n                            \"apiKey\" =\u003e \"my_api_key\",\n                            \"project\" =\u003e $projectID]);\n\n   $api = new BigML\\BigML([\"username\" =\u003e \"myusername\",\n                            \"apiKey\" =\u003e \"my_api_key\",\n                            \"organization\" =\u003e $organization]);\n\n\nWhen $project is set to a project ID and that project exists for an\norganization, the user is considered to be working in an organization\nproject. The scope of the API requests will be limited to this project\nand permissions should be previously given by the organization\nadministrator.\n\nIf the specified project does not belong to an organization but is a\nproject of the user's, then the scope of all API requests will be\nlimited to that project.\n\nWhen $organization is set to an organization ID, the user is considered\nto be working for an organization. The scope of the API requests will\nbe limited to the projects of the organization and permissions need to\nbe previously given by the organization administrator.\n\n\nQuick Start\n-----------\n\nImagine that you want to use `this csv\nfile \u003chttps://static.bigml.com/csv/iris.csv\u003e`_ containing the `Iris\nflower dataset \u003chttp://en.wikipedia.org/wiki/Iris_flower_data_set\u003e`_ to\npredict the species of a flower whose ``sepal length`` is ``5`` and\nwhose ``sepal width`` is ``2.5``. A preview of the dataset is shown\nbelow. It has 4 numeric fields: ``sepal length``, ``sepal width``,\n``petal length``, ``petal width`` and a categorical field: ``species``.\nBy default, BigML considers the last field in the dataset as the\nobjective field (i.e., the field that you want to generate predictions\nfor).\n\n.. code-block:: php\n\n    sepal length,sepal width,petal length,petal width,species\n    5.1,3.5,1.4,0.2,Iris-setosa\n    4.9,3.0,1.4,0.2,Iris-setosa\n    4.7,3.2,1.3,0.2,Iris-setosa\n    ...\n    5.8,2.7,3.9,1.2,Iris-versicolor\n    6.0,2.7,5.1,1.6,Iris-versicolor\n    5.4,3.0,4.5,1.5,Iris-versicolor\n    ...\n    6.8,3.0,5.5,2.1,Iris-virginica\n    5.7,2.5,5.0,2.0,Iris-virginica\n    5.8,2.8,5.1,2.4,Iris-virginica\n\nIf your credentials are stored in the environment as mentioned above,\nyou can easily generate a prediction following these steps\n\n.. code-block:: php\n\n    $api = new BigML\\BigML();\n\n    $source = $api-\u003ecreate_source('./tests/data/iris.csv');\n    $dataset = $api-\u003ecreate_dataset($source);\n    $model = $api-\u003ecreate_model($dataset);\n    $prediction = $api-\u003ecreate_prediction($model, array('sepal length'=\u003e 5, 'sepal width'=\u003e 2.5));\n\nthen:\n\n.. code-block:: php\n\n    $objective_field_name = $prediction-\u003eobject-\u003efields-\u003e{$prediction-\u003eobject-\u003eobjective_fields[0]}-\u003ename;\n\n    \"petal width\"\n\n    $value = $prediction-\u003eobject-\u003eprediction-\u003e{$prediction-\u003eobject-\u003eobjective_fields[0]};\n\n    0.30455\n\n    $api-\u003epprint($prediction);\n\n    petal width for {\"sepal length\":5,\"sepal width\":2.5} is 0.30455\n\nalso, you can generate an evaluation for the model by using\n\n.. code-block:: php\n\n    $test_source = $api-\u003ecreate_source('./tests/data/iris.csv');\n    $test_dataset = $api-\u003ecreate_dataset($test_source);\n    $evaluation = $api-\u003ecreate_evaluation($model, $test_dataset);\n\n\nDataset\n-------\n\nIf you want to get some basic statistics for each field you can retrieve\nthe fields from the dataset as follows to get a dictionary keyed by field id\n\n.. code-block:: php\n\n    $dataset = $api-\u003eget_dataset($dataset);\n    print_r($api-\u003eget_fields($dataset))\n\nThe field filtering options are also available using a query string expression, for instance\n\n.. code-block:: php\n\n    $dataset = $api-\u003eget_dataset($dataset, \"limit=20\")\n\nlimits the number of fields that will be included in dataset to 20.\n\nModel\n-----\n\nOne of the greatest things about BigML is that the models that it generates for you are fully white-boxed.\nTo get the explicit tree-like predictive model for the example above\n\n.. code-block:: php\n\n    $model = $api-\u003eget_model($model_id);\n\n    print_r($model-\u003eobject-\u003emodel-\u003eroot);\n\n    stdClass Object\n    (\n    [children] =\u003e Array\n        (\n            [0] =\u003e stdClass Object\n                (\n                    [children] =\u003e Array\n                        (\n                            [0] =\u003e stdClass Object...\n\nAgain, filtering options are also available using a query string expression, for instance\n\n.. code-block:: php\n\n    $model = $api-\u003eget_model($model_id, \"limit=5\");\n\nlimits the number of fields that will be included in model to 5.\n\n\nEvaluation\n----------\n\nThe predictive performance of a model can be measured using many different measures.\nIn BigML these measures can be obtained by creating evaluations.\nTo create an evaluation you need the id of the model you are evaluating and the id of\nthe dataset that contains the data to be tested with. The result is shown as\n\n.. code-block:: php\n\n    $evaluation = $api-\u003eget_evaluation($evaluation_id);\n\nCluster\n-------\n\nFor unsupervised learning problems, the cluster is used to classify in a limited number of groups your training data.\nThe cluster structure is defined by the centers of each group of data, named centroids, and the data enclosed in the group.\nAs for in the model’s case, the cluster is a white-box resource and can be retrieved as a JSON\n\n.. code-block:: php\n\n    $cluster = $api-\u003eget_cluster($cluster_id)\n\nAnomaly detector\n----------------\n\nFor anomaly detection problems, BigML anomaly detector uses iforest as an unsupervised kind of model that detects anomalous data in a dataset. The information it returns encloses a top_anomalies block that contains a list of the most anomalous points. For each, we capture a score from 0 to 1. The closer to 1, the more anomalous. We also capture the row which gives values for each field in the order defined by input_fields. Similarly we give a list of importances which match the row values. These importances tell us which values contributed most to the anomaly score. Thus, the structure of an anomaly detector is similar to\n\n.. code-block:: json\n\n    {\"category\": 0,\n    \"code\": 200,\n    \"columns\": 14,\n    \"constraints\": false,\n    \"created\": \"2014-09-08T18:51:11.893000\",\n    \"credits\": 0.11653518676757812,\n    \"credits_per_prediction\": 0.0,\n    \"dataset\": \"dataset/540dfa9d9841fa5c88000765\",\n    \"dataset_field_types\": {   \"categorical\": 21,\n                               \"datetime\": 0,\n                               \"numeric\": 21,\n                               \"preferred\": 14,\n                               \"text\": 0,\n                               \"total\": 42},\n    \"dataset_status\": true,\n    \"dataset_type\": 0,\n    \"description\": \"\",\n    \"excluded_fields\": [],\n    \"fields_meta\": {   \"count\": 14,\n                       \"limit\": 1000,\n                       \"offset\": 0,\n                       \"query_total\": 14,\n                       \"total\": 14},\n    \"forest_size\": 128,\n    \"input_fields\": [   \"000004\",\n                        \"000005\",\n                        \"000009\",\n                        \"000016\",\n                        \"000017\",\n                        \"000018\",\n                        \"000019\",\n                        \"00001e\",\n                        \"00001f\",\n                        \"000020\",\n                        \"000023\",\n                        \"000024\",\n                        \"000025\",\n                        \"000026\"],\n    \"locale\": \"en_US\",\n    \"max_columns\": 42,\n    \"max_rows\": 200,\n    \"model\": {   \"fields\": {   \"000004\": {   \"column_number\": 4,\n                                             \"datatype\": \"int16\",\n                                             \"name\": \"src_bytes\",\n                                             \"optype\": \"numeric\",\n                                             \"order\": 0,\n                                             \"preferred\": true,\n                                             \"summary\": {   \"bins\": [   [   143,\n                                                                            2],\n                                                                        ...\n                                                                        [   370,\n                                                                            2]],\n                                                            \"maximum\": 370,\n                                                            \"mean\": 248.235,\n                                                            \"median\": 234.57157,\n                                                            \"minimum\": 141,\n                                                            \"missing_count\": 0,\n                                                            \"population\": 200,\n                                                            \"splits\": [   159.92462,\n                                                                          173.73312,\n                                                                          188,\n                                                                          ...\n                                                                          339.55228],\n                                                            \"standard_deviation\": 49.39869,\n                                                            \"sum\": 49647,\n                                                            \"sum_squares\": 12809729,\n                                                            \"variance\": 2440.23093}},\n                               \"000005\": {   \"column_number\": 5,\n                                             \"datatype\": \"int32\",\n                                             \"name\": \"dst_bytes\",\n                                             \"optype\": \"numeric\",\n                                             \"order\": 1,\n                                             \"preferred\": true,\n                                              ...\n                                                            \"sum\": 1030851,\n                                                            \"sum_squares\": 22764504759,\n                                                            \"variance\": 87694652.45224}},\n                               \"000009\": {   \"column_number\": 9,\n                                             \"datatype\": \"string\",\n                                             \"name\": \"hot\",\n                                             \"optype\": \"categorical\",\n                                             \"order\": 2,\n                                             \"preferred\": true,\n                                             \"summary\": {   \"categories\": [   [   \"0\",\n                                                                                  199],\n                                                                              [   \"1\",\n                                                                                  1]],\n                                                            \"missing_count\": 0},\n                                             \"term_analysis\": {   \"enabled\": true}},\n                               \"000016\": {   \"column_number\": 22,\n                                             \"datatype\": \"int8\",\n                                             \"name\": \"count\",\n                                             \"optype\": \"numeric\",\n                                             \"order\": 3,\n                                             \"preferred\": true,\n                                                            ...\n                                                            \"population\": 200,\n                                                            \"standard_deviation\": 5.42421,\n                                                            \"sum\": 1351,\n                                                            \"sum_squares\": 14981,\n                                                            \"variance\": 29.42209}},\n                               \"000017\": { ... }}},\n                 \"kind\": \"iforest\",\n                 \"mean_depth\": 12.314174107142858,\n                 \"top_anomalies\": [   {   \"importance\": [   0.06768,\n                                                            0.01667,\n                                                            0.00081,\n                                                            0.02437,\n                                                            0.04773,\n                                                            0.22197,\n                                                            0.18208,\n                                                            0.01868,\n                                                            0.11855,\n                                                            0.01983,\n                                                            0.01898,\n                                                            0.05306,\n                                                            0.20398,\n                                                            0.00562],\n                                          \"row\": [   183.0,\n                                                     8654.0,\n                                                     \"0\",\n                                                     4.0,\n                                                     4.0,\n                                                     0.25,\n                                                     0.25,\n                                                     0.0,\n                                                     123.0,\n                                                     255.0,\n                                                     0.01,\n                                                     0.04,\n                                                     0.01,\n                                                     0.0],\n                                          \"score\": 0.68782},\n                                      {   \"importance\": [   0.05645,\n                                                            0.02285,\n                                                            0.0015,\n                                                            0.05196,\n                                                            0.04435,\n                                                            0.0005,\n                                                            0.00056,\n                                                            0.18979,\n                                                            0.12402,\n                                                            0.23671,\n                                                            0.20723,\n                                                            0.05651,\n                                                            0.00144,\n                                                            0.00612],\n                                          \"row\": [   212.0,\n                                                     1940.0,\n                                                     \"0\",\n                                                     1.0,\n                                                     2.0,\n                                                     0.0,\n                                                     0.0,\n                                                     1.0,\n                                                     1.0,\n                                                     69.0,\n                                                     1.0,\n                                                     0.04,\n                                                     0.0,\n                                                     0.0],\n                                          \"score\": 0.6239},\n                                          ...],\n                 \"trees\": [   {   \"root\": {   \"children\": [   {   \"children\": [   {   \"children\": [   {   \"children\": [   {   \"children\":[   {   \"population\": 1,\n                                                                                                                              \"predicates\": [   {   \"field\": \"00001f\",\n                                                                                                                                                    \"op\": \"\u003e\",\n                                                                                                                                                    \"value\": 35.54357}]},\n\n                                                                                                                          {   \"population\": 1,\n                                                                                                                              \"predicates\": [   {   \"field\": \"00001f\",\n                                                                                                                                                    \"op\": \"\u003c=\",\n                                                                                                                                                    \"value\": 35.54357}]}],\n                                                                                                          \"population\": 2,\n                                                                                                          \"predicates\": [   {   \"field\": \"000005\",\n                                                                                                                                \"op\": \"\u003c=\",\n                                                                                                                                \"value\": 1385.5166}]}],\n                                                                                      \"population\": 3,\n                                                                                      \"predicates\": [   {   \"field\": \"000020\",\n                                                                                                            \"op\": \"\u003c=\",\n                                                                                                            \"value\": 65.14308},\n                                                                                                        {   \"field\": \"000019\",\n                                                                                                            \"op\": \"=\",\n                                                                                                            \"value\": 0}]}],\n                                                                  \"population\": 105,\n                                                                  \"predicates\": [   {   \"field\": \"000017\",\n                                                                                        \"op\": \"\u003c=\",\n                                                                                        \"value\": 13.21754},\n                                                                                    {   \"field\": \"000009\",\n                                                                                        \"op\": \"in\",\n                                                                                        \"value\": [   \"0\"]}]}],\n                                              \"population\": 126,\n                                              \"predicates\": [   true,\n                                                                {   \"field\": \"000018\",\n                                                                    \"op\": \"=\",\n                                                                    \"value\": 0}]},\n                                  \"training_mean_depth\": 11.071428571428571}]},\n    \"name\": \"tiny_kdd's dataset anomaly detector\",\n    \"number_of_batchscores\": 0,\n    \"number_of_public_predictions\": 0,\n    \"number_of_scores\": 0,\n    \"out_of_bag\": false,\n    \"price\": 0.0,\n    \"private\": true,\n    \"project\": null,\n    \"range\": [1, 200],\n    \"replacement\": false,\n    \"resource\": \"anomaly/540dfa9f9841fa5c8800076a\",\n    \"rows\": 200,\n    \"sample_rate\": 1.0,\n    \"sample_size\": 126,\n    \"seed\": \"BigML\",\n    \"shared\": false,\n    \"size\": 30549,\n    \"source\": \"source/540dfa979841fa5c7f000363\",\n    \"source_status\": true,\n    \"status\": {   \"code\": 5,\n                  \"elapsed\": 32397,\n                  \"message\": \"The anomaly detector has been created\",\n                  \"progress\": 1.0},\n    \"subscription\": false,\n    \"tags\": [],\n    \"updated\": \"2014-09-08T23:54:28.647000\",\n    \"white_box\": false}\n\n\n\nSamples\n-------\n\nTo provide quick access to your row data you can create a ``sample``. Samples\nare in-memory objects that can be queried for subsets of data by limiting\ntheir size, the fields or the rows returned. The structure of a sample would\nbe::\n\nSamples are not permanent objects. Once they are created, they will be\navailable as long as GETs are requested within periods smaller than\na pre-established TTL (Time to Live). The expiration timer of a sample is\nreset every time a new GET is received.\n\nIf requested, a sample can also perform linear regression and compute\nPearson's and Spearman's correlations for either one numeric field\nagainst all other numeric fields or between two specific numeric fields.\n\nCorrelations\n------------\n\nA ``correlation`` resource contains a series of computations that reflect the\ndegree of dependence between the field set as objective for your predictions\nand the rest of fields in your dataset. The dependence degree is obtained by\ncomparing the distributions in every objective and non-objective field pair,\nas independent fields should have probabilistic\nindependent distributions. Depending on the types of the fields to compare,\nthe metrics used to compute the correlation degree will be:\n\n- for numeric to numeric pairs:\n  `Pearson's \u003chttps://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient\u003e`_\n  and `Spearman's correlation \u003chttps://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient\u003e`_\n  coefficients.\n- for numeric to categorical pairs:\n  `One-way Analysis of Variance \u003chttps://en.wikipedia.org/wiki/One-way_analysis_of_variance\u003e`_, with the\n  categorical field as the predictor variable.\n- for categorical to categorical pairs:\n  `contingency table (or two-way table) \u003chttps://en.wikipedia.org/wiki/Contingency_table\u003e`_,\n  `Chi-square test of independence \u003chttps://en.wikipedia.org/wiki/Pearson%27s_chi-squared_test\u003e`_\n  , and `Cramer's V \u003chttps://en.wikipedia.org/wiki/Cram%C3%A9r%27s_V\u003e`_\n  and `Tschuprow's T \u003chttps://en.wikipedia.org/wiki/Tschuprow%27s_T\u003e`_ coefficients.\n\nAn example of the correlation resource JSON structure is\n\n.. code-block:: json\n\n    {\"category\": 0,\n    \"clones\": 0,\n    \"code\": 200,\n    \"columns\": 5,\n    \"correlations\": {   \"correlations\": [   {   \"name\": \"one_way_anova\",\n                                                  \"result\": {   \"000000\": {   \"eta_square\": 0.61871,\n                                                                                \"f_ratio\": 119.2645,\n                                                                                \"p_value\": 0,\n                                                                                \"significant\": [   true,\n                                                                                                    true,\n                                                                                                    true]},\n                                                                 \"000001\": {   \"eta_square\": 0.40078,\n                                                                                \"f_ratio\": 49.16004,\n                                                                                \"p_value\": 0,\n                                                                                \"significant\": [   true,\n                                                                                                    true,\n                                                                                                    true]},\n                                                                 \"000002\": {   \"eta_square\": 0.94137,\n                                                                                \"f_ratio\": 1180.16118,\n                                                                                \"p_value\": 0,\n                                                                                \"significant\": [   true,\n                                                                                                    true,\n                                                                                                    true]},\n                                                                 \"000003\": {   \"eta_square\": 0.92888,\n                                                                                \"f_ratio\": 960.00715,\n                                                                                \"p_value\": 0,\n                                                                                \"significant\": [   true,\n                                                                                                    true,\n                                                                                                    true]}}}],\n                         \"fields\": {   \"000000\": {   \"column_number\": 0,\n                                                       \"datatype\": \"double\",\n                                                       \"idx\": 0,\n                                                       \"name\": \"sepal length\",\n                                                       \"optype\": \"numeric\",\n                                                       \"order\": 0,\n                                                       \"preferred\": true,\n                                                       \"summary\": {   \"bins\": [   [   4.3,\n                                                                                        1],\n                                                                                    [   4.425,\n                                                                                        4],\n                                                                                      ...\n                                                                                    [   7.9,\n                                                                                        1]],\n                                                                       \"kurtosis\": -0.57357,\n                                                                       \"maximum\": 7.9,\n                                                                       \"mean\": 5.84333,\n                                                                       \"median\": 5.8,\n                                                                       \"minimum\": 4.3,\n                                                                       \"missing_count\": 0,\n                                                                       \"population\": 150,\n                                                                       \"skewness\": 0.31175,\n                                                                       \"splits\": [   4.51526,\n                                                                                      4.67252,\n                                                                                      4.81113,\n                                                                                      4.89582,\n                                                                                      4.96139,\n                                                                                      5.01131,\n                                                                                      ...\n                                                                                      6.92597,\n                                                                                      7.20423,\n                                                                                      7.64746],\n                                                                       \"standard_deviation\": 0.82807,\n                                                                       \"sum\": 876.5,\n                                                                       \"sum_squares\": 5223.85,\n                                                                       \"variance\": 0.68569}},\n                                        \"000001\": {   \"column_number\": 1,\n                                                       \"datatype\": \"double\",\n                                                       \"idx\": 1,\n                                                       \"name\": \"sepal width\",\n                                                       \"optype\": \"numeric\",\n                                                       \"order\": 1,\n                                                       \"preferred\": true,\n                                                       \"summary\": {   \"counts\": [   [   2,\n                                                                                          1],\n                                                                                      [   2.2,\n                                                                                      ...\n                                                                   ]]}},\n                                        \"000004\": {   \"column_number\": 4,\n                                                       \"datatype\": \"string\",\n                                                       \"idx\": 4,\n                                                       \"name\": \"species\",\n                                                       \"optype\": \"categorical\",\n                                                       \"order\": 4,\n                                                       \"preferred\": true,\n                                                       \"summary\": {   \"categories\": [   [   \"Iris-setosa\",\n                                                                                              50],\n                                                                                          [   \"Iris-versicolor\",\n                                                                                              50],\n                                                                                          [   \"Iris-virginica\",\n                                                                                              50]],\n                                                                       \"missing_count\": 0},\n                                                       \"term_analysis\": {   \"enabled\": true}}},\n                         \"significance_levels\": [0.01, 0.05, 0.1]},\n    \"created\": \"2015-07-28T18:07:37.010000\",\n    \"credits\": 0.017581939697265625,\n    \"dataset\": \"dataset/55b7a6749841fa2500000d41\",\n    \"dataset_status\": true,\n    \"dataset_type\": 0,\n    \"description\": \"\",\n    \"excluded_fields\": [],\n    \"fields_meta\": {   \"count\": 5,\n                        \"limit\": 1000,\n                        \"offset\": 0,\n                        \"query_total\": 5,\n                        \"total\": 5},\n    \"input_fields\": [\"000000\", \"000001\", \"000002\", \"000003\"],\n    \"locale\": \"en_US\",\n    \"max_columns\": 5,\n    \"max_rows\": 150,\n    \"name\": \"iris' dataset correlation\",\n    \"objective_field_details\": {   \"column_number\": 4,\n                                    \"datatype\": \"string\",\n                                    \"name\": \"species\",\n                                    \"optype\": \"categorical\",\n                                    \"order\": 4},\n    \"out_of_bag\": false,\n    \"price\": 0.0,\n    \"private\": true,\n    \"project\": null,\n    \"range\": [1, 150],\n    \"replacement\": false,\n    \"resource\": \"correlation/55b7c4e99841fa24f20009bf\",\n    \"rows\": 150,\n    \"sample_rate\": 1.0,\n    \"shared\": false,\n    \"size\": 4609,\n    \"source\": \"source/55b7a6729841fa24f100036a\",\n    \"source_status\": true,\n    \"status\": {   \"code\": 5,\n                   \"elapsed\": 274,\n                   \"message\": \"The correlation has been created\",\n                   \"progress\": 1.0},\n    \"subscription\": true,\n    \"tags\": [],\n    \"updated\": \"2015-07-28T18:07:49.057000\",\n    \"white_box\": false}\n\n\nNote that the output in the snippet above has been abbreviated. As you see, the\n``correlations`` attribute contains the information about each field\ncorrelation to the objective field.\n\n\nStatistical Tests\n-----------------\n\nA ``statisticaltest`` resource contains a series of tests\nthat compare the\ndistribution of data in each numeric field of a dataset\nto certain canonical distributions,\nsuch as the\n`normal distribution \u003chttps://en.wikipedia.org/wiki/Normal_distribution\u003e`_\nor `Benford's law \u003chttps://en.wikipedia.org/wiki/Benford%27s_law\u003e`_\ndistribution. Statistical test are useful in tasks such as fraud, normality,\nor outlier detection.\n\n- Fraud Detection Tests:\nBenford: This statistical test performs a comparison of the distribution of\nfirst significant digits (FSDs) of each value of the field to the Benford's\nlaw distribution. Benford's law applies to numerical distributions spanning\nseveral orders of magnitude, such as the values found on financial balance\nsheets. It states that the frequency distribution of leading, or first\nsignificant digits (FSD) in such distributions is not uniform.\nOn the contrary, lower digits like 1 and 2 occur disproportionately\noften as leading significant digits. The test compares the distribution\nin the field to Bendford's distribution using a Chi-square goodness-of-fit\ntest, and Cho-Gaines d test. If a field has a dissimilar distribution,\nit may contain anomalous or fraudulent values.\n\n- Normality tests:\nThese tests can be used to confirm the assumption that the data in each field\nof a dataset is distributed according to a normal distribution. The results\nare relevant because many statistical and machine learning techniques rely on\nthis assumption.\nAnderson-Darling: The Anderson-Darling test computes a test statistic based on\nthe difference between the observed cumulative distribution function (CDF) to\nthat of a normal distribution. A significant result indicates that the\nassumption of normality is rejected.\nJarque-Bera: The Jarque-Bera test computes a test statistic based on the third\nand fourth central moments (skewness and kurtosis) of the data. Again, a\nsignificant result indicates that the normality assumption is rejected.\nZ-score: For a given sample size, the maximum deviation from the mean that\nwould expected in a sampling of a normal distribution can be computed based\non the 68-95-99.7 rule. This test simply reports this expected deviation and\nthe actual deviation observed in the data, as a sort of sanity check.\n\n- Outlier tests:\nGrubbs: When the values of a field are normally distributed, a few values may\nstill deviate from the mean distribution. The outlier tests reports whether\nat least one value in each numeric field differs significantly from the mean\nusing Grubb's test for outliers. If an outlier is found, then its value will\nbe returned.\n\nThe JSON structure for ``statisticaltest`` resources is similar to this one\n\n.. code-block:: json\n\n     {  \"category\": 0,\n        \"clones\": 0,\n        \"code\": 200,\n        \"columns\": 5,\n        \"created\": \"2015-07-28T18:16:40.582000\",\n        \"credits\": 0.017581939697265625,\n        \"dataset\": \"dataset/55b7a6749841fa2500000d41\",\n        \"dataset_status\": true,\n        \"dataset_type\": 0,\n        \"description\": \"\",\n        \"excluded_fields\": [],\n        \"fields_meta\": {   \"count\": 5,\n                            \"limit\": 1000,\n                            \"offset\": 0,\n                            \"query_total\": 5,\n                            \"total\": 5},\n        \"input_fields\": [\"000000\", \"000001\", \"000002\", \"000003\"],\n        \"locale\": \"en_US\",\n        \"max_columns\": 5,\n        \"max_rows\": 150,\n        \"name\": \"iris' dataset test\",\n        \"out_of_bag\": false,\n        \"price\": 0.0,\n        \"private\": true,\n        \"project\": null,\n        \"range\": [1, 150],\n        \"replacement\": false,\n        \"resource\": \"statisticaltest/55b7c7089841fa25000010ad\",\n        \"rows\": 150,\n        \"sample_rate\": 1.0,\n        \"shared\": false,\n        \"size\": 4609,\n        \"source\": \"source/55b7a6729841fa24f100036a\",\n        \"source_status\": true,\n        \"status\": {   \"code\": 5,\n                       \"elapsed\": 302,\n                       \"message\": \"The test has been created\",\n                       \"progress\": 1.0},\n        \"subscription\": true,\n        \"tags\": [],\n        \"statistical_tests\": {   \"ad_sample_size\": 1024,\n                      \"fields\": {   \"000000\": {   \"column_number\": 0,\n                                                    \"datatype\": \"double\",\n                                                    \"idx\": 0,\n                                                    \"name\": \"sepal length\",\n                                                    \"optype\": \"numeric\",\n                                                    \"order\": 0,\n                                                    \"preferred\": true,\n                                                    \"summary\": {   \"bins\": [   [   4.3,\n                                                                                     1],\n                                                                                 [   4.425,\n                                                                                     4],\n                                                                                 [   7.9,\n                                                                                     1]],\n                                                                    \"kurtosis\": -0.57357,\n                                                                    \"maximum\": 7.9,\n                                                                    \"mean\": 5.84333,\n                                                                    \"median\": 5.8,\n                                                                    \"minimum\": 4.3,\n                                                                    \"missing_count\": 0,\n                                                                    \"population\": 150,\n                                                                    \"skewness\": 0.31175,\n                                                                    \"splits\": [   4.51526,\n                                                                                   4.67252,\n                                                                                   4.81113,\n                                                                                   4.89582,\n                                                                                   ...\n                                                                                   7.20423,\n                                                                                   7.64746],\n                                                                    \"standard_deviation\": 0.82807,\n                                                                    \"sum\": 876.5,\n                                                                    \"sum_squares\": 5223.85,\n                                                                    \"variance\": 0.68569}},\n                                     ...\n                                     \"000004\": {   \"column_number\": 4,\n                                                    \"datatype\": \"string\",\n                                                    \"idx\": 4,\n                                                    \"name\": \"species\",\n                                                    \"optype\": \"categorical\",\n                                                    \"order\": 4,\n                                                    \"preferred\": true,\n                                                    \"summary\": {   \"categories\": [   [   \"Iris-setosa\",\n                                                                                           50],\n                                                                                       [   \"Iris-versicolor\",\n                                                                                           50],\n                                                                                       [   \"Iris-virginica\",\n                                                                                           50]],\n                                                                    \"missing_count\": 0},\n                                                    \"term_analysis\": {   \"enabled\": true}}},\n                      \"fraud\": [   {   \"name\": \"benford\",\n                                        \"result\": {   \"000000\": {   \"chi_square\": {   \"chi_square_value\": 506.39302,\n                                                                                         \"p_value\": 0,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"cho_gaines\": {   \"d_statistic\": 7.124311073683573,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"distribution\": [   0,\n                                                                                           0,\n                                                                                           0,\n                                                                                           22,\n                                                                                           61,\n                                                                                           54,\n                                                                                           13,\n                                                                                           0,\n                                                                                           0],\n                                                                      \"negatives\": 0,\n                                                                      \"zeros\": 0},\n                                                       \"000001\": {   \"chi_square\": {   \"chi_square_value\": 396.76556,\n                                                                                         \"p_value\": 0,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"cho_gaines\": {   \"d_statistic\": 7.503503138331123,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"distribution\": [   0,\n                                                                                           57,\n                                                                                           89,\n                                                                                           4,\n                                                                                           0,\n                                                                                           0,\n                                                                                           0,\n                                                                                           0,\n                                                                                           0],\n                                                                      \"negatives\": 0,\n                                                                      \"zeros\": 0},\n                                                       \"000002\": {   \"chi_square\": {   \"chi_square_value\": 154.20728,\n                                                                                         \"p_value\": 0,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"cho_gaines\": {   \"d_statistic\": 3.9229974017266054,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"distribution\": [   50,\n                                                                                           0,\n                                                                                           11,\n                                                                                           43,\n                                                                                           35,\n                                                                                           11,\n                                                                                           0,\n                                                                                           0,\n                                                                                           0],\n                                                                      \"negatives\": 0,\n                                                                      \"zeros\": 0},\n                                                       \"000003\": {   \"chi_square\": {   \"chi_square_value\": 111.4438,\n                                                                                         \"p_value\": 0,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"cho_gaines\": {   \"d_statistic\": 4.103257341299901,\n                                                                                         \"significant\": [   true,\n                                                                                                             true,\n                                                                                                             true]},\n                                                                      \"distribution\": [   76,\n                                                                                           58,\n                                                                                           7,\n                                                                                           7,\n                                                                                           1,\n                                                                                           1,\n                                                                                           0,\n                                                                                           0,\n                                                                                           0],\n                                                                      \"negatives\": 0,\n                                                                      \"zeros\": 0}}}],\n                      \"normality\": [   {   \"name\": \"anderson_darling\",\n                                            \"result\": {   \"000000\": {   \"p_value\": 0.02252,\n                                                                          \"significant\": [   false,\n                                                                                              true,\n                                                                                              true]},\n                                                           \"000001\": {   \"p_value\": 0.02023,\n                                                                          \"significant\": [   false,\n                                                                                              true,\n                                                                                              true]},\n                                                           \"000002\": {   \"p_value\": 0,\n                                                                          \"significant\": [   true,\n                                                                                              true,\n                                                                                              true]},\n                                                           \"000003\": {   \"p_value\": 0,\n                                                                          \"significant\": [   true,\n                                                                                              true,\n                                                                                              true]}}},\n                                        {   \"name\": \"jarque_bera\",\n                                            \"result\": {   \"000000\": {   \"p_value\": 0.10615,\n                                                                          \"significant\": [   false,\n                                                                                              false,\n                                                                                              false]},\n                                                           \"000001\": {   \"p_value\": 0.25957,\n                                                                          \"significant\": [   false,\n                                                                                              false,\n                                                                                              false]},\n                                                           \"000002\": {   \"p_value\": 0.0009,\n                                                                          \"significant\": [   true,\n                                                                                              true,\n                                                                                              true]},\n                                                           \"000003\": {   \"p_value\": 0.00332,\n                                                                          \"significant\": [   true,\n                                                                                              true,\n                                                                                              true]}}},\n                                        {   \"name\": \"z_score\",\n                                            \"result\": {   \"000000\": {   \"expected_max_z\": 2.71305,\n                                                                          \"max_z\": 2.48369},\n                                                           \"000001\": {   \"expected_max_z\": 2.71305,\n                                                                          \"max_z\": 3.08044},\n                                                           \"000002\": {   \"expected_max_z\": 2.71305,\n                                                                          \"max_z\": 1.77987},\n                                                           \"000003\": {   \"expected_max_z\": 2.71305,\n                                                                          \"max_z\": 1.70638}}}],\n                      \"outliers\": [   {   \"name\": \"grubbs\",\n                                           \"result\": {   \"000000\": {   \"p_value\": 1,\n                                                                         \"significant\": [   false,\n                                                                                             false,\n                                                                                             false]},\n                                                          \"000001\": {   \"p_value\": 0.26555,\n                                                                         \"significant\": [   false,\n                                                                                             false,\n                                                                                             false]},\n                                                          \"000002\": {   \"p_value\": 1,\n                                                                         \"significant\": [   false,\n                                                                                             false,\n                                                                                             false]},\n                                                          \"000003\": {   \"p_value\": 1,\n                                                                         \"significant\": [   false,\n                                                                                             false,\n                                                                                             false]}}}],\n                      \"significance_levels\": [0.01, 0.05, 0.1]},\n        \"updated\": \"2015-07-28T18:17:11.829000\",\n        \"white_box\": false}\n\n\nNote that the output in the snippet above has been abbreviated. As you see, the\n``statistical_tests`` attribute contains the ``fraud`, ``normality``\nand ``outliers``\nsections where the information for each field's distribution is stored.\n\nLogistic Regressions\n--------------------\n\nA logistic regression is a supervised machine learning method for\nsolving classification problems. Each of the classes in the field\nyou want to predict, the objective field, is assigned a probability depending\non the values of the input fields. The probability is computed\nas the value of a logistic function,\nwhose argument is a linear combination of the predictors' values.\nYou can create a logistic regression selecting which fields from your\ndataset you want to use as input fields (or predictors) and which\ncategorical field you want to predict, the objective field. Then the\ncreated logistic regression is defined by the set of coefficients in the\nlinear combination of the values. Categorical\nand text fields need some prior work to be modelled using this method. They\nare expanded as a set of new fields, one per category or term (respectively)\nwhere the number of occurrences of the category or term is store. Thus,\nthe linear combination is made on the frequency of the categories or terms.\n\nThe JSON structure for a logistic regression is\n\n.. code-block:: json\n\n    {   \"balance_objective\": false,\n        \"category\": 0,\n        \"code\": 200,\n        \"columns\": 5,\n        \"created\": \"2015-10-09T16:11:08.444000\",\n        \"credits\": 0.017581939697265625,\n        \"credits_per_prediction\": 0.0,\n        \"dataset\": \"dataset/561304f537203f4c930001ca\",\n        \"dataset_field_types\": {   \"categorical\": 1,\n                                    \"datetime\": 0,\n                                    \"effective_fields\": 5,\n                                    \"numeric\": 4,\n                                    \"preferred\": 5,\n                                    \"text\": 0,\n                                    \"total\": 5},\n        \"dataset_status\": true,\n        \"description\": \"\",\n        \"excluded_fields\": [],\n        \"fields_meta\": {   \"count\": 5,\n                            \"limit\": 1000,\n                            \"offset\": 0,\n                            \"query_total\": 5,\n                            \"total\": 5},\n        \"input_fields\": [\"000000\", \"000001\", \"000002\", \"000003\"],\n        \"locale\": \"en_US\",\n        \"logistic_regression\": {   \"bias\": 1,\n                                    \"c\": 1,\n                                    \"coefficients\": [   [   \"Iris-virginica\",\n                                                             [   -1.7074433493289376,\n                                                                 -1.533662474502423,\n                                                                 2.47026986670851,\n                                                                 2.5567582221085563,\n                                                                 -1.2158200612711925]],\n                                                         [   \"Iris-setosa\",\n                                                             [   0.41021712519841674,\n                                                                 1.464162165246765,\n                                                                 -2.26003266131107,\n                                                                 -1.0210350909174153,\n                                                                 0.26421852991732514]],\n                                                         [   \"Iris-versicolor\",\n                                                             [   0.42702327817072505,\n                                                                 -1.611817241669904,\n                                                                 0.5763832839459982,\n                                                                 -1.4069842681625884,\n                                                                 1.0946877732663143]]],\n                                    \"eps\": 1e-05,\n                                    \"fields\": {   \"000000\": {   \"column_number\": 0,\n                                                                  \"datatype\": \"double\",\n                                                                  \"name\": \"sepal length\",\n                                                                  \"optype\": \"numeric\",\n                                                                  \"order\": 0,\n                                                                  \"preferred\": true,\n                                                                  \"summary\": {   \"bins\": [   [   4.3,\n                                                                                                   1],\n                                                                                               [   4.425,\n                                                                                                   4],\n                                                                                               [   4.6,\n                                                                                                   4],\n    ...\n                                                                                               [   7.9,\n                                                                                                   1]],\n                                                                                  \"kurtosis\": -0.57357,\n                                                                                  \"maximum\": 7.9,\n                                                                                  \"mean\": 5.84333,\n                                                                                  \"median\": 5.8,\n                                                                                  \"minimum\": 4.3,\n                                                                                  \"missing_count\": 0,\n                                                                                  \"population\": 150,\n                                                                                  \"skewness\": 0.31175,\n                                                                                  \"splits\": [   4.51526,\n                                                                                                 4.67252,\n                                                                                                 4.81113,\n    ...\n                                                                                                 6.92597,\n                                                                                                 7.20423,\n                                                                                                 7.64746],\n                                                                                  \"standard_deviation\": 0.82807,\n                                                                                  \"sum\": 876.5,\n                                                                                  \"sum_squares\": 5223.85,\n                                                                                  \"variance\": 0.68569}},\n                                                   \"000001\": {   \"column_number\": 1,\n                                                                  \"datatype\": \"double\",\n                                                                  \"name\": \"sepal width\",\n                                                                  \"optype\": \"numeric\",\n                                                                  \"order\": 1,\n                                                                  \"preferred\": true,\n                                                                  \"summary\": {   \"counts\": [   [   2,\n                                                                                                     1],\n                                                                                                 [   2.2,\n                                                                                                     3],\n    ...\n                                                                                                 [   4.2,\n                                                                                                     1],\n                                                                                                 [   4.4,\n                                                                                                     1]],\n                                                                                  \"kurtosis\": 0.18098,\n                                                                                  \"maximum\": 4.4,\n                                                                                  \"mean\": 3.05733,\n                                                                                  \"median\": 3,\n                                                                                  \"minimum\": 2,\n                                                                                  \"missing_count\": 0,\n                                                                                  \"population\": 150,\n                                                                                  \"skewness\": -0.27213,\n                                                                                  \"splits\": [   1.25138,\n                                                                                                 1.32426,\n                                                                                                 1.37171,\n    ...\n                                                                                                 6.02913,\n                                                                                                 6.38125],\n                                                                                  \"standard_deviation\": 1.7653,\n                                                                                  \"sum\": 563.7,\n                                                                                  \"sum_squares\": 2582.71,\n                                                                                  \"variance\": 3.11628}},\n                                                   \"000003\": {   \"column_number\": 3,\n                                                                  \"datatype\": \"double\",\n                                                                  \"name\": \"petal width\",\n                                                                  \"optype\": \"numeric\",\n                                                                  \"order\": 3,\n                                                                  \"preferred\": true,\n                                                                  \"summary\": {   \"counts\": [   [   0.1,\n                                                                                                     5],\n                                                                                                 [   0.2,\n                                                                                                     29],\n    ...\n                                                                                                 [   2.4,\n                                                                                                     3],\n                                                                                                 [   2.5,\n                                                                                                     3]],\n                                                                                  \"kurtosis\": -1.33607,\n                                                                                  \"maximum\": 2.5,\n                                                                                  \"mean\": 1.19933,\n                                                                                  \"median\": 1.3,\n                                                                                  \"minimum\": 0.1,\n                                                                                  \"missing_count\": 0,\n                                                                                  \"population\": 150,\n                                                                                  \"skewness\": -0.10193,\n                                                                                  \"standard_deviation\": 0.76224,\n                                                                                  \"sum\": 179.9,\n                                                                                  \"sum_squares\": 302.33,\n                                                                                  \"variance\": 0.58101}},\n                                                   \"000004\": {   \"column_number\": 4,\n                                                                  \"datatype\": \"string\",\n                                                                  \"name\": \"species\",\n                                                                  \"optype\": \"categorical\",\n                                                                  \"order\": 4,\n                                                                  \"preferred\": true,\n                                                                  \"summary\": {   \"categories\": [   [   \"Iris-setosa\",\n                                                                                                         50],\n                                                                                                     [   \"Iris-versicolor\",\n                                                                                                         50],\n                                                                                                     [   \"Iris-virginica\",\n                                                                                                         50]],\n                                                                                  \"missing_count\": 0},\n                                                                  \"term_analysis\": {   \"enabled\": true}}},\n                                    \"normalize\": false,\n                                    \"regularization\": \"l2\"},\n        \"max_columns\": 5,\n        \"max_rows\": 150,\n        \"name\": \"iris' dataset's logistic regression\",\n        \"number_of_batchpredictions\": 0,\n        \"number_of_evaluations\": 0,\n        \"number_of_predictions\": 1,\n        \"objective_field\": \"000004\",\n        \"objective_field_name\": \"species\",\n        \"objective_field_type\": \"categorical\",\n        \"objective_fields\": [\"000004\"],\n        \"out_of_bag\": false,\n        \"private\": true,\n        \"project\": \"project/561304c137203f4c9300016c\",\n        \"range\": [1, 150],\n        \"replacement\": false,\n        \"resource\": \"logisticregression/5617e71c37203f506a000001\",\n        \"rows\": 150,\n        \"sample_rate\": 1.0,\n        \"shared\": false,\n        \"size\": 4609,\n        \"source\": \"source/561304f437203f4c930001c3\",\n        \"source_status\": true,\n        \"status\": {   \"code\": 5,\n                       \"elapsed\": 86,\n                       \"message\": \"The logistic regression has been created\",\n                       \"progress\": 1.0},\n        \"subscription\": false,\n        \"tags\": [\"species\"],\n        \"updated\": \"2015-10-09T16:14:02.336000\",\n        \"white_box\": false}\n\nNote that the output in the snippet above has been abbreviated. As you see,\nthe ``logistic_regression`` attribute stores the coefficients used in the\nlogistic function as well as the configuration parameters described in\nthe `developers section \u003chttps://bigml.com/developers/logisticregressions\u003e`_ .\n\n\n\nAssociations\n------------\n\nAssociation Discovery is a popular method to find out relations among values\nin high-dimensional datasets.\n\nA common case where association discovery is often used is\nmarket basket analysis. This analysis seeks for customer shopping\npatterns across large transactional\ndatasets. For instance, do customers who buy hamburgers and ketchup also\nconsume bread?\n\nBusinesses use those insights to make decisions on promotions and product\nplacements.\nAssociation Discovery can also be used for other purposes such as early\nincident detection, web usage analysis, or software intrusion detection.\n\nIn BigML, the Association resource object can be built from any dataset, and\nits results are a list of association rules between the items in the dataset.\nIn the example case, the corresponding\nassociation rule would have hamburguers and ketchup as the items at the\nleft hand side of the association rule and bread would be the item at the\nright hand side. Both sides in this association rule are related,\nin the sense that observing\nthe items in the left hand side implies observing the items in the right hand\nside. There are some metrics to ponder the quality of these association rules:\n\n- Support: the proportion of instances which contain an itemset.\n\nFor an association rule, it means the number of instances in the dataset which\ncontain the rule's antecedent and rule's consequent together\nover the total number of instances (N) in the dataset.\n\nIt gives a measure of the importance of the rule. Association rules have\nto satisfy a minimum support constraint (i.e., min_support).\n\n- Coverage: the support of the antedecent of an association rule.\nIt measures how often a rule can be applied.\n\n- Confidence or (strength): The probability of seeing the rule's consequent\nunder the condition that the instances also contain the rule's antecedent.\nConfidence is computed using the support of the association rule over the\ncoverage. That is, the percentage of instances which contain the consequent\nand antecedent together over the number of instances which only contain\nthe antecedent.\n\nConfidence is directed and gives different values for the association\nrules Antecedent → Consequent and Consequent → Antecedent. Association\nrules also need to satisfy a minimum confidence constraint\n(i.e., min_confidence).\n\n- Leverage: the difference of the support of the association\nrule (i.e., the antecedent and consequent appearing together) and what would\nbe expected if antecedent and consequent where statistically independent.\nThis is a value between -1 and 1. A positive value suggests a positive\nrelationship and a negative value suggests a negative relationship.\n0 indicates independence.\n\nLift: how many times more often antecedent and consequent occur together\nthan expected if they where statistically independent.\nA value of 1 suggests that there is no relationship between the antecedent\nand the consequent. Higher values suggest stronger positive relationships.\nLower values suggest stronger negative relationships (the presence of the\nantecedent reduces the likelihood of the consequent)\n\nAs to the items used in association rules, each type of field is parsed to\nextract items for the rules as follows:\n\n- Categorical: each different value (class) will be considered a separate item.\n- Text: each unique term will be considered a separate item.\n- Items: each different item in the items summary will be considered.\n- Numeric: Values will be converted into categorical by making a\nsegmentation of the values.\nFor example, a numeric field with values ranging from 0 to 600 split\ninto 3 segments:\nsegment 1 → [0, 200), segment 2 → [200, 400), segment 3 → [400, 600].\nYou can refine the behavior of the transformation using\n`discretization \u003chttps://bigml.com/developers/associations#ad_create_discretization\u003e`_\nand `field_discretizations \u003chttps://bigml.com/developers/associations#ad_create_field_discretizations\u003e`_.\n\nThe JSON structure for an association resource is\n\n.. code-block:: json\n\n {\n        \"associations\":{\n            \"complement\":false,\n            \"discretization\":{\n                \"pretty\":true,\n                \"size\":5,\n                \"trim\":0,\n                \"type\":\"width\"\n            },\n            \"items\":[\n                {\n                    \"complement\":false,\n                    \"count\":32,\n                    \"field_id\":\"000000\",\n                    \"name\":\"Segment 1\",\n                    \"bin_end\":5,\n                    \"bin_start\":null\n                },\n                {\n                    \"complement\":false,\n                    \"count\":49,\n                    \"field_id\":\"000000\",\n                    \"name\":\"Segment 3\",\n                    \"bin_end\":7,\n                    \"bin_start\":6\n                },\n                {\n                    \"complement\":false,\n                    \"count\":12,\n                    \"field_id\":\"000000\",\n                    \"name\":\"Segment 4\",\n                    \"bin_end\":null,\n                    \"bin_start\":7\n                },\n                {\n                    \"complement\":false,\n                    \"count\":19,\n                    \"field_id\":\"000001\",\n                    \"name\":\"Segment 1\",\n                    \"bin_end\":2.5,\n                    \"bin_start\":null\n                },\n                 ...\n                {\n                    \"complement\":false,\n                    \"count\":50,\n                    \"field_id\":\"000004\",\n                    \"name\":\"Iris-versicolor\"\n                },\n                {\n                    \"complement\":false,\n                    \"count\":50,\n                    \"field_id\":\"000004\",\n                    \"name\":\"Iris-virginica\"\n                }\n            ],\n            \"max_k\": 100,\n            \"min_confidence\":0,\n            \"min_leverage\":0,\n            \"min_lift\":1,\n            \"min_support\":0,\n            \"rules\":[\n                {\n                    \"confidence\":1,\n                    \"id\":\"000000\",\n                    \"leverage\":0.22222,\n                    \"lhs\":[\n                        13\n                    ],\n                    \"lhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"lift\":3,\n                    \"p_value\":0.000000000,\n                    \"rhs\":[\n                        6\n                    ],\n                    \"rhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"support\":[\n                        0.33333,\n                        50\n                    ]\n                },\n                {\n                    \"confidence\":1,\n                    \"id\":\"000001\",\n                    \"leverage\":0.22222,\n                    \"lhs\":[\n                        6\n                    ],\n                    \"lhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"lift\":3,\n                    \"p_value\":0.000000000,\n                    \"rhs\":[\n                        13\n                    ],\n                    \"rhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"support\":[\n                        0.33333,\n                        50\n                    ]\n                },\n                ...\n                {\n                    \"confidence\":0.26,\n                    \"id\":\"000029\",\n                    \"leverage\":0.05111,\n                    \"lhs\":[\n                        13\n                    ],\n                    \"lhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"lift\":2.4375,\n                    \"p_value\":0.0000454342,\n                    \"rhs\":[\n                        5\n                    ],\n                    \"rhs_cover\":[\n                        0.10667,\n                        16\n                    ],\n                    \"support\":[\n                        0.08667,\n                        13\n                    ]\n                },\n                {\n                    \"confidence\":0.18,\n                    \"id\":\"00002a\",\n                    \"leverage\":0.04,\n                    \"lhs\":[\n                        15\n                    ],\n                    \"lhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"lift\":3,\n                    \"p_value\":0.0000302052,\n                    \"rhs\":[\n                        9\n                    ],\n                    \"rhs_cover\":[\n                        0.06,\n                        9\n                    ],\n                    \"support\":[\n                        0.06,\n                        9\n                    ]\n                },\n                {\n                    \"confidence\":1,\n                    \"id\":\"00002b\",\n                    \"leverage\":0.04,\n                    \"lhs\":[\n                        9\n                    ],\n                    \"lhs_cover\":[\n                        0.06,\n                        9\n                    ],\n                    \"lift\":3,\n                    \"p_value\":0.0000302052,\n                    \"rhs\":[\n                        15\n                    ],\n                    \"rhs_cover\":[\n                        0.33333,\n                        50\n                    ],\n                    \"support\":[\n                        0.06,\n                        9\n                    ]\n                }\n            ],\n            \"rules_summary\":{\n                \"confidence\":{\n                    \"counts\":[\n                        [\n                            0.18,\n                            1\n                        ],\n                        [\n                            0.24,\n                            1\n                        ],\n                        [\n                            0.26,\n                            2\n                        ],\n                        ...\n                        [\n                            0.97959,\n                            1\n                        ],\n                        [\n                            1,\n                            9\n                        ]\n                    ],\n                    \"maximum\":1,\n                    \"mean\":0.70986,\n                    \"median\":0.72864,\n                    \"minimum\":0.18,\n                    \"population\":44,\n                    \"standard_deviation\":0.24324,\n                    \"sum\":31.23367,\n                    \"sum_squares\":24.71548,\n                    \"variance\":0.05916\n                },\n                \"k\":44,\n                \"leverage\":{\n                    \"counts\":[\n                       [\n                            0.04,\n                            2\n                        ],\n                        [\n                            0.05111,\n                            4\n                        ],\n                        [\n                            0.05316,\n                            2\n                        ],\n                        ...\n                        [\n                            0.22222,\n                            2\n                        ]\n                    ],\n                    \"maximum\":0.22222,\n                    \"mean\":0.10603,\n                    \"median\":0.10156,\n                    \"minimum\":0.04,\n                    \"population\":44,\n                    \"standard_deviation\":0.0536,\n                    \"sum\":4.6651,\n                    \"sum_squares\":0.61815,\n                    \"variance\":0.00287\n                },\n                \"lhs_cover\":{\n                    \"counts\":[\n                        [\n                            0.06,\n                            2\n                        ],\n                        [\n                            0.08,\n                            2\n                        ],\n                        [\n                            0.10667,\n                            4\n                        ],\n                        [\n                            0.12667,\n                            1\n                        ],\n                        ...\n                        [\n                            0.5,\n                            4\n                        ]\n                    ],\n                    \"maximum\":0.5,\n                    \"mean\":0.29894,\n                    \"median\":0.33213,\n                    \"minimum\":0.06,\n                    \"population\":44,\n                    \"standard_deviation\":0.13386,\n                    \"sum\":13.15331,\n                    \"sum_squares\":4.70252,\n                    \"variance\":0.01792\n                },\n                \"lift\":{\n                    \"counts\":[\n                        [\n                            1.40625,\n                            2\n                        ],\n                        [\n                            1.5067,\n                            2\n                        ],\n                        ...\n                        [\n                            2.63158,\n                            4\n                        ],\n                        [\n                            3,\n                            10\n                        ],\n                        [\n                            4.93421,\n                            2\n                        ],\n                        [\n                            12.5,\n                            2\n                        ]\n                    ],\n                    \"maximum\":12.5,\n                    \"mean\":2.91963,\n                    \"median\":2.58068,\n                    \"minimum\":1.40625,\n                    \"population\":44,\n                    \"standard_deviation\":2.24641,\n                    \"sum\":128.46352,\n                    \"sum_squares\":592.05855,\n                    \"variance\":5.04635\n                },\n                \"p_value\":{\n                    \"counts\":[\n                        [\n                            0.000000000,\n                            2\n                        ],\n                        [\n                            0.000000000,\n                            4\n                        ],\n                        [\n                            0.000000000,\n                            2\n                        ],\n                        ...\n                        [\n                            0.0000910873,\n                            2\n                        ]\n                    ],\n                    \"maximum\":0.0000910873,\n                    \"mean\":0.0000106114,\n                    \"median\":0.00000000,\n                    \"minimum\":0.000000000,\n                    \"population\":44,\n                    \"standard_deviation\":0.0000227364,\n                    \"sum\":0.000466903,\n                    \"sum_squares\":0.0000000,\n                    \"variance\":0.000000001\n                },\n                \"rhs_cover\":{\n                    \"counts\":[\n                        [\n                            0.06,\n                            2\n                        ],\n                        [\n                            0.08,\n                            2\n                        ],\n                        ...\n                        [\n                            0.42667,\n                            2\n                        ],\n                        [\n                            0.46667,\n                            3\n                        ],\n                        [\n                            0.5,\n                            4\n                        ]\n                    ],\n                    \"maximum\":0.5,\n                    \"mean\":0.29894,\n                    \"median\":0.33213,\n                    \"minimum\":0.06,\n                    \"population\":44,\n                    \"standard_deviation\":0.13386,\n                    \"sum\":13.15331,\n                    \"sum_squares\":4.70252,\n                    \"variance\":0.01792\n                },\n                \"support\":{\n                    \"counts\":[\n                        [\n                            0.06,\n                            4\n                        ],\n                        [\n                            0.06667,\n                            2\n                        ],\n                        [\n                            0.08,\n                            2\n                        ],\n                        [\n                            0.08667,\n                            4\n                        ],\n                        [\n                            0.10667,\n                            4\n                        ],\n                        [\n                            0.15333,\n                            2\n                        ],\n                        [\n                            0.18667,\n                            4\n                        ],\n                        [\n                            0.19333,\n                            2\n                        ],\n                        [\n                            0.20667,\n                            2\n                        ],\n                        [\n                            0.27333,\n                            2\n                        ],\n                        [\n                            0.28667,\n                            2\n                        ],\n                        [\n                            0.3,\n                            4\n                        ],\n                        [\n                            0.32,\n                            2\n                        ],\n                        [\n                            0.33333,\n                            6\n                        ],\n                        [\n                            0.37333,\n                            2\n                        ]\n                    ],\n                    \"maximum\":0.37333,\n                    \"mean\":0.20152,\n                    \"median\":0.19057,\n                    \"minimum\":0.06,\n                    \"population\":44,\n                    \"standard_deviation\":0.10734,\n                    \"sum\":8.86668,\n                    \"sum_squares\":2.28221,\n                    \"variance\":0.01152\n                }\n            },\n            \"search_strategy\":\"leverage\",\n            \"significance_level\":0.05\n        },\n        \"category\":0,\n        \"clones\":0,\n        \"code\":200,\n        \"columns\":5,\n        \"created\":\"2015-11-05T08:06:08.184000\",\n        \"credits\":0.017581939697265625,\n        \"dataset\":\"dataset/562fae3f4e1727141d00004e\",\n        \"dataset_status\":true,\n        \"dataset_type\":0,\n        \"description\":\"\",\n        \"excluded_fields\":[ ],\n        \"fields_meta\":{\n            \"count\":5,\n            \"limit\":1000,\n            \"offset\":0,\n            \"query_total\":5,\n            \"total\":5\n        },\n        \"input_fields\":[\n            \"000000\",\n            \"000001\",\n            \"000002\",\n            \"000003\",\n            \"000004\"\n        ],\n        \"locale\":\"en_US\",\n        \"max_columns\":5,\n        \"max_rows\":150,\n        \"name\":\"iris' dataset's association\",\n        \"out_of_bag\":false,\n        \"price\":0,\n        \"private\":true,\n        \"project\":null,\n        \"range\":[\n            1,\n            150\n        ],\n        \"replacement\":false,\n        \"resource\":\"association/5621b70910cb86ae4c000000\",\n        \"rows\":150,\n        \"sample_rate\":1,\n        \"shared\":false,\n        \"size\":4609,\n        \"source\":\"source/562fae3a4e1727141d000048\",\n        \"source_status\":true,\n        \"status\":{\n            \"code\":5,\n            \"elapsed\":1072,\n            \"message\":\"The association has been created\",\n            \"progress\":1\n        },\n        \"subscription\":false,\n        \"tags\":[ ],\n        \"updated\":\"2015-11-05T08:06:20.403000\",\n        \"white_box\":false\n     }\n\n\nNote that the output in the snippet above has been abbreviated. As you see,\nthe ``associations`` attribute stores items, rules and metrics extracted\nfrom the datasets as well as the configuration parameters described in\nthe `developers section \u003chttps://bigml.com/developers/associations\u003e`_ .\n\nTopic Models\n------------\n\nA topic model is an unsupervised machine learning method for unveiling\nall the different topics underlying a collection of documents. BigML\nuses Latent Dirichlet Allocation (LDA), one of the most popular\nprobabilistic methods for topic modeling. In BigML, each instance\n(i.e. each row in your dataset) will be considered a document and the\ncontents of all the text fields given as inputs will be automatically\nconcatenated and considered the document bag of words.\n\nTopic model is based on the assumption that any document exhibits a\nmixture of topics. Each topic is composed of a set of words which are\nthematically related. The words from a given topic have different\nprobabilities for that topic. At the same time, each word can be\nattributable to one or several topics. So for example the word “sea”\nmay be found in a topic related with sea transport but also in a topic\nrelated to holidays. Topic model automatically discards stop words and\nhigh frequency words.\n\nTopic model’s main applications include browsing, organizing and\nunderstanding large archives of documents. It can been applied for\ninformation retrieval, collaborative filtering, assessing document\nsimilarity among others. The topics found in the dataset can also be\nvery useful new features before applying other models like\nclassification, clustering, or anomaly detection.\n\nThe JSON structure for a topic mod","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmlcom%2Fbigml-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigmlcom%2Fbigml-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmlcom%2Fbigml-php/lists"}