From 0a8da103e020b4a584a28a52b4ba12e1f3f90fd3 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Sun, 7 Oct 2018 18:12:39 +0200 Subject: dataset merge with feature/value maps --- lib/feature.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index f811aef..1d18a00 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -42,4 +42,8 @@ module OpenTox end end + class OriginalId < Feature + field :dataset_id, type: BSON::ObjectId + end + end -- cgit v1.2.3 From 5d4ab5553e1928e573aa6671ba6a273308b24e21 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Wed, 10 Oct 2018 14:58:44 +0200 Subject: more differentiated feature classes --- lib/feature.rb | 62 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 21 deletions(-) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index 1d18a00..e6fede6 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -2,23 +2,11 @@ module OpenTox # Basic feature class class Feature - field :measured, type: Boolean - field :calculated, type: Boolean - field :category, type: String - field :unit, type: String - field :conditions, type: Hash - - # Is it a nominal feature - # @return [TrueClass,FalseClass] - def nominal? - self.class == NominalFeature - end + end - # Is it a numeric feature - # @return [TrueClass,FalseClass] - def numeric? - self.class == NumericFeature - end + # Original ID (e.g. from CSV input) + class OriginalId < Feature + field :dataset_id, type: BSON::ObjectId end # Feature for categorical variables @@ -28,10 +16,46 @@ module OpenTox # Feature for quantitative variables class NumericFeature < Feature + field :unit, type: String + end + + # Nominal biological activity + class NominalBioActivity < NominalFeature + field :original_feature_id, type: BSON::ObjectId + field :transformation, type: Hash + end + + # Numeric biological activity + class NumericBioActivity < NumericFeature + field :original_feature_id, type: BSON::ObjectId + field :transformation, type: String + end + + # Nominal lazar prediction + class NominalLazarPrediction < NominalFeature + field :model_id, type: BSON::ObjectId + field :training_feature_id, type: BSON::ObjectId + end + + # Numeric lazar prediction + class NumericLazarPrediction < NumericFeature + field :model_id, type: BSON::ObjectId + field :training_feature_id, type: BSON::ObjectId + end + + class NominalSubstanceProperty < NominalFeature + end + + class NumericSubstanceProperty < NumericFeature + end + + class NanoParticleProperty < NumericSubstanceProperty + field :category, type: String + field :conditions, type: Hash end # Feature for SMARTS fragments - class Smarts < NominalFeature + class Smarts < Feature field :smarts, type: String index "smarts" => 1 # Create feature from SMARTS string @@ -42,8 +66,4 @@ module OpenTox end end - class OriginalId < Feature - field :dataset_id, type: BSON::ObjectId - end - end -- cgit v1.2.3 From de763211bd2b6451e3a8dc20eb95a3ecf72bef17 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Thu, 11 Oct 2018 12:13:40 +0200 Subject: initial dataset batch prediction --- lib/feature.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index e6fede6..2c10c26 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -37,6 +37,10 @@ module OpenTox field :training_feature_id, type: BSON::ObjectId end + class LazarPredictionProbability < NominalLazarPrediction + field :value, type: Float + end + # Numeric lazar prediction class NumericLazarPrediction < NumericFeature field :model_id, type: BSON::ObjectId -- cgit v1.2.3 From 1652fd5df948da7ace622c73d158010add656b9f Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Wed, 24 Oct 2018 18:21:34 +0200 Subject: dataset map --- lib/feature.rb | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index 2c10c26..056957b 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -1,32 +1,46 @@ module OpenTox - # Basic feature class - class Feature - end - # Original ID (e.g. from CSV input) class OriginalId < Feature field :dataset_id, type: BSON::ObjectId end - # Feature for categorical variables + # Original SMILES (e.g. from CSV input) + class OriginalSmiles < Feature + field :dataset_id, type: BSON::ObjectId + end + + # Warnings + class Warnings < Feature + field :dataset_id, type: BSON::ObjectId + end + + # Categorical variables class NominalFeature < Feature field :accept_values, type: Array end - # Feature for quantitative variables + # Quantitative variables class NumericFeature < Feature field :unit, type: String end # Nominal biological activity class NominalBioActivity < NominalFeature - field :original_feature_id, type: BSON::ObjectId - field :transformation, type: Hash end # Numeric biological activity class NumericBioActivity < NumericFeature + end + + # Transformed nominal biological activity + class TransformedNominalBioActivity < NominalFeature + field :original_feature_id, type: BSON::ObjectId + field :transformation, type: Hash + end + + # Transformed numeric biological activity + class TransformedNumericBioActivity < NumericFeature field :original_feature_id, type: BSON::ObjectId field :transformation, type: String end @@ -38,7 +52,6 @@ module OpenTox end class LazarPredictionProbability < NominalLazarPrediction - field :value, type: Float end # Numeric lazar prediction @@ -47,6 +60,9 @@ module OpenTox field :training_feature_id, type: BSON::ObjectId end + class LazarConfidenceInterval < NumericLazarPrediction + end + class NominalSubstanceProperty < NominalFeature end -- cgit v1.2.3 From 15f4ad23eb918a91d52779887ccfb51bc6547f1b Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Thu, 25 Oct 2018 18:58:19 +0200 Subject: dataset merge --- lib/feature.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index 056957b..50dea77 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -33,6 +33,11 @@ module OpenTox class NumericBioActivity < NumericFeature end + # Merged nominal biological activity + class MergedNominalBioActivity < NominalFeature + field :original_feature_ids, type: Array + end + # Transformed nominal biological activity class TransformedNominalBioActivity < NominalFeature field :original_feature_id, type: BSON::ObjectId -- cgit v1.2.3 From 5e9a08c0b534fa96179fb5c81a9b4193e7b0aad8 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Mon, 29 Oct 2018 17:58:09 +0100 Subject: dataset folds fixed --- lib/feature.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index 50dea77..be07e7a 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -65,7 +65,7 @@ module OpenTox field :training_feature_id, type: BSON::ObjectId end - class LazarConfidenceInterval < NumericLazarPrediction + class LazarPredictionInterval < NumericLazarPrediction end class NominalSubstanceProperty < NominalFeature -- cgit v1.2.3 From d9c9d78e49d886ea91386adbbd2b523347df226e Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Mon, 29 Oct 2018 20:34:39 +0100 Subject: dataset predictions fixed --- lib/feature.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index be07e7a..c18b0b8 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -54,18 +54,30 @@ module OpenTox class NominalLazarPrediction < NominalFeature field :model_id, type: BSON::ObjectId field :training_feature_id, type: BSON::ObjectId + def name + "#{self[:name]} Prediction" + end end class LazarPredictionProbability < NominalLazarPrediction + def name + "probability(#{self[:name]})" + end end # Numeric lazar prediction class NumericLazarPrediction < NumericFeature field :model_id, type: BSON::ObjectId field :training_feature_id, type: BSON::ObjectId + def name + "#{name} Prediction" + end end class LazarPredictionInterval < NumericLazarPrediction + def name + "prediction_interval_#{self[:name]}" + end end class NominalSubstanceProperty < NominalFeature -- cgit v1.2.3 From d7d57cb83dbc78b2aade173bde5fa893ebf634fe Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Tue, 30 Oct 2018 07:50:29 +0000 Subject: regression feature names fixed --- lib/feature.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index c18b0b8..50bbc42 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -70,7 +70,7 @@ module OpenTox field :model_id, type: BSON::ObjectId field :training_feature_id, type: BSON::ObjectId def name - "#{name} Prediction" + "#{self[:name]} Prediction" end end -- cgit v1.2.3 From 2d4ce39cb1b489e26b0d6d96026054566a4f77b9 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Tue, 30 Oct 2018 21:11:04 +0100 Subject: dataset merge --- lib/feature.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index 50bbc42..b474398 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -34,7 +34,13 @@ module OpenTox end # Merged nominal biological activity - class MergedNominalBioActivity < NominalFeature + class MergedNominalBioActivity < NominalBioActivity + field :original_feature_ids, type: Array + field :transformations, type: Array + end + + # Merged numeric biological activity + class MergedNumericBioActivity < NumericBioActivity field :original_feature_ids, type: Array end -- cgit v1.2.3 From 1b44e0cd76f2ead93b8b3fa0f970c85ef32a4b14 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Fri, 16 Nov 2018 22:45:17 +0100 Subject: confidence for prediction datasets --- lib/feature.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index b474398..72c26d7 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -15,6 +15,11 @@ module OpenTox field :dataset_id, type: BSON::ObjectId end + # Confidence + class Confidence < Feature + field :dataset_id, type: BSON::ObjectId + end + # Categorical variables class NominalFeature < Feature field :accept_values, type: Array -- cgit v1.2.3 From 455da06aa6459da0d25b286ca6cb866ff64c4c34 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 20 Jun 2019 22:01:50 +0200 Subject: separate csv serialisations for batch predictions and training data, repeated measurements in mutagenicity dataset fixed, daphnia import fixed, CENTRAL_MONGO_IP removed --- lib/feature.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/feature.rb') diff --git a/lib/feature.rb b/lib/feature.rb index 72c26d7..296a174 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -18,6 +18,9 @@ module OpenTox # Confidence class Confidence < Feature field :dataset_id, type: BSON::ObjectId + def name + "Confidence" + end end # Categorical variables @@ -66,13 +69,13 @@ module OpenTox field :model_id, type: BSON::ObjectId field :training_feature_id, type: BSON::ObjectId def name - "#{self[:name]} Prediction" + "Prediction: #{self[:name]}" end end class LazarPredictionProbability < NominalLazarPrediction def name - "probability(#{self[:name]})" + "Probability: #{self[:name]}" end end @@ -81,13 +84,13 @@ module OpenTox field :model_id, type: BSON::ObjectId field :training_feature_id, type: BSON::ObjectId def name - "#{self[:name]} Prediction" + "Prediction: #{self[:name]}" end end class LazarPredictionInterval < NumericLazarPrediction def name - "prediction_interval_#{self[:name]}" + "#{self[:name].capitalize} prediction interval" end end -- cgit v1.2.3