diff options
author | helma@in-silico.ch <helma@in-silico.ch> | 2018-10-30 07:50:29 +0000 |
---|---|---|
committer | helma@in-silico.ch <helma@in-silico.ch> | 2018-10-30 07:50:29 +0000 |
commit | d7d57cb83dbc78b2aade173bde5fa893ebf634fe (patch) | |
tree | 83b11ee4a9da854305efe0bd451715ad0c779951 | |
parent | d9c9d78e49d886ea91386adbbd2b523347df226e (diff) |
regression feature names fixed
-rw-r--r-- | lib/feature.rb | 2 | ||||
-rw-r--r-- | test/classification-validation.rb | 1 |
2 files changed, 2 insertions, 1 deletions
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 diff --git a/test/classification-validation.rb b/test/classification-validation.rb index 6ff8be0..856988a 100644 --- a/test/classification-validation.rb +++ b/test/classification-validation.rb @@ -9,6 +9,7 @@ class ValidationClassificationTest < MiniTest::Test dataset = Dataset.from_csv_file "#{DATA_DIR}/hamster_carcinogenicity.csv" model = Model::Lazar.create training_dataset: dataset cv = ClassificationCrossValidation.create model + p cv assert cv.accuracy[:without_warnings] > 0.65, "Accuracy (#{cv.accuracy[:without_warnings]}) should be larger than 0.65, this may occur due to an unfavorable training/test set split" assert cv.weighted_accuracy[:all] > cv.accuracy[:all], "Weighted accuracy (#{cv.weighted_accuracy[:all]}) should be larger than accuracy (#{cv.accuracy[:all]})." File.open("/tmp/tmp.pdf","w+"){|f| f.puts cv.probability_plot(format:"pdf")} |