summaryrefslogtreecommitdiff
path: root/bin/crossvalidation.rb
blob: b7cfdd7c6b6a8e30d8782b64526537ceebb7d581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env ruby
require_relative "../lib/lazar"
dir = ARGV[0]
dependent_variable_type = File.read(File.join(dir, "dependent-variable-type")).chomp
independent_variable_type = File.read(File.join(dir, "independent-variable-type")).chomp
if dependent_variable_type == "binary" and independent_variable_type == "binary"
  model = TanimotoClassificationModel.new dir
elsif dependent_variable_type == "binary" and independent_variable_type == "numeric"
  model = CosineClassificationModel.new dir
elsif dependent_variable_type == "numeric" and independent_variable_type == "binary"
  model = TanimotoRegressionModel.new dir
elsif dependent_variable_type == "numeric" and independent_variable_type == "numeric"
  model = CosineRegressionModel.new dir
end
model.crossvalidation