summaryrefslogtreecommitdiff
path: root/scripts/predict.rb
blob: 9161f457f23770545fd1f6455e755477a10b9e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env ruby
require_relative '../../lazar/lib/lazar'
include OpenTox

train = Dataset.from_csv_file ARGV[0]

model = Model::LazarClassification.create(training_dataset: train)

n = 0
results = {}
File.open(ARGV[1]).each_line do |l|
  unless n == 0
    id,smi = l.chomp.split ","
    c = Compound.from_smiles smi
    result = model.predict c
    results[id] = result
  end
  n += 1
end

puts results.to_json
  #puts result.inspect
  #rcv = Validation::RepeatedCrossValidation.create(model)
#puts "#{rcv.id}"