blob: 49a2472462953db0ea144d75570de1f62dbdb74f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
require_relative "setup.rb"
class PredictionModelTest < MiniTest::Test
def test_prediction_model
pm = Model::Prediction.from_csv_file "#{DATA_DIR}/hamster_carcinogenicity.csv"
[:endpoint,:species,:source].each do |p|
refute_empty pm[p]
end
assert pm.classification?
refute pm.regression?
pm.crossvalidations.each do |cv|
assert cv.accuracy > 0.74, "Crossvalidation accuracy (#{cv.accuracy}) should be larger than 0.75. This may happen due to an unfavorable training/test set split."
end
prediction = pm.predict Compound.from_smiles("CCCC(NN)C")
assert_equal "true", prediction[:value]
pm.delete
end
end
|