Skip to content

Commit

Permalink
Fixing using multivote for probabilities and fields class
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerce committed Aug 16, 2021
1 parent 7f052a7 commit c9bbce5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bigml/fields.php
Expand Up @@ -426,9 +426,9 @@ function validate_input_data($input_data, $out=STDOUT) {
if (is_array($input_data)) {
foreach($input_data as $name => $value) {
if (array_key_exists($name, $this->fields_by_name)) {
$a = "[" . $name . str_repeat(utf8_encode(' '), 32) . ":" . gettype($input_data->[$name]) . str_repeat(utf8_encode(' '), 16) . ":" . $this->fields->[$this->fields_by_name->[$name]]->optype . str_repeat(utf8_encode(' '), 16) . ":";
$a = "[" . $name . str_repeat(utf8_encode(' '), 32) . ":" . gettype($input_data[$name]) . str_repeat(utf8_encode(' '), 16) . ":" . $this->fields->[$this->fields_by_name[$name]]->optype . str_repeat(utf8_encode(' '), 16) . ":";

if (in_array(gettype($input_data->[$name]), php_map_type($this->fields->[$this->fields_by_name->[$name]]->optype) )) {
if (in_array(gettype($input_data[$name]), php_map_type($this->fields->[$this->fields_by_name[$name]]->optype) )) {
$a = $a . "OK\n";
} else {
$a = $a . "WRONG\n";
Expand Down
2 changes: 1 addition & 1 deletion bigml/multivote.php
Expand Up @@ -529,7 +529,7 @@ public function combine($method=MultiVote::DEFAULT_METHOD, $with_confidence=fals
if ($keys != null && (!$probabilities)) {
foreach($keys as $key) {
foreach($this->predictions as $prediction) {
if (!property_exists($prediction, $key)) {
if (!is_array($prediction) && !property_exists($prediction, $key)) {
throw new \Exception('Not enough data to use the selected prediction method. Try creating your model anew.');
}
}
Expand Down

0 comments on commit c9bbce5

Please sign in to comment.