Browse Source

Merge pull request #87 from Learnware-LAMDA/fix_hetero_search

[FIX] add data_type check in is_hetero
tags/v0.3.2
Gene GitHub 2 years ago
parent
commit
c60b806fb6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      learnware/market/heterogeneous/utils.py

+ 5
- 0
learnware/market/heterogeneous/utils.py View File

@@ -20,6 +20,11 @@ def is_hetero(stat_specs: dict, semantic_spec: dict) -> bool:
table_stat_spec = stat_specs["RKMETableSpecification"]
table_input_shape = table_stat_spec.get_z().shape[1]

semantic_data_type = semantic_spec["Data"]["Values"]
if len(semantic_data_type) > 0 and semantic_data_type != ["Table"]:
logger.warning("User doesn't provide correct data type, it must be Table.")
return False

semantic_task_type = semantic_spec["Task"]["Values"]
if len(semantic_task_type) > 0 and semantic_task_type not in [["Classification"], ["Regression"]]:
logger.warning("User doesn't provide correct task type, it must be either Classification or Regression.")


Loading…
Cancel
Save