1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
class InitValidation < ActiveRecord::Migration
def self.up
create_table :crossvalidations do |t|
[:crossvalidation_uri,
:algorithm_uri,
:dataset_uri ].each do |p|
t.column p, :string, :limit => 255
end
[:created_at ].each do |p|
t.column p, :datetime
end
[:num_folds,
:random_seed ].each do |p|
t.column p, :integer, :null => false
end
[ :stratified ].each do |p|
t.column p, :boolean, :null => false
end
end
create_table :validations do |t|
[:validation_uri,
:model_uri,
:algorithm_uri,
:training_dataset_uri,
:test_target_dataset_uri,
:test_dataset_uri,
:prediction_dataset_uri,
:prediction_feature,
:crossvalidation_uri].each do |p|
t.column p, :string, :limit => 255
end
[:created_at ].each do |p|
t.column p, :datetime
end
[:real_runtime, :num_instances, :num_without_class, :num_unpredicted, :crossvalidation_id, :crossvalidation_fold ].each do |p|
t.column p, :integer
end
[:real_runtime, :percent_without_class, :percent_unpredicted ].each do |p|
t.column p, :float
end
[:classification_statistics, :regression_statistics].each do |p|
t.column(p, :text, :limit => 16320)
end
end
end
def self.down
drop_table :validations if table_exists? :validations
drop_table :crossvalidations if table_exists? :crossvalidations
end
end
|