diff options
author | Christoph Helma <helma@in-silico.ch> | 2015-09-14 11:44:34 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2015-09-14 11:44:34 +0200 |
commit | e5c538f6c71e7c17c63d7233ef1be06a19b9e132 (patch) | |
tree | b2a00445e5f6933d64dff6ceae4a35449c4d91d2 /lib | |
parent | 96a476a2331daa4d1d6b5ac444bbdbd2ac221a5f (diff) |
classification? and regression? methods for Model::Prediction
Diffstat (limited to 'lib')
-rw-r--r-- | lib/model.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/model.rb b/lib/model.rb index 547144f..d89051a 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -194,6 +194,14 @@ module OpenTox CrossValidation.find crossvalidation_id end + def regression? + training_dataset.features.first.numeric? + end + + def classification? + training_dataset.features.first.nominal? + end + def self.from_csv_file file metadata_file = file.sub(/csv$/,"json") bad_request_error "No metadata file #{metadata_file}" unless File.exist? metadata_file |