當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Fields::missing_counts方法代碼示例

本文整理匯總了PHP中Fields::missing_counts方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fields::missing_counts方法的具體用法?PHP Fields::missing_counts怎麽用?PHP Fields::missing_counts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Fields的用法示例。


在下文中一共展示了Fields::missing_counts方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_scenario1

 public function test_scenario1()
 {
     $data = array(array('filename' => 'data/iris_missing.csv', 'params' => array("fields" => array("000000" => array("optype" => "numeric"))), 'missing_values' => array("000000" => 1)));
     print "Successfully obtaining missing values counts\n";
     foreach ($data as $item) {
         print "I create a data source uploading a " . $item["filename"] . " file\n";
         $source = self::$api->create_source($item["filename"], $options = array('name' => 'local_test_source'));
         $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);
         $this->assertEquals(1, $source->object->status->code);
         print "check local source is ready\n";
         $resource = self::$api->_check_resource($source->resource, null, 20000, 30);
         $this->assertEquals(BigMLRequest::FINISHED, $resource["status"]);
         print "I update the source with params ";
         $source = self::$api->update_source($source->resource, $item["params"]);
         print "create dataset with local source\n";
         $dataset = self::$api->create_dataset($source->resource);
         $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);
         $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);
         print "check the dataset is ready " . $dataset->resource . " \n";
         $resource = self::$api->_check_resource($dataset->resource, null, 20000, 30);
         $this->assertEquals(BigMLRequest::FINISHED, $resource["status"]);
         print "When I ask for the missing values counts in the fields\n";
         $fields = new Fields($resource["resource"]->object->fields);
         print "Then the missing values counts dict is " . json_encode($item["missing_values"]) . "\n";
         $this->assertEquals($item["missing_values"], $fields->missing_counts());
     }
 }
開發者ID:WebTales,項目名稱:bigml-php,代碼行數:27,代碼來源:test_19_missing_and_errors.php


注:本文中的Fields::missing_counts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。