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 +- test/classification-validation.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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")} -- cgit v1.2.3