Git Product home page Git Product logo

bigml-php's People

Contributors

akashenfelter avatar antoniomachine avatar mmerce avatar rickdubiel avatar sdesimone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bigml-php's Issues

ensemble's predictions in batches of max_models does not work

I believe there's a couple of errors in

https://github.com/bigmlcom/bigml-php/blob/master/bigml/ensemble.php#L111

that I think should be changed to

          foreach (range(0, $number_of_models - 1, $max_models) as $index) {
              array_push($this->models_splits,
                         array_slice($models, $index, $max_models));
          }

and also in multivote extend method's check (the argument can be a stdClass object).

https://github.com/bigmlcom/bigml-php/blob/master/bigml/multivote.php#L857

so it should be changed to something like:

   function extend($predictions_info) {
      /*Given a list of predictions, extends the list with another list of
           predictions and adds the order information. For instance,
           predictions_info could be:

                [{'prediction': 'Iris-virginica', 'confidence': 0.3},
                 {'prediction': 'Iris-versicolor', 'confidence': 0.8}]
           where the expected prediction keys are: prediction (compulsory),
           confidence, distribution and count.
       */
       if (is_array($predictions_info) ) {
         $order = $this->next_order();
         $i=0;
         foreach($predictions_info as $prediction) {
	    if (is_array($prediction)) {
	      $prediction['order'] = $order+$i;
	      array_push($this->predictions, $prediction);
	    } else if (get_class($prediction) == 'stdClass') {
          $prediction->order = $order + $i;
	      array_push($this->predictions, $prediction);
        } else {
	       error_log("WARNING: failed to add the prediction.\n Only dict like predictions are expected\n");
	    }
            $i+=1;
         }
       } else {
         error_log("WARNING: failed to add the predictions.\nOnly a list of dict-like predictions are expected.");
       }
   }

They prevent the ensemble predict method from working when the max_models is set to some integer lower than the number of models in the ensemble. For a 10 model ensemble you can test it like this.

php > include 'ensemble.php';
php > $ensemble = new Ensemble('ensemble/52faea8c035d07258d00861f', null, 2);
php > $ensemble->predict(array());

PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found

My Current PHP version: 7.1.28
My PHPUnit 7.5.9 by Sebastian Bergmann and contributors.
PHPUnit installed with PHP Archive (PHAR)
➜ wget -O phpunit https://phar.phpunit.de/phpunit-7.phar
➜ chmod +x phpunit
➜ ./phpunit --version

but after installing PHPUnit with PHAR it isn't generate "src/autoload.php" but just only file phpunit

but if I run ./phpunit --version in terminal it's show PHPUnit 7.5.9 by Sebastian Bergmann and contributors.

I download the zip in https://github.com/bigmlcom/bigml-php and extract it then I run it bigml-php-master/tests/test_00_regressions.php then I got an error message PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found

can anybody help me please

adding an api.ok method

As per a user request, we should add the equivalent of the api.ok method in the Python bindings

Error tipográfico en bigml.php línea 115.

Existe un error en la línea 115 del fichero bigml.php.

El parámetro que recibe la función no es el que se asigna al static.

Debería ser $devMode y no $defMode.

public static function setDevMode($devMode=false) {
self::$devMode = $defMode;
}

Un saludo y gracias.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.