From b3ed4f0dbf47ed4986b7ff745324fbde20123631 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 27 Aug 2018 11:33:10 +0000 Subject: updated to bs 4 --- views/model_details.haml | 140 +++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 72 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index c5e3370..3f1cc7a 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -1,7 +1,6 @@ -%div.panel.panel-default - %div.panel-heading - %b Model: - %div.panel-body +%div.card.bg-light + %div.card-body + %h6.card-title Model: Source: %a{:href=>model.source, :rel=>"external"} = model.source @@ -18,10 +17,9 @@ %a{:href=>"#{to("/predict/dataset/#{training_dataset.name}")}"} = training_dataset.name -%div.panel.panel-default - %div.panel-heading - %b Algorithms: - %div.panel-body +%div.card.bg-light + %div.card-body + %h6.card-title Algorithms: Similarity: %a{:href=> "http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["similarity"]["method"].sub("::", "%2F")}", :rel=>"external"} = model.model.algorithms["similarity"]["method"] @@ -40,18 +38,15 @@ = model.model.algorithms["descriptors"]["method"]+"," = model.model.algorithms["descriptors"]["type"] -%div.panel.panel-default - - if type == "Classification" - %div.panel-heading - %b Independent crossvalidations: - - else - %div.panel-heading - %b Independent crossvalidations (-log10 transformed): - %div.panel-body - /%div.row{:id=>"validations#{model.id}", :style=>"background-color:#f5f5f5;"} +%div.card.bg-light + %div.card-body + - if type == "Classification" + %h6.card-title Independent crossvalidations: + - else + %h6.card-title Independent crossvalidations (-log10 transformed): %div.row{:id=>"validations#{model.id}"} - crossvalidations.each do |cv| - %span.col-xs-4.col-sm-4.col-md-4.col-lg-4 + %span.col-4 = "Num folds:\t" = cv.folds %br @@ -84,64 +79,65 @@ %p - ["confusion_matrix", "weighted_confusion_matrix"].each_with_index do |matrix,idx| %b= (idx == 0 ? "Confusion Matrix" : "Weighted 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 - =( idx == 1 ? cv.send(matrix)[0][0].round(3) : cv.send(matrix)[0][0]) - %td - =( idx == 1 ? cv.send(matrix)[0][1].round(3) : cv.send(matrix)[0][1]) - -#%td - =cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1] - %tr - %td - %td inactive - %td - =( idx == 1 ? cv.send(matrix)[1][0].round(3) : cv.send(matrix)[1][0]) - %td - =( idx == 1 ? cv.send(matrix)[1][1].round(3) : cv.send(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 + %div.table-responsive + %table.table.table-sm.table-borderless + %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 + =( idx == 1 ? cv.send(matrix)[0][0].round(3) : cv.send(matrix)[0][0]) + %td + =( idx == 1 ? cv.send(matrix)[0][1].round(3) : cv.send(matrix)[0][1]) + -#%td + =cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1] + %tr + %td + %td inactive + %td + =( idx == 1 ? cv.send(matrix)[1][0].round(3) : cv.send(matrix)[1][0]) + %td + =( idx == 1 ? cv.send(matrix)[1][1].round(3) : cv.send(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 %br /= "Confidence plot:" /%p.plot / %img{:src=>"confp#{cv.id}.svg"} - if model.regression? %br - %a.ht5{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} RMSE: + %a{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} RMSE: = cv.rmse.round(3) if cv.rmse %br - %a.ht5{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} MAE: + %a{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} MAE: = cv.mae.round(3) if cv.mae %br - %a.ht5{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" + %a{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" = cv.r_squared.round(3) if cv.r_squared %br /= "Confidence plot:" @@ -152,10 +148,10 @@ /%p.plot / %img{:src=>"/corrp#{cv.id}.svg"} -%div.panel.panel-default - %div.panel-heading - %b QMRF: - %div.panel-body - %a.btn.btn-default.btn-xs{:href=>"#{to("/report/#{model.id}")}", :id=>"report#{model.id}", :style=>"font-size:small;"} - %span.glyphicon.glyphicon-download-alt +%div.card.bg-light + %div.card-body + %h6.card-title QMRF: + %a.btn.btn-outline-info{:href=>"#{to("/report/#{model.id}")}", :id=>"report#{model.id}", :style=>"font-size:small;"} + %span.fa.fa-download XML +%br -- cgit v1.2.3 From 9750e0309500259e9a56e267ce87984fb5bb5e53 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 26 Nov 2018 15:29:26 +0000 Subject: clean out; better response codes; prepare for batch --- views/model_details.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 3f1cc7a..5417a48 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -151,7 +151,7 @@ %div.card.bg-light %div.card-body %h6.card-title QMRF: - %a.btn.btn-outline-info{:href=>"#{to("/report/#{model.id}")}", :id=>"report#{model.id}", :style=>"font-size:small;"} + %a.btn.btn-outline-info{:href=>"#{to("/predict/report/#{model.id}")}", :id=>"report#{model.id}", :style=>"font-size:small;"} %span.fa.fa-download XML %br -- cgit v1.2.3 From 5a3be4190688bc8240327930b3e953b09ecc9d9e Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 28 May 2019 14:25:52 +0000 Subject: before clean up --- views/model_details.haml | 266 +++++++++++++++++++++++++---------------------- 1 file changed, 144 insertions(+), 122 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 5417a48..8691325 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -9,9 +9,8 @@ = "Type:\t" = type %br - - training_dataset = OpenTox::Dataset.find model.model.training_dataset_id = "Training compounds:\t" - = training_dataset.data_entries.size + = data_entries.count/3 %br = "Training dataset:\t" %a{:href=>"#{to("/predict/dataset/#{training_dataset.name}")}"} @@ -20,134 +19,157 @@ %div.card.bg-light %div.card-body %h6.card-title Algorithms: - Similarity: - %a{:href=> "http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["similarity"]["method"].sub("::", "%2F")}", :rel=>"external"} - = model.model.algorithms["similarity"]["method"] - = ", min: #{model.model.algorithms["similarity"]["min"]}" - %br - Prediction: - - if model.model.algorithms["prediction"]["method"] !~ /Caret/ - %a{:href=>"http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["prediction"]["method"].sub("::","%2f")}", :rel=>"external"} - = model.model.algorithms["prediction"]["method"] - - else - %a{:href=>"http://www.rubydoc.info/gems/lazar/OpenTox/Algorithm/Caret", :rel=>"external"} - = model.model.algorithms["prediction"]["method"] + %p.card-text + Similarity: + %a.card-link{:href=> "http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["similarity"]["method"].sub("::", "%2F")}", :rel=>"external"} + = model.model.algorithms["similarity"]["method"] + = ", min: #{model.model.algorithms["similarity"]["min"]}" + %br + Prediction: + - if model.model.algorithms["prediction"]["method"] !~ /Caret/ + %a.card-link{:href=>"http://www.rubydoc.info/gems/lazar/OpenTox%2F#{model.model.algorithms["prediction"]["method"].sub("::","%2f")}", :rel=>"external"} + = model.model.algorithms["prediction"]["method"] + - else + %a.card-link{:href=>"http://www.rubydoc.info/gems/lazar/OpenTox/Algorithm/Caret", :rel=>"external"} + = model.model.algorithms["prediction"]["method"] - %br - Descriptors: - = model.model.algorithms["descriptors"]["method"]+"," - = model.model.algorithms["descriptors"]["type"] + %br + Descriptors: + = model.model.algorithms["descriptors"]["method"]+"," + = model.model.algorithms["descriptors"]["type"] %div.card.bg-light %div.card-body - if type == "Classification" - %h6.card-title Independent crossvalidations: + %h6.card-text Independent crossvalidations: - else - %h6.card-title Independent crossvalidations (-log10 transformed): - %div.row{:id=>"validations#{model.id}"} - - crossvalidations.each do |cv| - %span.col-4 - = "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 - - if cv.true_rate - %br - = "True positive rate:\t" - = cv.true_rate[cv.accept_values[0]].round(3) - %br - = "True negative rate:\t" - = cv.true_rate[cv.accept_values[1]].round(3) - - if cv.predictivity - %br - = "Positive predictive value:\t" - = cv.predictivity[cv.accept_values[0]].round(3) - %br - = "Negative predictive value:\t" - = cv.predictivity[cv.accept_values[1]].round(3) - %p - - ["confusion_matrix", "weighted_confusion_matrix"].each_with_index do |matrix,idx| - %b= (idx == 0 ? "Confusion Matrix" : "Weighted Confusion Matrix") - %div.table-responsive - %table.table.table-sm.table-borderless - %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 - =( idx == 1 ? cv.send(matrix)[0][0].round(3) : cv.send(matrix)[0][0]) - %td - =( idx == 1 ? cv.send(matrix)[0][1].round(3) : cv.send(matrix)[0][1]) - -#%td - =cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1] - %tr - %td - %td inactive - %td - =( idx == 1 ? cv.send(matrix)[1][0].round(3) : cv.send(matrix)[1][0]) - %td - =( idx == 1 ? cv.send(matrix)[1][1].round(3) : cv.send(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 + %h6.card-text Independent crossvalidations (-log10 transformed): + - crossvalidations.each_with_index do |cv,idx| + %div.card.bg-light + %div.card-body + %h6.card-title= "Nr.#{idx+1} | Num folds:#{cv.folds}" + %p.card-text + / predictions nr + %div.row + %div.col-6 + %h6 + Predictions number: + - cv.nr_predictions.each do |key,value| + %div.row + %div.col + %h6 + = key + %div.col + = value + - if model.classification? + %hr + %div.row + / accuracy + %div.col-6 + %h6 + Accuracy: + - cv.accuracy.each do |key, value| + %div.row + %div.col + %h6 + = key + %div.col + = value.signif(3) + %hr + / matrixes + %div.row + - cv.confusion_matrix.each do |key,matrix| + %div.col-4 + %h6 + Confusion Matrix: + %i= key %br - %br - /= "Confidence plot:" - /%p.plot - / %img{:src=>"confp#{cv.id}.svg"} + %table.table.table-sm.table-borderless.col-4 + %tbody + %tr + %td + %td + %td + %h6 actual + %td + %tr + %td + %td + %td active + %td inactive + %tr + %td + %h6 predicted + %td active + %td + = matrix[0][0] + %td + = matrix[0][1] + %tr + %td + %td inactive + %td + = matrix[1][0] + %td + = matrix[1][1] + %br - if model.regression? - %br - %a{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} RMSE: - = cv.rmse.round(3) if cv.rmse - %br - %a{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} MAE: - = cv.mae.round(3) if cv.mae - %br - %a{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" - = cv.r_squared.round(3) if cv.r_squared - %br - /= "Confidence plot:" - /%p.plot - / %img{:src=>"/confp#{cv.id}.svg"} - /%br - /= "Correlation plot" - /%p.plot - / %img{:src=>"/corrp#{cv.id}.svg"} - + %hr + %div.row + %div.col + %h6 + %a.card-link{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} + RMSE: + - cv.rmse.each do |key,value| + %div.row + %div.col + %h6 + = key + %div.col + = value.signif(3) + %div.col + %h6 + %a.card-link{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} + MAE: + - cv.mae.each do |key,value| + %div.row + %div.col + %h6 + = key + %div.col + = value.signif(3) + %div.col + %h6 + %a.card-link{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" + - cv.r_squared.each do |key,value| + %div.row + %div.col + %h6.card-title + = key + %div.col + = value.signif(3) + %hr + %div.row + %div.col + %h6 + Within prediction interval: + - cv.within_prediction_interval.each do |key,value| + %div.row + %div.col + %h6 + = key + %div.col + = value + %div.col + %h6 + Out of prediction interval: + - cv.out_of_prediction_interval.each do |key,value| + %div.row + %div.col + %h6 + = key + %div.col + = value %div.card.bg-light %div.card-body %h6.card-title QMRF: -- cgit v1.2.3 From 2e2332190968d9679bffdb0faf63a34fac297f00 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 14 Jun 2019 14:56:22 +0000 Subject: reordered validation stats --- views/model_details.haml | 238 ++++++++++++++++++++++------------------------- 1 file changed, 110 insertions(+), 128 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 8691325..ba49b79 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -41,135 +41,117 @@ %div.card.bg-light %div.card-body - if type == "Classification" - %h6.card-text Independent crossvalidations: + %h6.card-title Independent crossvalidations: - else - %h6.card-text Independent crossvalidations (-log10 transformed): - - crossvalidations.each_with_index do |cv,idx| - %div.card.bg-light - %div.card-body - %h6.card-title= "Nr.#{idx+1} | Num folds:#{cv.folds}" - %p.card-text - / predictions nr - %div.row - %div.col-6 - %h6 - Predictions number: - - cv.nr_predictions.each do |key,value| - %div.row - %div.col - %h6 - = key - %div.col - = value - - if model.classification? - %hr - %div.row - / accuracy - %div.col-6 - %h6 - Accuracy: - - cv.accuracy.each do |key, value| - %div.row - %div.col - %h6 - = key - %div.col - = value.signif(3) - %hr - / matrixes - %div.row - - cv.confusion_matrix.each do |key,matrix| - %div.col-4 - %h6 - Confusion Matrix: - %i= key - %br - %table.table.table-sm.table-borderless.col-4 - %tbody - %tr - %td - %td - %td - %h6 actual - %td - %tr - %td - %td - %td active - %td inactive - %tr - %td - %h6 predicted - %td active - %td - = matrix[0][0] - %td - = matrix[0][1] - %tr - %td - %td inactive - %td - = matrix[1][0] - %td - = matrix[1][1] - %br - - if model.regression? - %hr - %div.row - %div.col - %h6 - %a.card-link{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} - RMSE: - - cv.rmse.each do |key,value| - %div.row - %div.col - %h6 - = key - %div.col - = value.signif(3) - %div.col - %h6 - %a.card-link{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} - MAE: - - cv.mae.each do |key,value| - %div.row - %div.col - %h6 - = key - %div.col - = value.signif(3) - %div.col - %h6 - %a.card-link{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" - - cv.r_squared.each do |key,value| - %div.row - %div.col - %h6.card-title - = key - %div.col - = value.signif(3) - %hr - %div.row - %div.col - %h6 - Within prediction interval: - - cv.within_prediction_interval.each do |key,value| - %div.row - %div.col - %h6 - = key - %div.col - = value - %div.col - %h6 - Out of prediction interval: - - cv.out_of_prediction_interval.each do |key,value| - %div.row - %div.col - %h6 - = key - %div.col - = value + %h6.card-title Independent crossvalidations (-log10 transformed): + - crossvalidations.each_with_index do |cv,idx| + %p.card-text + - if model.classification? + / accuracy, confusion matrixes + - keys = cv.accuracy.collect{|key, value| key} + - acc = cv.accuracy.collect{|key, value| value.signif(3)} + %table.table.table-borderless.table-responsive + %tr + %td.text-right + = "Nr.#{idx+1}" + %td.text-center Accuracy: + / mimic vertical line + %td.border-right + %td.text-center Confusion matrix all: + %td.text-center Confusion matrix confidence high: + %td.text-center Confusion matrix confidence low: + %tr + %td + / accuracy key: + %table.table + - keys.each_with_index do |key,idx| + %tr + %td.text-right.pr-0= key.gsub("_", " ")+":" + %td + / accuray value: + %table.table + - keys.each_with_index do |key,idx| + %tr + %td.text-center= acc[idx] + + / mimic vertical line + %td.border-right + + / confusion matrixes: + - keys.each do |key| + - matrix = cv.confusion_matrix[key] + %td + %table.table-sm + %tr + %td + %td + %td + %h6 actual + %td + %tr + %td + %td + %td active + %td inactive + %tr + %td + %h6 predicted + %td active + %td + = matrix[0][0] + %td + = matrix[0][1] + %tr + %td + %td inactive + %td + = matrix[1][0] + %td + = matrix[1][1] + + / regression + - if model.regression? + / rmse, mae, r_squared, pred nr, within intv, out intv + - keys = cv.rmse.collect{|key, value| key} + - rmse = cv.rmse.collect{|key, value| value.signif(3)} + - mae = cv.mae.collect{|key, value| value.signif(3)} + - rsq = cv.r_squared.collect{|key, value| value.signif(3)} + - nrp = cv.nr_predictions.collect{|key,value| value} + - wpi = cv.within_prediction_interval.collect{|key,value| value} + - opi = cv.out_of_prediction_interval.collect{|key,value| value} + %table.table.table-borderless.table-responsive + %tr + %td.text-center + = "Nr.#{idx+1} | Num folds:#{cv.folds}" + %td.text-center + %a.card-link{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} + RMSE: + %td.text-center + %a.card-link{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} + MAE: + %td.text-center + %a.card-link{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" + %td.text-center Number of predictions: + %td.text-center Within prediction interval: + %td.text-center Out of prediction interval: + - keys.each_with_index do |key,idx| + %tr + %td.text-right= key.gsub("_", " ")+":" + / rsme: + %td.text-center= rmse[idx] + / mae: + %td.text-center= mae[idx] + / r_squared: + %td.text-center= rsq[idx] + / Predictions number: + %td.text-center= nrp[idx] + / Within prediction interval: + %td.text-center= wpi[idx] + / Out of prediction interval: + %td.text-center= opi[idx] + - unless idx == 4 + %hr + %div.card.bg-light %div.card-body %h6.card-title QMRF: -- cgit v1.2.3 From 2f2a4c5e3f319d523424f365d034017152eb1504 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 17 Jun 2019 10:02:35 +0000 Subject: fixed table in model details --- views/model_details.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index ba49b79..3825949 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -63,13 +63,13 @@ %tr %td / accuracy key: - %table.table + %table.table-sm - keys.each_with_index do |key,idx| %tr %td.text-right.pr-0= key.gsub("_", " ")+":" %td / accuray value: - %table.table + %table.table-sm - keys.each_with_index do |key,idx| %tr %td.text-center= acc[idx] -- cgit v1.2.3 From 2d4782c4e8df908efa0973ee842593ead58d5980 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 27 Jun 2019 08:37:33 +0000 Subject: use prediction to csv;edit info text --- views/model_details.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 3825949..600aaf8 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -66,7 +66,7 @@ %table.table-sm - keys.each_with_index do |key,idx| %tr - %td.text-right.pr-0= key.gsub("_", " ")+":" + %td.fit.text-right.pr-0= key.gsub("_", " ")+":" %td / accuray value: %table.table-sm -- cgit v1.2.3 From e525fae235790604c072764e53357ccfefb2b066 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 27 Jun 2019 13:14:36 +0000 Subject: all cv values for classification models --- views/model_details.haml | 55 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 9 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 600aaf8..d70a7e6 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -50,29 +50,66 @@ / accuracy, confusion matrixes - keys = cv.accuracy.collect{|key, value| key} - acc = cv.accuracy.collect{|key, value| value.signif(3)} + - tpr = cv.true_rate.collect{|key, hash| hash[cv.accept_values[0]].signif(3)} + - fpr = cv.true_rate.collect{|key, hash| hash[cv.accept_values[1]].signif(3)} + - pp = cv.predictivity.collect{|key, hash| hash[cv.accept_values[0]].signif(3)} + - np = cv.predictivity.collect{|key, hash| hash[cv.accept_values[1]].signif(3)} %table.table.table-borderless.table-responsive %tr %td.text-right = "Nr.#{idx+1}" - %td.text-center Accuracy: + %td.text-center.fit Accuracy: + %td.text-right.fit True positive rate: + %td.text-right.fit True negative rate: + %td.text-right.fit Positive predictiv value: + %td.text-right.fit Negative predictiv value: / mimic vertical line %td.border-right - %td.text-center Confusion matrix all: - %td.text-center Confusion matrix confidence high: - %td.text-center Confusion matrix confidence low: + %td.text-center.fit Confusion matrix all: + %td.text-center.fit Confusion matrix confidence high: + %td.text-center.fit Confusion matrix confidence low: %tr - %td - / accuracy key: + %td.fit + / keys: %table.table-sm - keys.each_with_index do |key,idx| %tr %td.fit.text-right.pr-0= key.gsub("_", " ")+":" - %td - / accuray value: + %td.fit + / acc,accuray value: %table.table-sm - keys.each_with_index do |key,idx| %tr - %td.text-center= acc[idx] + %td.text-left= acc[idx] + + %td.fit + / tpr,true positive rate + %table.table-sm + - keys.each_with_index do |key,idx| + %tr + %td.text-left= tpr[idx] + + %td.fit + / fpr,false positive rate + %table.table-sm + - keys.each_with_index do |key,idx| + %tr + %td.text-left= fpr[idx] + + %td.fit + / pp,positive predictions + %table.table-sm + - keys.each_with_index do |key,idx| + %tr + %td.text-left= pp[idx] + + %td.fit + / np,negative predictions + %table.table-sm + - keys.each_with_index do |key,idx| + %tr + %td.text-left= np[idx] + / mimic vertical line %td.border-right -- cgit v1.2.3 From e8fbd0b6fe51888452584f80fac8508b1ba8ab3c Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 27 Jun 2019 14:13:29 +0000 Subject: use accept value for rates --- views/model_details.haml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index d70a7e6..0f34632 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -48,21 +48,22 @@ %p.card-text - if model.classification? / accuracy, confusion matrixes + - av = cv.accept_values - keys = cv.accuracy.collect{|key, value| key} - acc = cv.accuracy.collect{|key, value| value.signif(3)} - - tpr = cv.true_rate.collect{|key, hash| hash[cv.accept_values[0]].signif(3)} - - fpr = cv.true_rate.collect{|key, hash| hash[cv.accept_values[1]].signif(3)} - - pp = cv.predictivity.collect{|key, hash| hash[cv.accept_values[0]].signif(3)} - - np = cv.predictivity.collect{|key, hash| hash[cv.accept_values[1]].signif(3)} + - tpr = cv.true_rate.collect{|key, hash| hash[av[0]].signif(3)} + - fpr = cv.true_rate.collect{|key, hash| hash[av[1]].signif(3)} + - pp = cv.predictivity.collect{|key, hash| hash[av[0]].signif(3)} + - np = cv.predictivity.collect{|key, hash| hash[av[1]].signif(3)} %table.table.table-borderless.table-responsive %tr %td.text-right = "Nr.#{idx+1}" %td.text-center.fit Accuracy: - %td.text-right.fit True positive rate: - %td.text-right.fit True negative rate: - %td.text-right.fit Positive predictiv value: - %td.text-right.fit Negative predictiv value: + %td.text-right.fit True rate #{av[0]}: + %td.text-right.fit True rate #{av[1]}: + %td.text-right.fit #{av[0]} predictiv value: + %td.text-right.fit #{av[1]} predictiv value: / mimic vertical line %td.border-right %td.text-center.fit Confusion matrix all: -- cgit v1.2.3 From d68d732ca403f42caba01a96411c8a74b349defa Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 4 Jul 2019 12:47:24 +0000 Subject: regex for tpr tnr --- views/model_details.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 0f34632..e03c14a 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -60,10 +60,10 @@ %td.text-right = "Nr.#{idx+1}" %td.text-center.fit Accuracy: - %td.text-right.fit True rate #{av[0]}: - %td.text-right.fit True rate #{av[1]}: - %td.text-right.fit #{av[0]} predictiv value: - %td.text-right.fit #{av[1]} predictiv value: + %td.text-right.fit True #{av[0] =~ /^non/ ? "negative" : "positive"} rate: + %td.text-right.fit True #{av[1] =~ /^non/ ? "negative" : "positive"} rate: + %td.text-right.fit #{av[0] =~ /^non/ ? "Negative" : "Positive"} predictiv value: + %td.text-right.fit #{av[1] =~ /^non/ ? "Negative" : "Positive"} predictiv value: / mimic vertical line %td.border-right %td.text-center.fit Confusion matrix all: -- cgit v1.2.3 From 86a45822c29cef7fb84871416427f96782e4ecf5 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 5 Jul 2019 08:26:18 +0000 Subject: reorder validation statistics --- views/model_details.haml | 188 +++++++++++++++++++++-------------------------- 1 file changed, 83 insertions(+), 105 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index e03c14a..c95b363 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -41,9 +41,9 @@ %div.card.bg-light %div.card-body - if type == "Classification" - %h6.card-title Independent crossvalidations: + %h6.card-title #{crossvalidations.size} independent 10-fold crossvalidations: - else - %h6.card-title Independent crossvalidations (-log10 transformed): + %h6.card-title #{crossvalidations.size} independent 10-fold crossvalidations (-log10 transformed): - crossvalidations.each_with_index do |cv,idx| %p.card-text - if model.classification? @@ -57,95 +57,72 @@ - np = cv.predictivity.collect{|key, hash| hash[av[1]].signif(3)} %table.table.table-borderless.table-responsive %tr - %td.text-right + %td.text-center = "Nr.#{idx+1}" - %td.text-center.fit Accuracy: - %td.text-right.fit True #{av[0] =~ /^non/ ? "negative" : "positive"} rate: - %td.text-right.fit True #{av[1] =~ /^non/ ? "negative" : "positive"} rate: - %td.text-right.fit #{av[0] =~ /^non/ ? "Negative" : "Positive"} predictiv value: - %td.text-right.fit #{av[1] =~ /^non/ ? "Negative" : "Positive"} predictiv value: - / mimic vertical line - %td.border-right - %td.text-center.fit Confusion matrix all: - %td.text-center.fit Confusion matrix confidence high: - %td.text-center.fit Confusion matrix confidence low: - %tr - %td.fit - / keys: - %table.table-sm - - keys.each_with_index do |key,idx| - %tr - %td.fit.text-right.pr-0= key.gsub("_", " ")+":" - %td.fit + %td Accuracy + %td + %a{:href=>"https://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel=>"external"} + True #{av[0] =~ /^non/ ? "negative" : "positive"} rate + %td + %a{:href=>"https://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel=>"external"} + True #{av[1] =~ /^non/ ? "negative" : "positive"} rate + %td #{av[0] =~ /^non/ ? "Negative" : "Positive"} predictiv value + %td #{av[1] =~ /^non/ ? "Negative" : "Positive"} predictiv value + - keys.each_with_index do |key,idx| + %tr + / keys + %td.fit.text-right.pr-0= key.gsub("_", " ") / acc,accuray value: - %table.table-sm - - keys.each_with_index do |key,idx| - %tr - %td.text-left= acc[idx] - - %td.fit + %td= acc[idx] / tpr,true positive rate - %table.table-sm - - keys.each_with_index do |key,idx| - %tr - %td.text-left= tpr[idx] - - %td.fit + %td= tpr[idx] / fpr,false positive rate - %table.table-sm - - keys.each_with_index do |key,idx| - %tr - %td.text-left= fpr[idx] - - %td.fit + %td= fpr[idx] / pp,positive predictions - %table.table-sm - - keys.each_with_index do |key,idx| - %tr - %td.text-left= pp[idx] - - %td.fit + %td= pp[idx] / np,negative predictions - %table.table-sm - - keys.each_with_index do |key,idx| - %tr - %td.text-left= np[idx] - - - / mimic vertical line - %td.border-right - - / confusion matrixes: - - keys.each do |key| - - matrix = cv.confusion_matrix[key] - %td - %table.table-sm - %tr - %td - %td - %td - %h6 actual - %td - %tr - %td - %td - %td active - %td inactive - %tr - %td - %h6 predicted - %td active - %td - = matrix[0][0] - %td - = matrix[0][1] - %tr - %td - %td inactive - %td - = matrix[1][0] - %td - = matrix[1][1] + %td= np[idx] + %div.row + %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#matrix#{idx}"}, :aria=>{:expanded=>"false", :controls=>"matrix#{idx}"}, :style=>"font-size:small;"} + Confusion matrix: + %div.collapse{:id=>"matrix#{idx}"} + %table.table.table-borderless.table-responsive + %tr + %td.fit.text-center all + %td.fit.text-center confidence high + %td.fit.text-center confidence low + %tr + / confusion matrix + - keys.each do |key| + - matrix = cv.confusion_matrix[key] + %td.fit.text-right + %table.table-sm + %tr + %td + %td + %td + %h6 actual + %td + %tr + %td + %td + %td active + %td inactive + %tr + %td + %h6 predicted + %td active + %td + = matrix[0][0] + %td + = matrix[0][1] + %tr + %td + %td inactive + %td + = matrix[1][0] + %td + = matrix[1][1] / regression - if model.regression? @@ -160,34 +137,35 @@ %table.table.table-borderless.table-responsive %tr %td.text-center - = "Nr.#{idx+1} | Num folds:#{cv.folds}" - %td.text-center - %a.card-link{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} - RMSE: - %td.text-center - %a.card-link{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} - MAE: - %td.text-center - %a.card-link{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2"+":" - %td.text-center Number of predictions: - %td.text-center Within prediction interval: - %td.text-center Out of prediction interval: + = "Nr.#{idx+1}" + %td + %a{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} + RMSE + %td + %a{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} + MAE + %td + %a{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"2" + %td Number of predictions + %td Within prediction interval + %td Out of prediction interval - keys.each_with_index do |key,idx| %tr - %td.text-right= key.gsub("_", " ")+":" + / keys + %td.fit.text-right.pr-0= key.gsub("_", " ") / rsme: - %td.text-center= rmse[idx] + %td= rmse[idx] / mae: - %td.text-center= mae[idx] + %td= mae[idx] / r_squared: - %td.text-center= rsq[idx] + %td= rsq[idx] / Predictions number: - %td.text-center= nrp[idx] + %td= nrp[idx] / Within prediction interval: - %td.text-center= wpi[idx] + %td= wpi[idx] / Out of prediction interval: - %td.text-center= opi[idx] - - unless idx == 4 + %td= opi[idx] + - unless idx == crossvalidations.size-1 %hr %div.card.bg-light -- cgit v1.2.3 From 4793ee48de2535aa4f0ed5ab596a1bcb751c42c2 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 5 Jul 2019 11:48:24 +0000 Subject: links for ppv and npv;fixed overflow in modal --- views/model_details.haml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index c95b363..8faf785 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -66,8 +66,12 @@ %td %a{:href=>"https://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel=>"external"} True #{av[1] =~ /^non/ ? "negative" : "positive"} rate - %td #{av[0] =~ /^non/ ? "Negative" : "Positive"} predictiv value - %td #{av[1] =~ /^non/ ? "Negative" : "Positive"} predictiv value + %td + %a{:href=>"https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values", :rel=>"external"} + #{av[0] =~ /^non/ ? "Negative" : "Positive"} predictiv value + %td + %a{:href=>"https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values", :rel=>"external"} + #{av[1] =~ /^non/ ? "Negative" : "Positive"} predictiv value - keys.each_with_index do |key,idx| %tr / keys -- cgit v1.2.3 From ae4ca6dbe44f4dbe55aa9fcdc664307e4758adb2 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 15 Jul 2019 14:47:07 +0000 Subject: add plots with div toggles --- views/model_details.haml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 8faf785..8877de5 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -87,9 +87,11 @@ / np,negative predictions %td= np[idx] %div.row - %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#matrix#{idx}"}, :aria=>{:expanded=>"false", :controls=>"matrix#{idx}"}, :style=>"font-size:small;"} - Confusion matrix: - %div.collapse{:id=>"matrix#{idx}"} + %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#pplot#{model.id}#{idx}"}, :aria=>{:expanded=>"false", :controls=>"pplot#{model.id}#{idx}"}, :style=>"font-size:small;"} + Probability plot + %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#matrix#{model.id}#{idx}"}, :aria=>{:expanded=>"false", :controls=>"matrix#{model.id}#{idx}"}, :style=>"font-size:small;"} + Confusion matrix + %div.collapse{:id=>"matrix#{model.id}#{idx}"} %table.table.table-borderless.table-responsive %tr %td.fit.text-center all @@ -128,6 +130,10 @@ %td = matrix[1][1] + %div.row + %div.collapse.plot.mx-auto{:id=>"pplot#{model.id}#{idx}"} + = embedded_svg(cv.probability_plot(format: "svg")) + / regression - if model.regression? / rmse, mae, r_squared, pred nr, within intv, out intv @@ -169,6 +175,12 @@ %td= wpi[idx] / Out of prediction interval: %td= opi[idx] + %div.row + %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#cplot#{model.id}#{idx}"}, :aria=>{:expanded=>"false", :controls=>"cplot#{model.id}#{idx}"}, :style=>"font-size:small;"} + Correlation plot + %div.row + %div.collapse.plot.mx-auto{:id=>"cplot#{model.id}#{idx}"} + = embedded_svg(cv.correlation_plot(format: "svg")) - unless idx == crossvalidations.size-1 %hr -- cgit v1.2.3 From e0985405e2fdb0fe8c4740ccb256d3ac2d1fd5be Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 16 Jul 2019 14:20:09 +0000 Subject: use png format for plots avoiding css overwrite from svg objects and better browser performance --- views/model_details.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 8877de5..2d7a693 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -132,7 +132,7 @@ %div.row %div.collapse.plot.mx-auto{:id=>"pplot#{model.id}#{idx}"} - = embedded_svg(cv.probability_plot(format: "svg")) + %img{:src=>"/#{cv.id}.png", :alt=>"#{cv.id}.png"} / regression - if model.regression? @@ -180,7 +180,7 @@ Correlation plot %div.row %div.collapse.plot.mx-auto{:id=>"cplot#{model.id}#{idx}"} - = embedded_svg(cv.correlation_plot(format: "svg")) + %img{:src=>"/#{cv.id}.png", :alt=>"#{cv.id}.png"} - unless idx == crossvalidations.size-1 %hr -- cgit v1.2.3 From 87fc7e8997306f7edb74d5282ad337c5c3c48b1c Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 18 Jul 2019 13:55:40 +0000 Subject: removed awstats;model details without separation buttons;restructured details table;adjust info with warning;reordered positive first --- views/model_details.haml | 85 +++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 41 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 2d7a693..714d4d8 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -48,34 +48,42 @@ %p.card-text - if model.classification? / accuracy, confusion matrixes - - av = cv.accept_values + - accept_values = cv.accept_values + - av = [] + - if accept_values[1] =~ /^non/ + - av << accept_values[0] + - av << accept_values[1] + - else + - av = accept_values - keys = cv.accuracy.collect{|key, value| key} - acc = cv.accuracy.collect{|key, value| value.signif(3)} - tpr = cv.true_rate.collect{|key, hash| hash[av[0]].signif(3)} - fpr = cv.true_rate.collect{|key, hash| hash[av[1]].signif(3)} - pp = cv.predictivity.collect{|key, hash| hash[av[0]].signif(3)} - np = cv.predictivity.collect{|key, hash| hash[av[1]].signif(3)} - %table.table.table-borderless.table-responsive + %table.table.table-bordered.table-responsive.text-center.bg-white %tr - %td.text-center + %td.text-center.bg-light = "Nr.#{idx+1}" - %td Accuracy + %td + %a{:href=>"https://en.wikipedia.org/wiki/Accuracy_and_precision", :rel=>"external"} + Accuracy %td %a{:href=>"https://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel=>"external"} - True #{av[0] =~ /^non/ ? "negative" : "positive"} rate + True positive rate (Sensitivity, Recall) %td %a{:href=>"https://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel=>"external"} - True #{av[1] =~ /^non/ ? "negative" : "positive"} rate + True negative rate (Specificity) %td %a{:href=>"https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values", :rel=>"external"} - #{av[0] =~ /^non/ ? "Negative" : "Positive"} predictiv value + Positive predictive value (Precision) %td %a{:href=>"https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values", :rel=>"external"} - #{av[1] =~ /^non/ ? "Negative" : "Positive"} predictiv value + Negative predictive value - keys.each_with_index do |key,idx| %tr / keys - %td.fit.text-right.pr-0= key.gsub("_", " ") + %td.fit.text-right= key.gsub("_", " ") / acc,accuray value: %td= acc[idx] / tpr,true positive rate @@ -86,52 +94,48 @@ %td= pp[idx] / np,negative predictions %td= np[idx] - %div.row - %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#pplot#{model.id}#{idx}"}, :aria=>{:expanded=>"false", :controls=>"pplot#{model.id}#{idx}"}, :style=>"font-size:small;"} - Probability plot - %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#matrix#{model.id}#{idx}"}, :aria=>{:expanded=>"false", :controls=>"matrix#{model.id}#{idx}"}, :style=>"font-size:small;"} - Confusion matrix - %div.collapse{:id=>"matrix#{model.id}#{idx}"} + %div.row.justify-content-center + %h6 Confusion matrix + %div.row{:id=>"matrix#{model.id}#{idx}"} %table.table.table-borderless.table-responsive %tr %td.fit.text-center all %td.fit.text-center confidence high %td.fit.text-center confidence low - %tr + %tr.justify-content-around / confusion matrix - keys.each do |key| - matrix = cv.confusion_matrix[key] - %td.fit.text-right - %table.table-sm + %td + %table.table-sm.text-center %tr %td %td - %td - %h6 actual + %td actual %td %tr %td %td - %td active - %td inactive + %td.border.bg-secondary.text-white active + %td.border.bg-secondary.text-white inactive %tr - %td - %h6 predicted - %td active - %td - = matrix[0][0] - %td + %td predicted + %td.border.bg-secondary.text-white active + %td.border.bg-white + %b= matrix[0][0] + %td.border.bg-white = matrix[0][1] %tr %td - %td inactive - %td + %td.border.bg-secondary.text-white inactive + %td.border.bg-white = matrix[1][0] - %td - = matrix[1][1] - + %td.border.bg-white + %b= matrix[1][1] + %div.row.justify-content-center + %h6 Probability plot %div.row - %div.collapse.plot.mx-auto{:id=>"pplot#{model.id}#{idx}"} + %div.plot.mx-auto{:id=>"pplot#{model.id}#{idx}"} %img{:src=>"/#{cv.id}.png", :alt=>"#{cv.id}.png"} / regression @@ -144,9 +148,9 @@ - nrp = cv.nr_predictions.collect{|key,value| value} - wpi = cv.within_prediction_interval.collect{|key,value| value} - opi = cv.out_of_prediction_interval.collect{|key,value| value} - %table.table.table-borderless.table-responsive + %table.table.table-bordered.table-responsive.text-center.bg-white %tr - %td.text-center + %td.text-center.bg-light = "Nr.#{idx+1}" %td %a{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} @@ -162,7 +166,7 @@ - keys.each_with_index do |key,idx| %tr / keys - %td.fit.text-right.pr-0= key.gsub("_", " ") + %td.fit.text-right= key.gsub("_", " ") / rsme: %td= rmse[idx] / mae: @@ -175,11 +179,10 @@ %td= wpi[idx] / Out of prediction interval: %td= opi[idx] + %div.row.justify-content-center + %h6 Correlation plot %div.row - %button.btn.btn-outline-info.mx-auto{:type=>"button", :data=>{:toggle=>"collapse", :target=>"#cplot#{model.id}#{idx}"}, :aria=>{:expanded=>"false", :controls=>"cplot#{model.id}#{idx}"}, :style=>"font-size:small;"} - Correlation plot - %div.row - %div.collapse.plot.mx-auto{:id=>"cplot#{model.id}#{idx}"} + %div.plot.mx-auto{:id=>"cplot#{model.id}#{idx}"} %img{:src=>"/#{cv.id}.png", :alt=>"#{cv.id}.png"} - unless idx == crossvalidations.size-1 %hr -- cgit v1.2.3 From 8ed2cc12241bca469ba43dd5a87518e644f4b991 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 19 Jul 2019 11:06:29 +0000 Subject: refined confusion matrixes --- views/model_details.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 714d4d8..7049ee8 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -111,7 +111,7 @@ %tr %td %td - %td actual + %td{:colspan=>"2"} measured %td %tr %td @@ -119,14 +119,14 @@ %td.border.bg-secondary.text-white active %td.border.bg-secondary.text-white inactive %tr - %td predicted + %td.align-middle{:rowspan=>"2"} predicted %td.border.bg-secondary.text-white active %td.border.bg-white %b= matrix[0][0] %td.border.bg-white = matrix[0][1] %tr - %td + //%td %td.border.bg-secondary.text-white inactive %td.border.bg-white = matrix[1][0] -- cgit v1.2.3 From 1546e77e9b2796f20215caa23f06822c96be27ee Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 5 Aug 2019 09:48:54 +0000 Subject: ensure xhr requests are https to avoid mixed content issue in browsers --- views/model_details.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 7049ee8..1fcc624 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -13,7 +13,7 @@ = data_entries.count/3 %br = "Training dataset:\t" - %a{:href=>"#{to("/predict/dataset/#{training_dataset.name}")}"} + %a{:href=>"//#{ENV['VIRTUAL_HOST']}/predict/dataset/#{training_dataset.name}"} = training_dataset.name %div.card.bg-light @@ -190,7 +190,7 @@ %div.card.bg-light %div.card-body %h6.card-title QMRF: - %a.btn.btn-outline-info{:href=>"#{to("/predict/report/#{model.id}")}", :id=>"report#{model.id}", :style=>"font-size:small;"} + %a.btn.btn-outline-info{:href=>"//#{ENV['VIRTUAL_HOST']}/predict/report/#{model.id}", :id=>"report#{model.id}", :style=>"font-size:small;"} %span.fa.fa-download XML %br -- cgit v1.2.3 From 270bddf5081671cd1905d6cce6eb3659159f573a Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 16 Aug 2019 09:49:53 +0000 Subject: change hostname method --- views/model_details.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views/model_details.haml') diff --git a/views/model_details.haml b/views/model_details.haml index 1fcc624..ab58035 100644 --- a/views/model_details.haml +++ b/views/model_details.haml @@ -13,7 +13,7 @@ = data_entries.count/3 %br = "Training dataset:\t" - %a{:href=>"//#{ENV['VIRTUAL_HOST']}/predict/dataset/#{training_dataset.name}"} + %a{:href=>"//#{$host_with_port}/predict/dataset/#{training_dataset.name}"} = training_dataset.name %div.card.bg-light @@ -190,7 +190,7 @@ %div.card.bg-light %div.card-body %h6.card-title QMRF: - %a.btn.btn-outline-info{:href=>"//#{ENV['VIRTUAL_HOST']}/predict/report/#{model.id}", :id=>"report#{model.id}", :style=>"font-size:small;"} + %a.btn.btn-outline-info{:href=>"//#{$host_with_port}/predict/report/#{model.id}", :id=>"report#{model.id}", :style=>"font-size:small;"} %span.fa.fa-download XML %br -- cgit v1.2.3