{"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_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Reference\nThis notebook is based below great notebook.\nhttps://www.kaggle.com/code/shtrausslearning/soundscape-visualisations","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2022-04-21T03:21:10.091746Z","iopub.execute_input":"2022-04-21T03:21:10.092285Z","iopub.status.idle":"2022-04-21T03:21:10.976869Z","shell.execute_reply.started":"2022-04-21T03:21:10.092250Z","shell.execute_reply":"2022-04-21T03:21:10.975840Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def show_heatmap(df):\n    # make heatmap\n    heatmap = []\n\n    for idx, row in df.iterrows():\n        _, _, species, sec = row.row_id.split(\"_\")\n        if sec == \"5\":\n            sec = \"05\"\n        true_or_false = row.target\n        heatmap.append([species,sec,true_or_false])\n    \n    heatmap = pd.DataFrame(heatmap, columns=[\"species\", \"sec\", \"True_or_False\"])\n\n    # show heamap\n    fig,ax = plt.subplots(figsize=(10,5))\n    cmap = sns.color_palette(\"Blues\")\n    heatmap = heatmap.pivot(\"species\", \"sec\", \"True_or_False\")\n    sns.heatmap(heatmap,ax=ax,linecolor='k',lw=1,cmap=cmap)\n    plt.title(\"Prediction result in soundscape_453028782.ogg\")\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-04-21T03:21:10.979225Z","iopub.execute_input":"2022-04-21T03:21:10.979538Z","iopub.status.idle":"2022-04-21T03:21:10.989739Z","shell.execute_reply.started":"2022-04-21T03:21:10.979508Z","shell.execute_reply":"2022-04-21T03:21:10.988862Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# LB 0.64","metadata":{}},{"cell_type":"code","source":"df = pd.read_csv(\"../input/birdclef2022soundscape-submission/submission_LB0.64.csv\")\nshow_heatmap(df)","metadata":{"execution":{"iopub.status.busy":"2022-04-21T03:21:10.990912Z","iopub.execute_input":"2022-04-21T03:21:10.991307Z","iopub.status.idle":"2022-04-21T03:21:11.432000Z","shell.execute_reply.started":"2022-04-21T03:21:10.991269Z","shell.execute_reply":"2022-04-21T03:21:11.431016Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# LB 0.71","metadata":{}},{"cell_type":"code","source":"df = pd.read_csv(\"../input/birdclef2022soundscape-submission/submission_LB0.71.csv\")\nshow_heatmap(df)","metadata":{"execution":{"iopub.status.busy":"2022-04-21T03:21:11.433694Z","iopub.execute_input":"2022-04-21T03:21:11.434144Z","iopub.status.idle":"2022-04-21T03:21:11.791224Z","shell.execute_reply.started":"2022-04-21T03:21:11.434084Z","shell.execute_reply":"2022-04-21T03:21:11.790005Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}