当前位置: 首页>>代码示例>>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;未经允许,请勿转载。