{"cells":[{"metadata":{},"cell_type":"markdown","source":"<center><h1><b>Comparisons and Evaluation</b></h1></center>"},{"metadata":{"trusted":true},"cell_type":"code","source":"import pandas as pd\n\ndf_com= pd.read_csv('../input/observations/Observations.csv',header=None)\ndf_com.drop([0,1],inplace = True)\ndf_com.drop([0,2,4],axis = 1,inplace = True)\ndf_com.rename({1:\"model\",3: \"train_time\", 5: \"train_acc\",6: \"val_acc\",7: \"train_loss\",8: \"val_loss\",9: \"ROC_AUC\"},axis = 1,inplace = True)\ndf_com.rename({2:\"1000\",3:\"1000\",4:\"1000\",5: \"500\",6: \"500\",7: \"500\",8: \"100\",9: \"100\",10: \"100\",11: \"1000u\",12: \"1000u\",13: \"1000u\",14: \"500u\",15: \"500u\",16: \"500u\"},axis = 0,inplace = True)\ndf_com['train_time'] = df_com['train_time'].str.replace('minutes', '')\ndf_com['train_time'] = df_com['train_time'].str.replace('minute', '')\ndf_com.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_com_res = df_com.loc[df_com['model'] == 'ResNet50']\ndf_com_res.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_com_vgg = df_com.loc[df_com['model'] == 'Vgg16']\ndf_com_vgg.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_com_cnn = df_com.loc[df_com['model'] == 'CNN']\ndf_com_cnn.head()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<h3>1. Time v/s Performance</h3>"},{"metadata":{"trusted":true},"cell_type":"code","source":"import plotly.express as px","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"n = df_com_res.loc[['100','500','1000']]\nl = df_com_vgg.loc[['100','500','1000']]\nm = df_com_cnn.loc[['100','500','1000']]","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> ResNet50"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(n, x=\"train_time\", y=\"ROC_AUC\",color=\"model\")\nfig.update_traces(line_color='goldenrod')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> Vgg16"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(l, x=\"train_time\", y=\"ROC_AUC\",color=\"model\")\nfig.update_traces(line_color='#456987')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> CNN"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(m, x=\"train_time\", y=\"ROC_AUC\",color=\"model\")\nfig.update_traces(line_color='#147852')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<h3>2. Performance v/s Data Size</h3>"},{"metadata":{},"cell_type":"markdown","source":"> ResNet50"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(n, x=n.index, y=\"ROC_AUC\",color=\"model\")\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(line_color='goldenrod')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> Vgg16"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(l, x=l.index, y=\"ROC_AUC\",color=\"model\")\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(line_color='#456987')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":">CNN"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(m, x=m.index, y=\"ROC_AUC\",color=\"model\")\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(line_color='#147852')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<h3>3. Time v/s Data Size</h3>"},{"metadata":{},"cell_type":"markdown","source":"> ResNet50"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(n, x=n.index, y=\"train_time\",color=\"model\")\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(line_color='goldenrod')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> Vgg16"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(m, x=m.index, y=\"train_time\",color=\"model\")\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(line_color='#456987')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":">CNN"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.line(m, x=m.index, y=\"train_time\",color=\"model\")\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(line_color='#147852')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<h3>4. Performance v/s Data Composition ---- Class Imbalance Effect</h3>"},{"metadata":{},"cell_type":"markdown","source":"> ResNet50"},{"metadata":{"trusted":true},"cell_type":"code","source":"m = df_com_res.loc[['500u','1000u']]\nfig = px.bar(m,\n             y='ROC_AUC',\n             x=m.index,\n             color='model')\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(marker_color='goldenrod')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> Vgg16"},{"metadata":{"trusted":true},"cell_type":"code","source":"n = df_com_vgg.loc[['500u','1000u']]\nfig = px.bar(n,\n             y='ROC_AUC',\n             x=n.index,\n             color='model')\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(marker_color='#456987')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":">CNN"},{"metadata":{"trusted":true},"cell_type":"code","source":"l = df_com_cnn.loc[['500u','1000u']]\nfig = px.bar(l,\n             y='ROC_AUC',\n             x=l.index,\n             color='model')\nfig.update_xaxes(type='category',title_text= \"Data Size\")\nfig.update_traces(marker_color='#147852')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<h3>5. Model Comparison</h3>"},{"metadata":{},"cell_type":"markdown","source":"> 1000 - Balanced"},{"metadata":{"trusted":true},"cell_type":"code","source":"df_com_mod_1000 = df_com.loc[df_com.index == '1000']\ndf_com_mod_1000.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.bar(df_com_mod_1000,\n             y='ROC_AUC',\n             x='model')\nfig.update_xaxes(type='category',title_text= \"Model\")\nfig.update_traces(marker_color= 'aqua')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"> 500 - Balanced"},{"metadata":{"trusted":true},"cell_type":"code","source":"df_com_mod_500 = df_com.loc[df_com.index == '500']\ndf_com_mod_500.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.bar(df_com_mod_500,\n             y='ROC_AUC',\n             x='model')\nfig.update_xaxes(type='category',title_text= \"Model\")\nfig.update_traces(marker_color= 'firebrick')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":">100 - Balanced"},{"metadata":{"trusted":true},"cell_type":"code","source":"df_com_mod_100 = df_com.loc[df_com.index == '100']\ndf_com_mod_100.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.bar(df_com_mod_100,\n             y='ROC_AUC',\n             x='model')\nfig.update_xaxes(type='category',title_text= \"Model\")\nfig.update_traces(marker_color= 'darkorchid')\nfig.show()","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}