summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/algorithm.rb3
-rw-r--r--lib/dataset.rb3
-rw-r--r--lib/feature.rb3
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb
index af8dfaf..c8cb116 100644
--- a/lib/algorithm.rb
+++ b/lib/algorithm.rb
@@ -190,8 +190,7 @@ module OpenTox
gram_matrix[i][i] = 1.0
end
- LOGGER.debug gram_matrix.to_yaml
-
+ #LOGGER.debug gram_matrix.to_yaml
@r = RinRuby.new(false,false) # global R instance leads to Socket errors after a large number of requests
@r.eval "library('kernlab')" # this requires R package "kernlab" to be installed
LOGGER.debug "Setting R data ..."
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 2c47502..c61d86f 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -165,7 +165,8 @@ module OpenTox
# Detect feature type(s) in the dataset
# @return [String] `classification", "regression", "mixed" or unknown`
- def feature_type
+ def feature_type(subjectid=nil)
+ load_features(subjectid)
feature_types = @features.collect{|f,metadata| metadata[OT.isA]}.uniq
if feature_types.size > 1
"mixed"
diff --git a/lib/feature.rb b/lib/feature.rb
index c0729a7..e768f7b 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -2,6 +2,9 @@ module OpenTox
class Feature
include OpenTox
+ # Find a feature
+ # @param [String] uri Feature URI
+ # @return [OpenTox::Task] Feature object
def self.find(uri, subjectid=nil)
return nil unless uri
feature = Feature.new uri