Data Reporting and Post Training Data Evaluation¶
This notebook contains information on how to evaluate results generated by HARDy. The sample outcomes used in this notebook were the result of transformation configuration and classifier configuration files available in the repository.
The data on which classification model were tuned was Small-angle Scattering (SAXS) data generated through procedure mentioned in this guide. Both the Cartesian Coordinate representation and RGB representation were evaluated.
This notebook is binder ready. Please uncomment the next cell to code and run it to use this notebook in binder.
[1]:
#!: $(pip install ../../)
Step 1: Extraction of results¶
Extracting the results obtained from cartesian representation
[2]:
!tar -xzf './scat_cart_pp.tar.gz' -C '.'
Extracting the results obtained from RGB representation
[3]:
!tar -xzf './scat_rgb_pp.tar.gz' -C '.'
Importing the required libraries for setting environment parameters to visualize the dataframes properly
[4]:
import pandas as pd
pd.set_option('max_rows', 9999)
Step 3: Running data reporting module¶
For Cartesian representation¶
[6]:
loss_accuracy, parallel = reporting.summary_report_plots('./scat_rgb_cart_1/')
Visualizing results
[7]:
loss_accuracy.show()
[8]:
parallel.show()
For RGB representation¶
[9]:
loss_accuracy_rgb, parallel_rgb = reporting.summary_report_plots('./scat_rgb_pp/')
[10]:
loss_accuracy_rgb.show()
[11]:
parallel_rgb.show()
Using further tabulation modules available
[12]:
hyperparameter_df, history_df, tform_rankdf = reporting.report_dataframes('./scat_rgb_pp/')
[13]:
hyperparameter_df
[13]:
| report_name | layers | kernel_size | activation_function | optimizer | pooling | test_accuracy | |
|---|---|---|---|---|---|---|---|
| 0 | lin_q_lin_I | 4 | 3 | relu | adam | max | 0.803 |
| 1 | log_q_der_I | 3 | 5 | relu | adam | max | 0.901 |
| 2 | lin_q_rec_I | 4 | 4 | relu | SGD | max | 0.769 |
| 3 | multi_transform | 3 | 3 | sigmoid | adam | max | 0.839 |
| 4 | der_q_log_I | 5 | 3 | relu | adam | max | 0.805 |
| 5 | sqr_q_lin_I | 5 | 3 | sigmoid | adam | max | 0.250 |
| 6 | log_q_lin_I | 5 | 3 | relu | adam | avg | 0.831 |
| 7 | log_q_sqr_I | 4 | 4 | relu | adam | avg | 0.604 |
| 8 | lin_q_log_I | 4 | 4 | relu | SGD | max | 0.365 |
| 9 | rec_q_rec_I | 4 | 3 | relu | adam | max | 0.804 |
| 10 | rec_q_lin_I | 3 | 5 | relu | SGD | max | 0.250 |
| 11 | sqr_q_log_I | 3 | 5 | relu | adam | max | 0.618 |
| 12 | sqr_q_sqr_I | 5 | 3 | relu | adam | max | 0.691 |
| 13 | der_q_der_I | 3 | 5 | sigmoid | adam | avg | 0.626 |
| 14 | lin_q_sqr_I | 5 | 3 | relu | adam | avg | 0.703 |
| 15 | log_q_log_I | 4 | 4 | relu | adam | avg | 0.459 |
[14]:
history_df
[14]:
| report_name | epochs | train_loss | val_loss | test_loss | train_accuracy | val_accuracy | test_accuracy | |
|---|---|---|---|---|---|---|---|---|
| 0 | lin_q_lin_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [0.8081760375564163, 0.6698134615471413, 0.643... | [0.6929170756504454, 0.6729079228023003, 0.605... | 0.424934 | [0.5958858728408813, 0.6530330181121826, 0.665... | [0.6251351237297058, 0.6432432532310486, 0.706... | 0.803000 |
| 1 | log_q_der_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.3147423730168615, 0.9628631132429426, 0.620... | [1.0729141317564865, 0.7326729235977962, 0.490... | 0.253629 | [0.3543243110179901, 0.570480465888977, 0.7474... | [0.5170270204544067, 0.7113513350486755, 0.812... | 0.901000 |
| 2 | lin_q_rec_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [0.9746777676104067, 0.774592170994561, 0.7245... | [0.9451659054591738, 0.7242444527560267, 0.687... | 0.474972 | [0.5410210490226746, 0.614954948425293, 0.6388... | [0.5735135078430176, 0.6283783912658691, 0.654... | 0.768667 |
| 3 | multi_transform | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [0.9804753610822889, 0.7650474348154154, 0.684... | [0.8447682929450068, 0.7578490273705845, 0.733... | 0.370734 | [0.541501522064209, 0.6331531405448914, 0.6908... | [0.5764864683151245, 0.6618918776512146, 0.654... | 0.839333 |
| 4 | der_q_log_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.1135094868456636, 0.7191920271721688, 0.585... | [0.7560349147895287, 0.6721863993282976, 0.587... | 0.393638 | [0.5552252531051636, 0.6741141080856323, 0.730... | [0.6781080961227417, 0.6951351165771484, 0.750... | 0.804667 |
| 5 | sqr_q_lin_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.4043014319880947, 1.4011263673226755, 1.398... | [1.4084424068187844, 1.3933849293610145, 1.396... | 1.386304 | [0.25387388467788696, 0.25153154134750366, 0.2... | [0.2405405342578888, 0.25567567348480225, 0.25... | 0.250000 |
| 6 | log_q_lin_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.3667990244902648, 1.3610757085296126, 1.356... | [1.3047192507776721, 1.351464189332107, 1.3487... | 0.423266 | [0.3101801872253418, 0.30681681632995605, 0.30... | [0.44351351261138916, 0.29540541768074036, 0.3... | 0.830667 |
| 7 | log_q_sqr_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.378919125934979, 1.365878099378523, 1.36232... | [1.3658991764331687, 1.3594434281875347, 1.355... | 0.977161 | [0.2797597646713257, 0.30243241786956787, 0.30... | [0.3097297251224518, 0.29702702164649963, 0.30... | 0.604000 |
| 8 | lin_q_log_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] | [1.210034712714118, 1.0089355350256681, 0.9367... | [0.9949895297658855, 0.8996418241796822, 0.873... | 1.320202 | [0.41822823882102966, 0.5132432579994202, 0.54... | [0.523783802986145, 0.5743243098258972, 0.5505... | 0.364667 |
| 9 | rec_q_rec_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.1603663299892757, 0.9183210932957876, 0.813... | [0.9965362641318091, 0.819087128187048, 0.7786... | 0.497543 | [0.4788588583469391, 0.6230930685997009, 0.671... | [0.5867567658424377, 0.6740540266036987, 0.697... | 0.804333 |
| 10 | rec_q_lin_I | [1, 2, 3, 4, 5, 6, 7, 8, 9] | [1.38856608064325, 1.3867126006765051, 1.38661... | [1.386404105301561, 1.3862949856396378, 1.3868... | 1.386523 | [0.2456456422805786, 0.2475675642490387, 0.246... | [0.2405405342578888, 0.25567567348480225, 0.24... | 0.250000 |
| 11 | sqr_q_log_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.2729175752920432, 0.9154544173203432, 0.845... | [1.0506971036565715, 0.8518056088480456, 0.847... | 0.757464 | [0.3636035919189453, 0.5509609580039978, 0.577... | [0.4881080985069275, 0.5737837553024292, 0.579... | 0.618333 |
| 12 | sqr_q_sqr_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [0.9430359243129467, 0.7854952984672409, 0.762... | [0.7861571579143919, 0.7752227721543148, 0.746... | 0.637161 | [0.5370270013809204, 0.6112312078475952, 0.622... | [0.6067567467689514, 0.6108108162879944, 0.617... | 0.691000 |
| 13 | der_q_der_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [2.0273581344157727, 1.3065366548962063, 1.240... | [1.4033411453510154, 1.2285571612160782, 1.100... | 0.758060 | [0.3035435378551483, 0.3927627503871918, 0.429... | [0.25297296047210693, 0.3813513517379761, 0.50... | 0.626333 |
| 14 | lin_q_sqr_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.054254633914959, 0.8097827472199907, 0.7764... | [0.823198978243203, 0.7806079634304705, 0.7823... | 0.589434 | [0.44318318367004395, 0.5674474239349365, 0.60... | [0.550540566444397, 0.6202702522277832, 0.6343... | 0.702667 |
| 15 | log_q_log_I | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... | [1.379027757043237, 1.3666725359736263, 1.3624... | [1.3648796985889304, 1.3617369388711864, 1.355... | 1.207866 | [0.29105105996131897, 0.3072372376918793, 0.31... | [0.3218919038772583, 0.28837838768959045, 0.31... | 0.459333 |
[15]:
tform_rankdf
[15]:
| report_name | test_accuracy | |
|---|---|---|
| 0 | lin_q_lin_I | 0.803 |
| 1 | log_q_der_I | 0.901 |
| 2 | lin_q_rec_I | 0.769 |
| 3 | multi_transform | 0.839 |
| 4 | der_q_log_I | 0.805 |
| 5 | sqr_q_lin_I | 0.250 |
| 6 | log_q_lin_I | 0.831 |
| 7 | log_q_sqr_I | 0.604 |
| 8 | lin_q_log_I | 0.365 |
| 9 | rec_q_rec_I | 0.804 |
| 10 | rec_q_lin_I | 0.250 |
| 11 | sqr_q_log_I | 0.618 |
| 12 | sqr_q_sqr_I | 0.691 |
| 13 | der_q_der_I | 0.626 |
| 14 | lin_q_sqr_I | 0.703 |
| 15 | log_q_log_I | 0.459 |