本文整理汇总了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());
}
}