diff options
author | mguetlein <martin.guetlein@gmail.com> | 2014-10-31 15:53:25 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2014-10-31 15:53:25 +0100 |
commit | 0ea4d8528961769c5e3cb942c2532b9616532c2d (patch) | |
tree | faedf6652a5f59d27a2b1dd618e9210ba6aa9f04 | |
parent | 1cdbfbe530c2847696acbb835a4e826134a36231 (diff) |
add new binning plot for accuracy-confidence plot (this is to visualize how the probability for correct predictions can be computed)
-rw-r--r-- | report/plot_factory.rb | 7 | ||||
-rwxr-xr-x | report/report_content.rb | 5 | ||||
-rwxr-xr-x | report/report_factory.rb | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/report/plot_factory.rb b/report/plot_factory.rb index fa8f370..e868357 100644 --- a/report/plot_factory.rb +++ b/report/plot_factory.rb @@ -7,6 +7,8 @@ CONF_PLOT_RANGE = { :accuracy => [0.45,1.05], :true_positive_rate => [0.45,1.05] :negative_predictive_value => [0.45,1.05], :r_square => [0, 1.05], :sample_correlation_coefficient => [0, 1.05], :concordance_correlation_coefficient => [0, 1.05] } +require "./report/plot_binning.rb" + class Array def swap!(i,j) tmp = self[i] @@ -185,6 +187,11 @@ module Reports title += " (with True-Class: '"+true_class.to_s+"')" if true_class!=nil {:title =>title, :performance => perf} end + + def self.create_binning_confidence_plot( val_uri ) + prediction_data = YAML.load(OpenTox::RestClientWrapper.get(File.join(val_uri,"/prediction_data"))) + Reports::PlotBinning.plot(prediction_data[:confidence_values], prediction_data[:predicted_values], prediction_data[:actual_values]) + end def self.create_confidence_plot( out_files, validation_set, performance_attribute, performance_accept_value, split_set_attribute=nil, show_single_curves=false ) diff --git a/report/report_content.rb b/report/report_content.rb index 98d8cbb..dcdcb0e 100755 --- a/report/report_content.rb +++ b/report/report_content.rb @@ -247,6 +247,11 @@ class Reports::ReportContent end end + + def add_binning_confidence_plot( validation_uri ) + uri = Reports::PlotFactory.create_binning_confidence_plot( validation_uri ) + @xml_report.add_image(@current_section, uri) + end def add_confidence_plot( validation_set, performance_attribute, diff --git a/report/report_factory.rb b/report/report_factory.rb index c830a97..0550ae7 100755 --- a/report/report_factory.rb +++ b/report/report_factory.rb @@ -169,6 +169,7 @@ module Reports::ReportFactory end end report.add_confidence_plot(validation_set,:accuracy,nil,split_attribute) +# report.add_binning_confidence_plot(validation_set.unique_value(:crossvalidation_uri)) validation_set.get_accept_values.each do |accept_value| report.add_confidence_plot(validation_set, :true_positive_rate, accept_value, split_attribute) report.add_confidence_plot(validation_set, :positive_predictive_value, accept_value, split_attribute) |