summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-04-04 18:46:22 +0200
committerChristoph Helma <helma@in-silico.ch>2011-04-04 18:46:22 +0200
commit1daec5badcff31c591377017b32055aac775dbb7 (patch)
treea9dc4c5a1df87d13dd5127528b366081b403a1e2 /lib/feature.rb
parent2fcaf3cd3c68b8e679ecf77f70285778495d78c2 (diff)
OT.isA substituted by RDF.type, identification of feature_types by RDF.type
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index e768f7b..f6e2dfd 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -32,7 +32,16 @@ module OpenTox
# provides feature type, possible types are "regression" or "classification"
# @return [String] feature type, unknown if OT.isA property is unknown/ not set
def feature_type
- case metadata[OT.isA]
+ if metadata[RDF.type].flatten.include?(OT.NominalFeature)
+ "classification"
+ elsif metadata[RDF.type].flatten.include?(OT.NumericFeature)
+ "regression"
+ else
+ #"unknown"
+ metadata[RDF.type].inspect
+ end
+=begin
+ case metadata[RDF.type]
when /NominalFeature/
"classification"
when /NumericFeature/
@@ -40,6 +49,7 @@ module OpenTox
else
"unknown"
end
+=end
end
end