lazar 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/README.md +2 -1
- data/VERSION +1 -1
- data/ext/lazar/extconf.rb +15 -76
- data/ext/lazar/rinstall.R +9 -0
- data/lazar.gemspec +7 -7
- data/lib/classification.rb +5 -78
- data/lib/compound.rb +201 -44
- data/lib/crossvalidation.rb +224 -121
- data/lib/dataset.rb +83 -93
- data/lib/error.rb +1 -1
- data/lib/experiment.rb +99 -0
- data/lib/feature.rb +2 -54
- data/lib/lazar.rb +47 -34
- data/lib/leave-one-out-validation.rb +205 -0
- data/lib/model.rb +131 -76
- data/lib/opentox.rb +2 -2
- data/lib/overwrite.rb +37 -0
- data/lib/physchem.rb +133 -0
- data/lib/regression.rb +117 -189
- data/lib/rest-client-wrapper.rb +4 -5
- data/lib/unique_descriptors.rb +6 -7
- data/lib/validation.rb +63 -69
- data/test/all.rb +2 -2
- data/test/classification.rb +41 -0
- data/test/compound.rb +116 -7
- data/test/data/LOAEL_log_mg_corrected_smiles.csv +567 -567
- data/test/data/LOAEL_log_mmol_corrected_smiles.csv +566 -566
- data/test/data/LOAEL_mmol_corrected_smiles.csv +568 -0
- data/test/data/batch_prediction.csv +25 -0
- data/test/data/batch_prediction_inchi_small.csv +4 -0
- data/test/data/batch_prediction_smiles_small.csv +4 -0
- data/test/data/hamster_carcinogenicity.json +3 -0
- data/test/data/loael.csv +568 -0
- data/test/dataset-long.rb +5 -8
- data/test/dataset.rb +31 -11
- data/test/default_environment.rb +11 -0
- data/test/descriptor.rb +26 -41
- data/test/error.rb +1 -3
- data/test/experiment.rb +301 -0
- data/test/feature.rb +22 -10
- data/test/lazar-long.rb +43 -23
- data/test/lazar-physchem-short.rb +19 -16
- data/test/prediction_models.rb +20 -0
- data/test/regression.rb +43 -0
- data/test/setup.rb +3 -1
- data/test/test_environment.rb +10 -0
- data/test/validation.rb +92 -26
- metadata +64 -38
- data/lib/SMARTS_InteLigand.txt +0 -983
- data/lib/bbrc.rb +0 -165
- data/lib/descriptor.rb +0 -247
- data/lib/neighbor.rb +0 -25
- data/lib/similarity.rb +0 -58
- data/mongoid.yml +0 -8
- data/test/descriptor-long.rb +0 -26
- data/test/fminer-long.rb +0 -38
- data/test/fminer.rb +0 -52
- data/test/lazar-fminer.rb +0 -50
- data/test/lazar-regression.rb +0 -27
data/test/lazar-regression.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative "setup.rb"
|
2
|
-
|
3
|
-
class LazarRegressionTest < MiniTest::Test
|
4
|
-
|
5
|
-
def test_weighted_average
|
6
|
-
training_dataset = Dataset.from_csv_file "#{DATA_DIR}/EPAFHM.medi.csv"
|
7
|
-
model = Model::LazarRegression.create training_dataset
|
8
|
-
compound = Compound.from_smiles "CC(C)(C)CN"
|
9
|
-
prediction = model.predict compound
|
10
|
-
assert_equal 13.6, prediction[:value].round(1)
|
11
|
-
assert_equal 0.83, prediction[:confidence].round(2)
|
12
|
-
assert_equal 1, prediction[:neighbors].size
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_weighted_average_with_relevant_fingerprints
|
16
|
-
training_dataset = Dataset.from_csv_file "#{DATA_DIR}/EPAFHM.medi.csv"
|
17
|
-
model = Model::LazarRegression.create training_dataset
|
18
|
-
model.update(:prediction_algorithm => "OpenTox::Algorithm::Regression.weighted_average_with_relevant_fingerprints")
|
19
|
-
compound = Compound.from_smiles "CC(C)(C)CN"
|
20
|
-
prediction = model.predict compound
|
21
|
-
p prediction
|
22
|
-
#assert_equal 13.6, prediction[:value].round(1)
|
23
|
-
#assert_equal 0.83, prediction[:confidence].round(2)
|
24
|
-
#assert_equal 1, prediction[:neighbors].size
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|