summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-03-16 14:11:37 +0100
committerChristoph Helma <helma@in-silico.ch>2011-03-16 14:11:37 +0100
commitc802bfd6c899d4d37e3bd2ee274c1bc3ffb7cd94 (patch)
treede719d0fa1604bbbf402e7d7b3af5867c9ce9576 /lib
parent349dd03693bfc357b011e9ebb5b459f6aa893f95 (diff)
doc for Feature.find, load_features in feature_type
Diffstat (limited to 'lib')
-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