blob: e5886e7b82eb89995bf00d21df1f6e404e8b94fa (
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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
%b Model:
%br
Source:
%a{:href=>model.source, :target=>"external"}
= model.source
%br
= "Algorithm:\tLAZAR"
%br
- model.classification? ? type = "Classification" : type = "Regression"
= "Type:\t"
= type
%br
- training_dataset = OpenTox::Dataset.find model.training_dataset.id
= "Training dataset:\t"
= training_dataset.source.split("/").last
%br
= "Training compounds:\t"
= training_dataset.compounds.size
%p
%b Crossvalidation (3 independent):
%div.row{:id=>"validations#{model.id}", :style=>"background-color:#f5f5f5;"}
- model.crossvalidations.each do |crossvalidation|
%span.col-xs-4.col-sm-4.col-md-4.col-lg-4
- cv = OpenTox::CrossValidation.find crossvalidation.id
= "Num folds:\t"
= cv.folds
%br
= "Num instances:\t"
= cv.nr_instances
%br
= "Num unpredicted"
= cv.nr_unpredicted
- if model.classification?
%br
= "Accuracy:\t"
= cv.accuracy.round(3) if cv.accuracy
%br
= "Weighted Accuracy:\t"
= cv.weighted_accuracy.round(3) if cv.weighted_accuracy
%br
= "True positive rate:\t"
= cv.true_rate["active"].round(3) if cv.true_rate["active"]
%br
= "True negative rate:\t"
= cv.true_rate["inactive"].round(3) if cv.true_rate["inactive"]
%br
= "Positive predictive value:\t"
= cv.predictivity["active"].round(3) if cv.predictivity["active"]
%br
= "Negative predictive value:\t"
= cv.predictivity["inactive"].round(3) if cv.predictivity["inactive"]
%p
%b Confusion Matrix:
%table.table.table-condensed.table-borderless{:style=>"width:20%;"}
%tbody
%tr
%td
%td
%td
%b actual
%td
%td
%tr
%td
%td
%td active
%td inactive
-#%td total
%tr
%td
%b predicted
%td active
%td
=cv.confusion_matrix[0][0]
%td
=cv.confusion_matrix[0][1]
-#%td
=cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1]
%tr
%td
%td inactive
%td
=cv.confusion_matrix[1][0]
%td
=cv.confusion_matrix[1][1]
-#%td
=cv.confusion_matrix[1][0]+cv.confusion_matrix[1][1]
-#%tr
%td
%td total
%td
=cv.confusion_matrix[0][0]+cv.confusion_matrix[1][0]
%td
=cv.confusion_matrix[0][1]+cv.confusion_matrix[1][1]
%td
-#= "Confusion Matrix:\t"
-#= cv.confusion_matrix
%br
-#%p
= "Confidence plot:"
-#%p{:id=>"confp#{cv.id}", :style=>"transform:scale(0.5);margin-left:-30%;margin-top:-30%;padding:0;"}
= cv.confidence_plot
- if model.regression?
%br
= "Root mean squared error:\t"
= cv.rmse.round(3) if cv.rmse
%br
= "Weighted root mean squared error:\t"
= cv.weighted_rmse.round(3) if cv.weighted_rmse
%br
= "Mean absolute error:\t"
= cv.mae.round(3) if cv.mae
%br
= "Weighted mean absolute error:\t"
= cv.weighted_mae.round(3) if cv.weighted_mae
%br
= "R square:\t"
= cv.r_squared.round(3) if cv.r_squared
-#%p
= "Correlation plot"
-#%p{:id=>"corrp#{cv.id}", :style=>"transform:scale(0.5);margin-left:-30%;margin-top:-30%;margin-bottom:0;padding:0;"}
=cv.correlation_plot
-#%p
= "Confidence plot:"
-#%p{:id=>"confp#{cv.id}", :style=>"transform:scale(0.5);margin-left:-30%;margin-top:-30%;margin-bottom:0;padding:0;"}
= cv.confidence_plot
%br
|