mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-15 23:45:54 +00:00
Fix Arff datasets mistake
Fix table_report partial mistake
This commit is contained in:
@@ -32,6 +32,8 @@ class DatasetsArff:
|
|||||||
def get_range_features(X, c_features):
|
def get_range_features(X, c_features):
|
||||||
if c_features.strip() == "all":
|
if c_features.strip() == "all":
|
||||||
return list(range(X.shape[1]))
|
return list(range(X.shape[1]))
|
||||||
|
if c_features.strip() == "none":
|
||||||
|
return []
|
||||||
return json.loads(c_features)
|
return json.loads(c_features)
|
||||||
|
|
||||||
def load(self, name, class_name):
|
def load(self, name, class_name):
|
||||||
@@ -129,27 +131,26 @@ class Datasets:
|
|||||||
|
|
||||||
def _init_names(self, dataset_name):
|
def _init_names(self, dataset_name):
|
||||||
file_name = os.path.join(self.dataset.folder(), Files.index)
|
file_name = os.path.join(self.dataset.folder(), Files.index)
|
||||||
default_class = "class"
|
|
||||||
self.continuous_features = {}
|
self.continuous_features = {}
|
||||||
with open(file_name) as f:
|
with open(file_name) as f:
|
||||||
sets = f.read().splitlines()
|
sets = f.read().splitlines()
|
||||||
sets = [x for x in sets if not x.startswith("#")]
|
sets = [x for x in sets if not x.startswith("#")]
|
||||||
class_names = [default_class] * len(sets)
|
results = []
|
||||||
if "," in sets[0]:
|
|
||||||
result = []
|
|
||||||
class_names = []
|
class_names = []
|
||||||
for data in sets:
|
for set_name in sets:
|
||||||
name, class_name, features = data.split(",", 2)
|
try:
|
||||||
result.append(name)
|
name, class_name, features = set_name.split(";")
|
||||||
|
except ValueError:
|
||||||
|
class_name = "class"
|
||||||
|
features = "all"
|
||||||
|
name = set_name
|
||||||
|
results.append(name)
|
||||||
class_names.append(class_name)
|
class_names.append(class_name)
|
||||||
|
features = features.strip()
|
||||||
self.continuous_features[name] = features
|
self.continuous_features[name] = features
|
||||||
sets = result
|
|
||||||
else:
|
|
||||||
for name in sets:
|
|
||||||
self.continuous_features[name] = None
|
|
||||||
# Set as dataset list the dataset passed as argument
|
# Set as dataset list the dataset passed as argument
|
||||||
if dataset_name is None:
|
if dataset_name is None:
|
||||||
return class_names, sets
|
return class_names, results
|
||||||
try:
|
try:
|
||||||
class_name = class_names[sets.index(dataset_name)]
|
class_name = class_names[sets.index(dataset_name)]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
@@ -88,7 +88,7 @@
|
|||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn-close"
|
class="btn-close"
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
onclick="location.href = '/index/{{ compare }}'"></button>
|
onclick="location.href = '{{ back }}'"></button>
|
||||||
<h7>
|
<h7>
|
||||||
<b>
|
<b>
|
||||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score") ) }}
|
Total score: {{ "%.6f" % (data.results | sum(attribute="score") ) }}
|
||||||
|
@@ -90,7 +90,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<h2 class="has-text-white has-background-primary">
|
<h2 class="has-text-white has-background-primary">
|
||||||
<b>
|
<b>
|
||||||
<button class="delete" onclick="location.href = '/index/{{ compare }}'"></button>
|
<button class="delete" onclick="location.href = '{{ back }}'"></button>
|
||||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score") ) }}
|
Total score: {{ "%.6f" % (data.results | sum(attribute="score") ) }}
|
||||||
</b>
|
</b>
|
||||||
</h2>
|
</h2>
|
||||||
|
Reference in New Issue
Block a user