From c802bfd6c899d4d37e3bd2ee274c1bc3ffb7cd94 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 16 Mar 2011 14:11:37 +0100 Subject: doc for Feature.find, load_features in feature_type --- lib/algorithm.rb | 3 +-- lib/dataset.rb | 3 ++- lib/feature.rb | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3