summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vorgrimmler <vorgrimmlerdavid@gmx.de>2012-05-08 11:24:40 +0200
committerDavid Vorgrimmler <vorgrimmlerdavid@gmx.de>2012-05-08 11:24:40 +0200
commitaa91484566a1c7a6d7d0ad3edb8d9664b4b4c883 (patch)
treedd7717ab38528fb84b838fbce56f201ee4f4594c
parentdcd8379fcd2448b83f1b390fc74bb0b4025f8dd8 (diff)
Added parameters to dataset metadata.
-rw-r--r--fminer.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/fminer.rb b/fminer.rb
index cec902e..17cfc49 100644
--- a/fminer.rb
+++ b/fminer.rb
@@ -326,12 +326,7 @@ post '/fminer/bbrc/sample/?' do
feature_dataset.add_metadata({
DC.title => "BBRC sampled representatives for " + fminer.training_dataset.metadata[DC.title].to_s,
DC.creator => url_for('/fminer/bbrc/sample',:full),
- OT.hasSource => url_for('/fminer/bbrc/sample', :full),
- OT.parameters => [
- { DC.title => "dataset_uri", OT.paramValue => params[:dataset_uri] },
- { DC.title => "prediction_feature", OT.paramValue => params[:prediction_feature] }
- # TODO: add more params
- ]
+ OT.hasSource => url_for('/fminer/bbrc/sample', :full)
})
feature_dataset.save(@subjectid)
@@ -370,6 +365,16 @@ post '/fminer/bbrc/sample/?' do
lu = LU.new # AM LAST: uses last-utils here
params[:nr_hits] == "true" ? hit_count=true: hit_count=false
matches, counts = lu.match_rb(fminer.smi,smarts,hit_count) # AM LAST: creates instantiations
+
+ feature_dataset.add_metadata({
+ OT.parameters => [
+ { DC.title => "dataset_uri", OT.paramValue => params[:dataset_uri] },
+ { DC.title => "prediction_feature", OT.paramValue => params[:prediction_feature] },
+ { DC.title => "min_sampling_support", OT.paramValue => min_sampling_support },
+ { DC.title => "num_boots", OT.paramValue => num_boots },
+ { DC.title => "min_frequency_per_sample", OT.paramValue => fminer.minfreq },
+ { DC.title => "nr_hits", OT.paramValue => hit_count.to_s }]
+ })
matches.each do |smarts, ids|
feat_hash = Hash[*(fminer.all_activities.select { |k,v| ids.include?(k) }.flatten)] # AM LAST: get activities of feature occurrences; see http://www.softiesonrails.com/2007/9/18/ruby-201-weird-hash-syntax