{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":19596,"databundleVersionId":1292430,"sourceType":"competition"},{"sourceId":1262046,"sourceType":"datasetVersion","datasetId":726424},{"sourceId":1264575,"sourceType":"datasetVersion","datasetId":725893}],"dockerImageVersionId":30626,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-01-11T09:44:58.454147Z","iopub.execute_input":"2024-01-11T09:44:58.454655Z","iopub.status.idle":"2024-01-11T09:44:58.985121Z","shell.execute_reply.started":"2024-01-11T09:44:58.454615Z","shell.execute_reply":"2024-01-11T09:44:58.984022Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:05.652965Z","iopub.execute_input":"2024-01-11T09:45:05.653452Z","iopub.status.idle":"2024-01-11T09:45:07.659127Z","shell.execute_reply.started":"2024-01-11T09:45:05.653409Z","shell.execute_reply":"2024-01-11T09:45:07.657771Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/birdsong-recognition/train.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:09.697954Z","iopub.execute_input":"2024-01-11T09:45:09.701924Z","iopub.status.idle":"2024-01-11T09:45:10.376977Z","shell.execute_reply.started":"2024-01-11T09:45:09.701872Z","shell.execute_reply":"2024-01-11T09:45:10.37571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:12.253247Z","iopub.execute_input":"2024-01-11T09:45:12.25374Z","iopub.status.idle":"2024-01-11T09:45:12.301665Z","shell.execute_reply.started":"2024-01-11T09:45:12.253699Z","shell.execute_reply":"2024-01-11T09:45:12.300374Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.size","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:14.399922Z","iopub.execute_input":"2024-01-11T09:45:14.400325Z","iopub.status.idle":"2024-01-11T09:45:14.409435Z","shell.execute_reply.started":"2024-01-11T09:45:14.400294Z","shell.execute_reply":"2024-01-11T09:45:14.408174Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:16.868454Z","iopub.execute_input":"2024-01-11T09:45:16.868882Z","iopub.status.idle":"2024-01-11T09:45:16.877416Z","shell.execute_reply.started":"2024-01-11T09:45:16.868847Z","shell.execute_reply":"2024-01-11T09:45:16.87592Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.describe()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:19.106424Z","iopub.execute_input":"2024-01-11T09:45:19.108002Z","iopub.status.idle":"2024-01-11T09:45:19.13698Z","shell.execute_reply.started":"2024-01-11T09:45:19.107951Z","shell.execute_reply":"2024-01-11T09:45:19.135596Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:27.221712Z","iopub.execute_input":"2024-01-11T09:45:27.222156Z","iopub.status.idle":"2024-01-11T09:45:27.325022Z","shell.execute_reply.started":"2024-01-11T09:45:27.222125Z","shell.execute_reply":"2024-01-11T09:45:27.323381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new_df  = df.isnull().sum()\nnew_df.sort_values(ascending=False)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:29.755111Z","iopub.execute_input":"2024-01-11T09:45:29.7556Z","iopub.status.idle":"2024-01-11T09:45:29.838039Z","shell.execute_reply.started":"2024-01-11T09:45:29.755561Z","shell.execute_reply":"2024-01-11T09:45:29.836868Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['rating'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:32.419498Z","iopub.execute_input":"2024-01-11T09:45:32.420089Z","iopub.status.idle":"2024-01-11T09:45:32.429775Z","shell.execute_reply.started":"2024-01-11T09:45:32.420054Z","shell.execute_reply":"2024-01-11T09:45:32.428279Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['rating'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:34.3504Z","iopub.execute_input":"2024-01-11T09:45:34.350942Z","iopub.status.idle":"2024-01-11T09:45:34.361571Z","shell.execute_reply.started":"2024-01-11T09:45:34.350898Z","shell.execute_reply":"2024-01-11T09:45:34.360136Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['playback_used'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:36.33666Z","iopub.execute_input":"2024-01-11T09:45:36.338362Z","iopub.status.idle":"2024-01-11T09:45:36.349463Z","shell.execute_reply.started":"2024-01-11T09:45:36.33831Z","shell.execute_reply":"2024-01-11T09:45:36.348071Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['playback_used'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:40.188731Z","iopub.execute_input":"2024-01-11T09:45:40.189233Z","iopub.status.idle":"2024-01-11T09:45:40.202126Z","shell.execute_reply.started":"2024-01-11T09:45:40.189195Z","shell.execute_reply":"2024-01-11T09:45:40.200651Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['playback_used'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:42.300296Z","iopub.execute_input":"2024-01-11T09:45:42.300734Z","iopub.status.idle":"2024-01-11T09:45:42.311769Z","shell.execute_reply.started":"2024-01-11T09:45:42.300701Z","shell.execute_reply":"2024-01-11T09:45:42.310865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['playback_used'].fillna('no',inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:44.159909Z","iopub.execute_input":"2024-01-11T09:45:44.160352Z","iopub.status.idle":"2024-01-11T09:45:44.169491Z","shell.execute_reply.started":"2024-01-11T09:45:44.160318Z","shell.execute_reply":"2024-01-11T09:45:44.168129Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['playback_used'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:45.978215Z","iopub.execute_input":"2024-01-11T09:45:45.978654Z","iopub.status.idle":"2024-01-11T09:45:45.989665Z","shell.execute_reply.started":"2024-01-11T09:45:45.978621Z","shell.execute_reply":"2024-01-11T09:45:45.988169Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"le  = LabelEncoder()\ndf['playback_used'] = le.fit_transform(df['playback_used'])\ndf['playback_used']\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:50.856075Z","iopub.execute_input":"2024-01-11T09:45:50.856515Z","iopub.status.idle":"2024-01-11T09:45:50.875651Z","shell.execute_reply.started":"2024-01-11T09:45:50.856481Z","shell.execute_reply":"2024-01-11T09:45:50.874305Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['playback_used'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:45:52.205562Z","iopub.execute_input":"2024-01-11T09:45:52.206096Z","iopub.status.idle":"2024-01-11T09:45:52.216569Z","shell.execute_reply.started":"2024-01-11T09:45:52.206057Z","shell.execute_reply":"2024-01-11T09:45:52.215334Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['ebird_code'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:16.529704Z","iopub.execute_input":"2024-01-11T09:47:16.531155Z","iopub.status.idle":"2024-01-11T09:47:16.54349Z","shell.execute_reply.started":"2024-01-11T09:47:16.531102Z","shell.execute_reply":"2024-01-11T09:47:16.541998Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['ebird_code'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:19.158014Z","iopub.execute_input":"2024-01-11T09:47:19.158538Z","iopub.status.idle":"2024-01-11T09:47:19.170369Z","shell.execute_reply.started":"2024-01-11T09:47:19.158497Z","shell.execute_reply":"2024-01-11T09:47:19.168844Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['ebird_code'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:21.068121Z","iopub.execute_input":"2024-01-11T09:47:21.069087Z","iopub.status.idle":"2024-01-11T09:47:21.081469Z","shell.execute_reply.started":"2024-01-11T09:47:21.069032Z","shell.execute_reply":"2024-01-11T09:47:21.080218Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['channels'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:24.116208Z","iopub.execute_input":"2024-01-11T09:47:24.116618Z","iopub.status.idle":"2024-01-11T09:47:24.125473Z","shell.execute_reply.started":"2024-01-11T09:47:24.116579Z","shell.execute_reply":"2024-01-11T09:47:24.124268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['channels'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:26.168759Z","iopub.execute_input":"2024-01-11T09:47:26.169587Z","iopub.status.idle":"2024-01-11T09:47:26.181191Z","shell.execute_reply.started":"2024-01-11T09:47:26.169531Z","shell.execute_reply":"2024-01-11T09:47:26.179587Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['channels'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:34.101537Z","iopub.execute_input":"2024-01-11T09:47:34.103132Z","iopub.status.idle":"2024-01-11T09:47:34.115648Z","shell.execute_reply.started":"2024-01-11T09:47:34.103091Z","shell.execute_reply":"2024-01-11T09:47:34.114558Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['channels'] = df['channels'].astype(str).str[0].astype(int)\ndf['channels']","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:37.405753Z","iopub.execute_input":"2024-01-11T09:47:37.40649Z","iopub.status.idle":"2024-01-11T09:47:37.441504Z","shell.execute_reply.started":"2024-01-11T09:47:37.406446Z","shell.execute_reply":"2024-01-11T09:47:37.440297Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['channels'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:39.924457Z","iopub.execute_input":"2024-01-11T09:47:39.92491Z","iopub.status.idle":"2024-01-11T09:47:39.935951Z","shell.execute_reply.started":"2024-01-11T09:47:39.924874Z","shell.execute_reply":"2024-01-11T09:47:39.934389Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['date'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:41.794689Z","iopub.execute_input":"2024-01-11T09:47:41.795715Z","iopub.status.idle":"2024-01-11T09:47:41.807274Z","shell.execute_reply.started":"2024-01-11T09:47:41.795673Z","shell.execute_reply":"2024-01-11T09:47:41.805865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['date'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:47:43.747104Z","iopub.execute_input":"2024-01-11T09:47:43.748404Z","iopub.status.idle":"2024-01-11T09:47:43.756504Z","shell.execute_reply.started":"2024-01-11T09:47:43.748363Z","shell.execute_reply":"2024-01-11T09:47:43.75577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['year'] = df['date'].apply(lambda x:x.split('-')[0]).astype(int)\ndf['month'] = df['date'].apply(lambda x:x.split('-')[1]).astype(int)\ndf['day'] = df['date'].apply(lambda x:x.split('-')[2]).astype(int)\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:38.225252Z","iopub.execute_input":"2024-01-11T09:48:38.225705Z","iopub.status.idle":"2024-01-11T09:48:38.287109Z","shell.execute_reply.started":"2024-01-11T09:48:38.225671Z","shell.execute_reply":"2024-01-11T09:48:38.285859Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('date', axis=1, inplace=True)\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:42.307145Z","iopub.execute_input":"2024-01-11T09:48:42.307594Z","iopub.status.idle":"2024-01-11T09:48:42.326906Z","shell.execute_reply.started":"2024-01-11T09:48:42.307558Z","shell.execute_reply":"2024-01-11T09:48:42.325276Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:45.546354Z","iopub.execute_input":"2024-01-11T09:48:45.54675Z","iopub.status.idle":"2024-01-11T09:48:45.576499Z","shell.execute_reply.started":"2024-01-11T09:48:45.546718Z","shell.execute_reply":"2024-01-11T09:48:45.57554Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['pitch'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:53.173515Z","iopub.execute_input":"2024-01-11T09:48:53.174493Z","iopub.status.idle":"2024-01-11T09:48:53.185516Z","shell.execute_reply.started":"2024-01-11T09:48:53.174451Z","shell.execute_reply":"2024-01-11T09:48:53.184209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['pitch'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:54.899088Z","iopub.execute_input":"2024-01-11T09:48:54.899559Z","iopub.status.idle":"2024-01-11T09:48:54.910982Z","shell.execute_reply.started":"2024-01-11T09:48:54.899523Z","shell.execute_reply":"2024-01-11T09:48:54.909547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['pitch'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:56.975427Z","iopub.execute_input":"2024-01-11T09:48:56.976745Z","iopub.status.idle":"2024-01-11T09:48:56.989596Z","shell.execute_reply.started":"2024-01-11T09:48:56.976691Z","shell.execute_reply":"2024-01-11T09:48:56.988414Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['duration'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:48:58.730368Z","iopub.execute_input":"2024-01-11T09:48:58.730907Z","iopub.status.idle":"2024-01-11T09:48:58.740154Z","shell.execute_reply.started":"2024-01-11T09:48:58.730868Z","shell.execute_reply":"2024-01-11T09:48:58.739167Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['duration'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:01.284858Z","iopub.execute_input":"2024-01-11T09:49:01.285746Z","iopub.status.idle":"2024-01-11T09:49:01.29486Z","shell.execute_reply.started":"2024-01-11T09:49:01.285707Z","shell.execute_reply":"2024-01-11T09:49:01.293998Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:03.076366Z","iopub.execute_input":"2024-01-11T09:49:03.07739Z","iopub.status.idle":"2024-01-11T09:49:03.103321Z","shell.execute_reply.started":"2024-01-11T09:49:03.077352Z","shell.execute_reply":"2024-01-11T09:49:03.101671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['filename'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:05.486933Z","iopub.execute_input":"2024-01-11T09:49:05.487409Z","iopub.status.idle":"2024-01-11T09:49:05.499201Z","shell.execute_reply.started":"2024-01-11T09:49:05.487373Z","shell.execute_reply":"2024-01-11T09:49:05.497746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['filename'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:07.339047Z","iopub.execute_input":"2024-01-11T09:49:07.339929Z","iopub.status.idle":"2024-01-11T09:49:07.351769Z","shell.execute_reply.started":"2024-01-11T09:49:07.339889Z","shell.execute_reply":"2024-01-11T09:49:07.350303Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['speed'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:09.12145Z","iopub.execute_input":"2024-01-11T09:49:09.121962Z","iopub.status.idle":"2024-01-11T09:49:09.13228Z","shell.execute_reply.started":"2024-01-11T09:49:09.121924Z","shell.execute_reply":"2024-01-11T09:49:09.131352Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['speed'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:11.171227Z","iopub.execute_input":"2024-01-11T09:49:11.171962Z","iopub.status.idle":"2024-01-11T09:49:11.181569Z","shell.execute_reply.started":"2024-01-11T09:49:11.171925Z","shell.execute_reply":"2024-01-11T09:49:11.180105Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['speed'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:13.100398Z","iopub.execute_input":"2024-01-11T09:49:13.10083Z","iopub.status.idle":"2024-01-11T09:49:13.113775Z","shell.execute_reply.started":"2024-01-11T09:49:13.100773Z","shell.execute_reply":"2024-01-11T09:49:13.112628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:15.118935Z","iopub.execute_input":"2024-01-11T09:49:15.11964Z","iopub.status.idle":"2024-01-11T09:49:15.148803Z","shell.execute_reply.started":"2024-01-11T09:49:15.1196Z","shell.execute_reply":"2024-01-11T09:49:15.147919Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['species'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:16.722672Z","iopub.execute_input":"2024-01-11T09:49:16.723159Z","iopub.status.idle":"2024-01-11T09:49:16.733219Z","shell.execute_reply.started":"2024-01-11T09:49:16.723121Z","shell.execute_reply":"2024-01-11T09:49:16.73209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['species'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:18.217987Z","iopub.execute_input":"2024-01-11T09:49:18.218444Z","iopub.status.idle":"2024-01-11T09:49:18.230576Z","shell.execute_reply.started":"2024-01-11T09:49:18.21841Z","shell.execute_reply":"2024-01-11T09:49:18.22932Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['species'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:19.75144Z","iopub.execute_input":"2024-01-11T09:49:19.751944Z","iopub.status.idle":"2024-01-11T09:49:19.762278Z","shell.execute_reply.started":"2024-01-11T09:49:19.751906Z","shell.execute_reply":"2024-01-11T09:49:19.760995Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sci_name'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:21.675069Z","iopub.execute_input":"2024-01-11T09:49:21.675523Z","iopub.status.idle":"2024-01-11T09:49:21.686264Z","shell.execute_reply.started":"2024-01-11T09:49:21.675488Z","shell.execute_reply":"2024-01-11T09:49:21.684978Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['number_of_notes'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:23.21057Z","iopub.execute_input":"2024-01-11T09:49:23.211341Z","iopub.status.idle":"2024-01-11T09:49:23.222406Z","shell.execute_reply.started":"2024-01-11T09:49:23.211301Z","shell.execute_reply":"2024-01-11T09:49:23.221224Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['number_of_notes'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:24.670907Z","iopub.execute_input":"2024-01-11T09:49:24.671392Z","iopub.status.idle":"2024-01-11T09:49:24.681489Z","shell.execute_reply.started":"2024-01-11T09:49:24.671358Z","shell.execute_reply":"2024-01-11T09:49:24.680282Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:26.019837Z","iopub.execute_input":"2024-01-11T09:49:26.020263Z","iopub.status.idle":"2024-01-11T09:49:26.029709Z","shell.execute_reply.started":"2024-01-11T09:49:26.020229Z","shell.execute_reply":"2024-01-11T09:49:26.028351Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['title'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:28.125041Z","iopub.execute_input":"2024-01-11T09:49:28.125556Z","iopub.status.idle":"2024-01-11T09:49:28.137973Z","shell.execute_reply.started":"2024-01-11T09:49:28.12552Z","shell.execute_reply":"2024-01-11T09:49:28.136565Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['title'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:29.707686Z","iopub.execute_input":"2024-01-11T09:49:29.70811Z","iopub.status.idle":"2024-01-11T09:49:29.722749Z","shell.execute_reply.started":"2024-01-11T09:49:29.708076Z","shell.execute_reply":"2024-01-11T09:49:29.721241Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['title'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:31.254998Z","iopub.execute_input":"2024-01-11T09:49:31.255439Z","iopub.status.idle":"2024-01-11T09:49:31.270278Z","shell.execute_reply.started":"2024-01-11T09:49:31.255406Z","shell.execute_reply":"2024-01-11T09:49:31.268711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('title',axis=1,inplace=True)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['secondary_labels'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:49:55.468187Z","iopub.execute_input":"2024-01-11T09:49:55.469574Z","iopub.status.idle":"2024-01-11T09:49:55.483221Z","shell.execute_reply.started":"2024-01-11T09:49:55.46952Z","shell.execute_reply":"2024-01-11T09:49:55.481697Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['secondary_labels'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:00.294052Z","iopub.execute_input":"2024-01-11T09:50:00.295384Z","iopub.status.idle":"2024-01-11T09:50:00.307374Z","shell.execute_reply.started":"2024-01-11T09:50:00.295346Z","shell.execute_reply":"2024-01-11T09:50:00.306031Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['secondary_labels'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:01.902907Z","iopub.execute_input":"2024-01-11T09:50:01.903307Z","iopub.status.idle":"2024-01-11T09:50:01.914212Z","shell.execute_reply.started":"2024-01-11T09:50:01.903275Z","shell.execute_reply":"2024-01-11T09:50:01.912869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('secondary_labels',axis=1,inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:03.405927Z","iopub.execute_input":"2024-01-11T09:50:03.406531Z","iopub.status.idle":"2024-01-11T09:50:03.423888Z","shell.execute_reply.started":"2024-01-11T09:50:03.406493Z","shell.execute_reply":"2024-01-11T09:50:03.422581Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bird_seen'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:08.179327Z","iopub.execute_input":"2024-01-11T09:50:08.18061Z","iopub.status.idle":"2024-01-11T09:50:08.190553Z","shell.execute_reply.started":"2024-01-11T09:50:08.180564Z","shell.execute_reply":"2024-01-11T09:50:08.189577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bird_seen'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:10.060501Z","iopub.execute_input":"2024-01-11T09:50:10.062066Z","iopub.status.idle":"2024-01-11T09:50:10.075128Z","shell.execute_reply.started":"2024-01-11T09:50:10.062005Z","shell.execute_reply":"2024-01-11T09:50:10.072932Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bird_seen'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:11.317774Z","iopub.execute_input":"2024-01-11T09:50:11.319198Z","iopub.status.idle":"2024-01-11T09:50:11.333364Z","shell.execute_reply.started":"2024-01-11T09:50:11.319127Z","shell.execute_reply":"2024-01-11T09:50:11.331963Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bird_seen'].fillna('yes',inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:13.266811Z","iopub.execute_input":"2024-01-11T09:50:13.267257Z","iopub.status.idle":"2024-01-11T09:50:13.27731Z","shell.execute_reply.started":"2024-01-11T09:50:13.267224Z","shell.execute_reply":"2024-01-11T09:50:13.275767Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['location'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:17.650291Z","iopub.execute_input":"2024-01-11T09:50:17.650697Z","iopub.status.idle":"2024-01-11T09:50:17.661564Z","shell.execute_reply.started":"2024-01-11T09:50:17.650659Z","shell.execute_reply":"2024-01-11T09:50:17.660679Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['location'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:19.410664Z","iopub.execute_input":"2024-01-11T09:50:19.411205Z","iopub.status.idle":"2024-01-11T09:50:19.424055Z","shell.execute_reply.started":"2024-01-11T09:50:19.411105Z","shell.execute_reply":"2024-01-11T09:50:19.42264Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['location'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:21.375116Z","iopub.execute_input":"2024-01-11T09:50:21.375978Z","iopub.status.idle":"2024-01-11T09:50:21.389972Z","shell.execute_reply.started":"2024-01-11T09:50:21.375938Z","shell.execute_reply":"2024-01-11T09:50:21.388432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['latitude'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:22.929023Z","iopub.execute_input":"2024-01-11T09:50:22.929439Z","iopub.status.idle":"2024-01-11T09:50:22.940332Z","shell.execute_reply.started":"2024-01-11T09:50:22.929408Z","shell.execute_reply":"2024-01-11T09:50:22.939243Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['location'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:24.608428Z","iopub.execute_input":"2024-01-11T09:50:24.609829Z","iopub.status.idle":"2024-01-11T09:50:24.623385Z","shell.execute_reply.started":"2024-01-11T09:50:24.60976Z","shell.execute_reply":"2024-01-11T09:50:24.621962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = df[df['latitude']!='Not specified']\ndf = df[df['longitude']!='Not specified']\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:28.201447Z","iopub.execute_input":"2024-01-11T09:50:28.202766Z","iopub.status.idle":"2024-01-11T09:50:28.234121Z","shell.execute_reply.started":"2024-01-11T09:50:28.202726Z","shell.execute_reply":"2024-01-11T09:50:28.232993Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['latitude'] = df['latitude'].astype(float)\ndf['longitude'] = df['longitude'].astype(float)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:29.868427Z","iopub.execute_input":"2024-01-11T09:50:29.869025Z","iopub.status.idle":"2024-01-11T09:50:29.885905Z","shell.execute_reply.started":"2024-01-11T09:50:29.868979Z","shell.execute_reply":"2024-01-11T09:50:29.884309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:32.574636Z","iopub.execute_input":"2024-01-11T09:50:32.575994Z","iopub.status.idle":"2024-01-11T09:50:32.585837Z","shell.execute_reply.started":"2024-01-11T09:50:32.575941Z","shell.execute_reply":"2024-01-11T09:50:32.584237Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.describe()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:34.129685Z","iopub.execute_input":"2024-01-11T09:50:34.130122Z","iopub.status.idle":"2024-01-11T09:50:34.187434Z","shell.execute_reply.started":"2024-01-11T09:50:34.130089Z","shell.execute_reply":"2024-01-11T09:50:34.186035Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sampling_rate'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:35.556786Z","iopub.execute_input":"2024-01-11T09:50:35.557289Z","iopub.status.idle":"2024-01-11T09:50:35.569835Z","shell.execute_reply.started":"2024-01-11T09:50:35.557251Z","shell.execute_reply":"2024-01-11T09:50:35.56831Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sampling_rate'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:37.254408Z","iopub.execute_input":"2024-01-11T09:50:37.254912Z","iopub.status.idle":"2024-01-11T09:50:37.265705Z","shell.execute_reply.started":"2024-01-11T09:50:37.254875Z","shell.execute_reply":"2024-01-11T09:50:37.264262Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sampling_rate'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:38.486412Z","iopub.execute_input":"2024-01-11T09:50:38.48692Z","iopub.status.idle":"2024-01-11T09:50:38.497805Z","shell.execute_reply.started":"2024-01-11T09:50:38.486875Z","shell.execute_reply":"2024-01-11T09:50:38.496355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sampling_rate'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:40.962063Z","iopub.execute_input":"2024-01-11T09:50:40.962573Z","iopub.status.idle":"2024-01-11T09:50:40.975527Z","shell.execute_reply.started":"2024-01-11T09:50:40.962538Z","shell.execute_reply":"2024-01-11T09:50:40.974538Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sampling_rate'] = df['sampling_rate'].apply(lambda x:x.split(' ')[0]).astype(int)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:42.385499Z","iopub.execute_input":"2024-01-11T09:50:42.38611Z","iopub.status.idle":"2024-01-11T09:50:42.410439Z","shell.execute_reply.started":"2024-01-11T09:50:42.386075Z","shell.execute_reply":"2024-01-11T09:50:42.409224Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['sampling_rate'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:44.719926Z","iopub.execute_input":"2024-01-11T09:50:44.720337Z","iopub.status.idle":"2024-01-11T09:50:44.728162Z","shell.execute_reply.started":"2024-01-11T09:50:44.720305Z","shell.execute_reply":"2024-01-11T09:50:44.727104Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['type'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:46.604988Z","iopub.execute_input":"2024-01-11T09:50:46.605388Z","iopub.status.idle":"2024-01-11T09:50:46.615754Z","shell.execute_reply.started":"2024-01-11T09:50:46.605356Z","shell.execute_reply":"2024-01-11T09:50:46.614441Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['type'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:48.06331Z","iopub.execute_input":"2024-01-11T09:50:48.063704Z","iopub.status.idle":"2024-01-11T09:50:48.074809Z","shell.execute_reply.started":"2024-01-11T09:50:48.063666Z","shell.execute_reply":"2024-01-11T09:50:48.073378Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['type'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:49.595355Z","iopub.execute_input":"2024-01-11T09:50:49.595737Z","iopub.status.idle":"2024-01-11T09:50:49.605446Z","shell.execute_reply.started":"2024-01-11T09:50:49.595705Z","shell.execute_reply":"2024-01-11T09:50:49.603954Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"adjusted_type = df['type'].apply(lambda x:x.split(',')).reset_index().explode(\"type\")\nadjusted_type = adjusted_type['type'].apply(lambda x:x.strip().lower()).reset_index()\nadjusted_type['type'] = adjusted_type['type'].replace('calls','call')\nadjusted_type['type'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:51.030696Z","iopub.execute_input":"2024-01-11T09:50:51.031183Z","iopub.status.idle":"2024-01-11T09:50:51.110433Z","shell.execute_reply.started":"2024-01-11T09:50:51.031147Z","shell.execute_reply":"2024-01-11T09:50:51.109107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['elevation'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:53.336953Z","iopub.execute_input":"2024-01-11T09:50:53.337382Z","iopub.status.idle":"2024-01-11T09:50:53.349984Z","shell.execute_reply.started":"2024-01-11T09:50:53.33735Z","shell.execute_reply":"2024-01-11T09:50:53.348387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['elevation'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:54.925585Z","iopub.execute_input":"2024-01-11T09:50:54.92602Z","iopub.status.idle":"2024-01-11T09:50:54.939055Z","shell.execute_reply.started":"2024-01-11T09:50:54.925988Z","shell.execute_reply":"2024-01-11T09:50:54.937596Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['elevation'] = df['elevation'].replace(['? m','Unknown m',' m'],'99999') ","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:56.471467Z","iopub.execute_input":"2024-01-11T09:50:56.471937Z","iopub.status.idle":"2024-01-11T09:50:56.486519Z","shell.execute_reply.started":"2024-01-11T09:50:56.471904Z","shell.execute_reply":"2024-01-11T09:50:56.48548Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['elevation'] = df['elevation'].str.replace(',','')","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:50:58.251426Z","iopub.execute_input":"2024-01-11T09:50:58.251874Z","iopub.status.idle":"2024-01-11T09:50:58.271678Z","shell.execute_reply.started":"2024-01-11T09:50:58.25184Z","shell.execute_reply":"2024-01-11T09:50:58.270215Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['elevation'] = df['elevation'].str.replace('.','')","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:00.109543Z","iopub.execute_input":"2024-01-11T09:51:00.110051Z","iopub.status.idle":"2024-01-11T09:51:00.134481Z","shell.execute_reply.started":"2024-01-11T09:51:00.110014Z","shell.execute_reply":"2024-01-11T09:51:00.132975Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['elevation'] = df['elevation'].str.replace('m','')","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:01.507763Z","iopub.execute_input":"2024-01-11T09:51:01.508267Z","iopub.status.idle":"2024-01-11T09:51:01.532875Z","shell.execute_reply.started":"2024-01-11T09:51:01.508229Z","shell.execute_reply":"2024-01-11T09:51:01.53165Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bitrate_of_mp3'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:05.185682Z","iopub.execute_input":"2024-01-11T09:51:05.186145Z","iopub.status.idle":"2024-01-11T09:51:05.19674Z","shell.execute_reply.started":"2024-01-11T09:51:05.186111Z","shell.execute_reply":"2024-01-11T09:51:05.195475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bitrate_of_mp3'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:06.609598Z","iopub.execute_input":"2024-01-11T09:51:06.610061Z","iopub.status.idle":"2024-01-11T09:51:06.62452Z","shell.execute_reply.started":"2024-01-11T09:51:06.610028Z","shell.execute_reply":"2024-01-11T09:51:06.623059Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bitrate_of_mp3'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:07.99454Z","iopub.execute_input":"2024-01-11T09:51:07.994992Z","iopub.status.idle":"2024-01-11T09:51:08.01271Z","shell.execute_reply.started":"2024-01-11T09:51:07.994959Z","shell.execute_reply":"2024-01-11T09:51:08.011452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[df['bitrate_of_mp3']=='3']","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:09.354304Z","iopub.execute_input":"2024-01-11T09:51:09.354946Z","iopub.status.idle":"2024-01-11T09:51:09.379369Z","shell.execute_reply.started":"2024-01-11T09:51:09.354901Z","shell.execute_reply":"2024-01-11T09:51:09.378144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop(df[df['bitrate_of_mp3']=='3'].index,inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:10.849706Z","iopub.execute_input":"2024-01-11T09:51:10.851125Z","iopub.status.idle":"2024-01-11T09:51:10.875857Z","shell.execute_reply.started":"2024-01-11T09:51:10.85107Z","shell.execute_reply":"2024-01-11T09:51:10.874308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[df['bitrate_of_mp3'].isna()]","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:14.667669Z","iopub.execute_input":"2024-01-11T09:51:14.668224Z","iopub.status.idle":"2024-01-11T09:51:14.705694Z","shell.execute_reply.started":"2024-01-11T09:51:14.668186Z","shell.execute_reply":"2024-01-11T09:51:14.704347Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bitrate_of_mp3'].fillna('128000 (bps)')","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:16.082776Z","iopub.execute_input":"2024-01-11T09:51:16.083271Z","iopub.status.idle":"2024-01-11T09:51:16.097329Z","shell.execute_reply.started":"2024-01-11T09:51:16.083236Z","shell.execute_reply":"2024-01-11T09:51:16.096121Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['bitrate_of_mp3'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:17.515073Z","iopub.execute_input":"2024-01-11T09:51:17.515464Z","iopub.status.idle":"2024-01-11T09:51:17.527328Z","shell.execute_reply.started":"2024-01-11T09:51:17.515433Z","shell.execute_reply":"2024-01-11T09:51:17.526009Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:19.032158Z","iopub.execute_input":"2024-01-11T09:51:19.032578Z","iopub.status.idle":"2024-01-11T09:51:19.041196Z","shell.execute_reply.started":"2024-01-11T09:51:19.032547Z","shell.execute_reply":"2024-01-11T09:51:19.03988Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['file_type'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:20.673725Z","iopub.execute_input":"2024-01-11T09:51:20.674648Z","iopub.status.idle":"2024-01-11T09:51:20.686951Z","shell.execute_reply.started":"2024-01-11T09:51:20.674605Z","shell.execute_reply":"2024-01-11T09:51:20.684542Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['file_type'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:22.210626Z","iopub.execute_input":"2024-01-11T09:51:22.211124Z","iopub.status.idle":"2024-01-11T09:51:22.220884Z","shell.execute_reply.started":"2024-01-11T09:51:22.211088Z","shell.execute_reply":"2024-01-11T09:51:22.219689Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['volume'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:23.777448Z","iopub.execute_input":"2024-01-11T09:51:23.778136Z","iopub.status.idle":"2024-01-11T09:51:23.789958Z","shell.execute_reply.started":"2024-01-11T09:51:23.778101Z","shell.execute_reply":"2024-01-11T09:51:23.788468Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['volume'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:25.285356Z","iopub.execute_input":"2024-01-11T09:51:25.286061Z","iopub.status.idle":"2024-01-11T09:51:25.295488Z","shell.execute_reply.started":"2024-01-11T09:51:25.286027Z","shell.execute_reply":"2024-01-11T09:51:25.294398Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['background'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:26.855296Z","iopub.execute_input":"2024-01-11T09:51:26.855936Z","iopub.status.idle":"2024-01-11T09:51:26.86746Z","shell.execute_reply.started":"2024-01-11T09:51:26.855894Z","shell.execute_reply":"2024-01-11T09:51:26.86589Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('background',axis=1,inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:28.364593Z","iopub.execute_input":"2024-01-11T09:51:28.365068Z","iopub.status.idle":"2024-01-11T09:51:28.384109Z","shell.execute_reply.started":"2024-01-11T09:51:28.365034Z","shell.execute_reply":"2024-01-11T09:51:28.382579Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['xc_id'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:30.357744Z","iopub.execute_input":"2024-01-11T09:51:30.35903Z","iopub.status.idle":"2024-01-11T09:51:30.369829Z","shell.execute_reply.started":"2024-01-11T09:51:30.358978Z","shell.execute_reply":"2024-01-11T09:51:30.368059Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['xc_id'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:31.790768Z","iopub.execute_input":"2024-01-11T09:51:31.791286Z","iopub.status.idle":"2024-01-11T09:51:31.80236Z","shell.execute_reply.started":"2024-01-11T09:51:31.791247Z","shell.execute_reply":"2024-01-11T09:51:31.800686Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['xc_id'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:33.29569Z","iopub.execute_input":"2024-01-11T09:51:33.297312Z","iopub.status.idle":"2024-01-11T09:51:33.306694Z","shell.execute_reply.started":"2024-01-11T09:51:33.29726Z","shell.execute_reply":"2024-01-11T09:51:33.305315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('xc_id',axis=1,inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:34.574715Z","iopub.execute_input":"2024-01-11T09:51:34.57512Z","iopub.status.idle":"2024-01-11T09:51:34.590405Z","shell.execute_reply.started":"2024-01-11T09:51:34.57509Z","shell.execute_reply":"2024-01-11T09:51:34.589085Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['country'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:37.069997Z","iopub.execute_input":"2024-01-11T09:51:37.070398Z","iopub.status.idle":"2024-01-11T09:51:37.081384Z","shell.execute_reply.started":"2024-01-11T09:51:37.070368Z","shell.execute_reply":"2024-01-11T09:51:37.080013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['country'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:38.925295Z","iopub.execute_input":"2024-01-11T09:51:38.925686Z","iopub.status.idle":"2024-01-11T09:51:38.936558Z","shell.execute_reply.started":"2024-01-11T09:51:38.925656Z","shell.execute_reply":"2024-01-11T09:51:38.934876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['author'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:40.666439Z","iopub.execute_input":"2024-01-11T09:51:40.666906Z","iopub.status.idle":"2024-01-11T09:51:40.683753Z","shell.execute_reply.started":"2024-01-11T09:51:40.666874Z","shell.execute_reply":"2024-01-11T09:51:40.682296Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['author'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:42.147248Z","iopub.execute_input":"2024-01-11T09:51:42.147746Z","iopub.status.idle":"2024-01-11T09:51:42.157783Z","shell.execute_reply.started":"2024-01-11T09:51:42.147709Z","shell.execute_reply":"2024-01-11T09:51:42.156575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['recordist'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:43.449329Z","iopub.execute_input":"2024-01-11T09:51:43.449835Z","iopub.status.idle":"2024-01-11T09:51:43.460109Z","shell.execute_reply.started":"2024-01-11T09:51:43.44978Z","shell.execute_reply":"2024-01-11T09:51:43.458864Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[df['author']!=df['recordist']]","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:44.780359Z","iopub.execute_input":"2024-01-11T09:51:44.780854Z","iopub.status.idle":"2024-01-11T09:51:44.804189Z","shell.execute_reply.started":"2024-01-11T09:51:44.780817Z","shell.execute_reply":"2024-01-11T09:51:44.802879Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('recordist',axis=1,inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:45.953666Z","iopub.execute_input":"2024-01-11T09:51:45.954196Z","iopub.status.idle":"2024-01-11T09:51:45.971606Z","shell.execute_reply.started":"2024-01-11T09:51:45.95416Z","shell.execute_reply":"2024-01-11T09:51:45.970035Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['length'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:47.660002Z","iopub.execute_input":"2024-01-11T09:51:47.660402Z","iopub.status.idle":"2024-01-11T09:51:47.670093Z","shell.execute_reply.started":"2024-01-11T09:51:47.660371Z","shell.execute_reply":"2024-01-11T09:51:47.669232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['length'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:48.884151Z","iopub.execute_input":"2024-01-11T09:51:48.885734Z","iopub.status.idle":"2024-01-11T09:51:48.895847Z","shell.execute_reply.started":"2024-01-11T09:51:48.885692Z","shell.execute_reply":"2024-01-11T09:51:48.894313Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['min_value'] = df['length'].str.extract(r'(\\d+)')\ndf['min_value'] = pd.to_numeric(df['min_value'],errors = 'coerce')\ndf['max_value'] = df['length'].str.extract(r'-(\\d+)')\ndf['max_value'] = pd.to_numeric(df['max_value'],errors = 'coerce')\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:50.208733Z","iopub.execute_input":"2024-01-11T09:51:50.209157Z","iopub.status.idle":"2024-01-11T09:51:50.330505Z","shell.execute_reply.started":"2024-01-11T09:51:50.209126Z","shell.execute_reply":"2024-01-11T09:51:50.3293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['min_value'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:51.549377Z","iopub.execute_input":"2024-01-11T09:51:51.549839Z","iopub.status.idle":"2024-01-11T09:51:51.556959Z","shell.execute_reply.started":"2024-01-11T09:51:51.549805Z","shell.execute_reply":"2024-01-11T09:51:51.556151Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['max_value'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:52.999091Z","iopub.execute_input":"2024-01-11T09:51:52.999815Z","iopub.status.idle":"2024-01-11T09:51:53.008884Z","shell.execute_reply.started":"2024-01-11T09:51:52.999758Z","shell.execute_reply":"2024-01-11T09:51:53.007304Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['time'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:54.520259Z","iopub.execute_input":"2024-01-11T09:51:54.52148Z","iopub.status.idle":"2024-01-11T09:51:54.533319Z","shell.execute_reply.started":"2024-01-11T09:51:54.521441Z","shell.execute_reply":"2024-01-11T09:51:54.53197Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['time'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:56.083989Z","iopub.execute_input":"2024-01-11T09:51:56.084362Z","iopub.status.idle":"2024-01-11T09:51:56.093544Z","shell.execute_reply.started":"2024-01-11T09:51:56.084333Z","shell.execute_reply":"2024-01-11T09:51:56.092546Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['time'].nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:57.642866Z","iopub.execute_input":"2024-01-11T09:51:57.643319Z","iopub.status.idle":"2024-01-11T09:51:57.653894Z","shell.execute_reply.started":"2024-01-11T09:51:57.643285Z","shell.execute_reply":"2024-01-11T09:51:57.652235Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['license'].isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:51:58.946529Z","iopub.execute_input":"2024-01-11T09:51:58.946985Z","iopub.status.idle":"2024-01-11T09:51:58.958393Z","shell.execute_reply.started":"2024-01-11T09:51:58.946952Z","shell.execute_reply":"2024-01-11T09:51:58.956731Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['license'].unique()\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:00.297565Z","iopub.execute_input":"2024-01-11T09:52:00.29807Z","iopub.status.idle":"2024-01-11T09:52:00.309018Z","shell.execute_reply.started":"2024-01-11T09:52:00.298031Z","shell.execute_reply":"2024-01-11T09:52:00.30777Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"le = LabelEncoder()\ndf['license'] = le.fit_transform(df['license'])\ndf['license']","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:01.657697Z","iopub.execute_input":"2024-01-11T09:52:01.658181Z","iopub.status.idle":"2024-01-11T09:52:01.677723Z","shell.execute_reply.started":"2024-01-11T09:52:01.658145Z","shell.execute_reply":"2024-01-11T09:52:01.675892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:02.814312Z","iopub.execute_input":"2024-01-11T09:52:02.815125Z","iopub.status.idle":"2024-01-11T09:52:02.824504Z","shell.execute_reply.started":"2024-01-11T09:52:02.815082Z","shell.execute_reply":"2024-01-11T09:52:02.823129Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:04.056936Z","iopub.execute_input":"2024-01-11T09:52:04.057341Z","iopub.status.idle":"2024-01-11T09:52:04.085613Z","shell.execute_reply.started":"2024-01-11T09:52:04.057311Z","shell.execute_reply":"2024-01-11T09:52:04.083977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.set(rc={'figure.figsize':(15,5)})\nsns.countplot(x = 'rating',hue='playback_used',data=df,palette='hls')\nplt.title('Rating vs Playback used')\nplt.xlabel('Rating AND Playback used')\nplt.ylabel('count')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:05.755016Z","iopub.execute_input":"2024-01-11T09:52:05.755483Z","iopub.status.idle":"2024-01-11T09:52:06.376141Z","shell.execute_reply.started":"2024-01-11T09:52:05.755446Z","shell.execute_reply":"2024-01-11T09:52:06.374781Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.set(rc={'figure.figsize':(15,5)})\nsns.countplot(x = 'rating',hue='pitch',data=df,palette='Set2')\nplt.title('Rating vs Pitch')\nplt.xlabel('Rating AND Pitch')\nplt.ylabel('count')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:07.716741Z","iopub.execute_input":"2024-01-11T09:52:07.71798Z","iopub.status.idle":"2024-01-11T09:52:08.433087Z","shell.execute_reply.started":"2024-01-11T09:52:07.717934Z","shell.execute_reply":"2024-01-11T09:52:08.43171Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"numbrs = df['pitch'].value_counts()\nplt.figure(figsize=(8,8))\nplt.pie(numbrs,labels=None,autopct='%1.1f%%')\nplt.title('Pitch Distribution')\nplt.legend(numbrs.index,title='Categories',loc='upper right',bbox_to_anchor=(1,0,0.5,1))\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:09.637686Z","iopub.execute_input":"2024-01-11T09:52:09.638245Z","iopub.status.idle":"2024-01-11T09:52:09.974834Z","shell.execute_reply.started":"2024-01-11T09:52:09.638204Z","shell.execute_reply":"2024-01-11T09:52:09.973341Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import librosa\nimport librosa.display\nimport soundfile as sf\nimport IPython.display as ipd","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:11.484683Z","iopub.execute_input":"2024-01-11T09:52:11.485139Z","iopub.status.idle":"2024-01-11T09:52:11.573948Z","shell.execute_reply.started":"2024-01-11T09:52:11.485105Z","shell.execute_reply":"2024-01-11T09:52:11.572656Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a1 = \"/kaggle/input/birdsong-recognition/train_audio/ameavo/XC178760.mp3\"\na2 = \"/kaggle/input/birdsong-recognition/train_audio/ameavo/XC178761.mp3\"\nb1 = \"/kaggle/input/birdsong-recognition/train_audio/calgul/XC161035.mp3\"\nb2 = \"/kaggle/input/birdsong-recognition/train_audio/calgul/XC161036.mp3\"\nc1 = \"/kaggle/input/birdsong-recognition/train_audio/fiscro/XC130581.mp3\"\nc2 = \"/kaggle/input/birdsong-recognition/train_audio/fiscro/XC130579.mp3\"\nd1 = \"/kaggle/input/birdsong-recognition/train_audio/magwar/XC111149.mp3\"\nd2 = \"/kaggle/input/birdsong-recognition/train_audio/magwar/XC134515.mp3\"\ne1 = \"/kaggle/input/birdsong-recognition/train_audio/swahaw/XC325718.mp3\"\ne2 = \"/kaggle/input/birdsong-recognition/train_audio/swahaw/XC267710.mp3\"","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:13.169968Z","iopub.execute_input":"2024-01-11T09:52:13.170503Z","iopub.status.idle":"2024-01-11T09:52:13.178773Z","shell.execute_reply.started":"2024-01-11T09:52:13.170447Z","shell.execute_reply":"2024-01-11T09:52:13.177213Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y1,sr1 = librosa.load(a1)\ny2,sr2 = librosa.load(a2)\ny3,sr3 = librosa.load(b1)\ny4,sr4 = librosa.load(b2)\ny5,sr5 = librosa.load(c1)\ny6,sr6 = librosa.load(c2)\ny7,sr7 = librosa.load(d1)\ny8,sr8 = librosa.load(d2)\ny9,sr9 = librosa.load(e1)\ny10,sr10 = librosa.load(e2)\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:15.269045Z","iopub.execute_input":"2024-01-11T09:52:15.269546Z","iopub.status.idle":"2024-01-11T09:52:30.36475Z","shell.execute_reply.started":"2024-01-11T09:52:15.269507Z","shell.execute_reply":"2024-01-11T09:52:30.363354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y1,rate = sr1)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:34.83827Z","iopub.execute_input":"2024-01-11T09:52:34.839369Z","iopub.status.idle":"2024-01-11T09:52:34.886227Z","shell.execute_reply.started":"2024-01-11T09:52:34.839269Z","shell.execute_reply":"2024-01-11T09:52:34.884856Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y2,rate = sr2)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:36.81534Z","iopub.execute_input":"2024-01-11T09:52:36.815733Z","iopub.status.idle":"2024-01-11T09:52:36.858741Z","shell.execute_reply.started":"2024-01-11T09:52:36.815702Z","shell.execute_reply":"2024-01-11T09:52:36.855183Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y3,rate = sr3)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:38.568489Z","iopub.execute_input":"2024-01-11T09:52:38.569947Z","iopub.status.idle":"2024-01-11T09:52:38.615483Z","shell.execute_reply.started":"2024-01-11T09:52:38.569895Z","shell.execute_reply":"2024-01-11T09:52:38.614324Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y4,rate = sr4)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:40.355373Z","iopub.execute_input":"2024-01-11T09:52:40.355902Z","iopub.status.idle":"2024-01-11T09:52:40.425823Z","shell.execute_reply.started":"2024-01-11T09:52:40.355863Z","shell.execute_reply":"2024-01-11T09:52:40.42427Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y5,rate = sr5)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:42.120652Z","iopub.execute_input":"2024-01-11T09:52:42.122275Z","iopub.status.idle":"2024-01-11T09:52:42.149226Z","shell.execute_reply.started":"2024-01-11T09:52:42.122208Z","shell.execute_reply":"2024-01-11T09:52:42.147736Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y6,rate = sr6)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:43.677516Z","iopub.execute_input":"2024-01-11T09:52:43.6782Z","iopub.status.idle":"2024-01-11T09:52:43.709432Z","shell.execute_reply.started":"2024-01-11T09:52:43.678156Z","shell.execute_reply":"2024-01-11T09:52:43.708135Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y7,rate = sr7)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:45.581457Z","iopub.execute_input":"2024-01-11T09:52:45.581978Z","iopub.status.idle":"2024-01-11T09:52:45.635366Z","shell.execute_reply.started":"2024-01-11T09:52:45.581939Z","shell.execute_reply":"2024-01-11T09:52:45.632227Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y8,rate = sr8)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:47.768175Z","iopub.execute_input":"2024-01-11T09:52:47.769426Z","iopub.status.idle":"2024-01-11T09:52:47.849438Z","shell.execute_reply.started":"2024-01-11T09:52:47.769385Z","shell.execute_reply":"2024-01-11T09:52:47.847621Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y9,rate = sr9)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:50.331069Z","iopub.execute_input":"2024-01-11T09:52:50.331544Z","iopub.status.idle":"2024-01-11T09:52:50.423677Z","shell.execute_reply.started":"2024-01-11T09:52:50.3315Z","shell.execute_reply":"2024-01-11T09:52:50.421719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipd.Audio(y10,rate = sr10)","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:53.050034Z","iopub.execute_input":"2024-01-11T09:52:53.050466Z","iopub.status.idle":"2024-01-11T09:52:53.129229Z","shell.execute_reply.started":"2024-01-11T09:52:53.050435Z","shell.execute_reply":"2024-01-11T09:52:53.128293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y1)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:55.43317Z","iopub.execute_input":"2024-01-11T09:52:55.433902Z","iopub.status.idle":"2024-01-11T09:52:56.370354Z","shell.execute_reply.started":"2024-01-11T09:52:55.433864Z","shell.execute_reply":"2024-01-11T09:52:56.369069Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y2)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:52:57.723491Z","iopub.execute_input":"2024-01-11T09:52:57.724014Z","iopub.status.idle":"2024-01-11T09:52:58.783144Z","shell.execute_reply.started":"2024-01-11T09:52:57.723974Z","shell.execute_reply":"2024-01-11T09:52:58.7819Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y3)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:00.507512Z","iopub.execute_input":"2024-01-11T09:53:00.51021Z","iopub.status.idle":"2024-01-11T09:53:01.303926Z","shell.execute_reply.started":"2024-01-11T09:53:00.51015Z","shell.execute_reply":"2024-01-11T09:53:01.302648Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y4)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:03.571081Z","iopub.execute_input":"2024-01-11T09:53:03.571544Z","iopub.status.idle":"2024-01-11T09:53:04.407714Z","shell.execute_reply.started":"2024-01-11T09:53:03.571508Z","shell.execute_reply":"2024-01-11T09:53:04.406532Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y5)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:05.923019Z","iopub.execute_input":"2024-01-11T09:53:05.924153Z","iopub.status.idle":"2024-01-11T09:53:06.964106Z","shell.execute_reply.started":"2024-01-11T09:53:05.924104Z","shell.execute_reply":"2024-01-11T09:53:06.962886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y6)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:08.520682Z","iopub.execute_input":"2024-01-11T09:53:08.521559Z","iopub.status.idle":"2024-01-11T09:53:09.218745Z","shell.execute_reply.started":"2024-01-11T09:53:08.521519Z","shell.execute_reply":"2024-01-11T09:53:09.217598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y7)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:11.219559Z","iopub.execute_input":"2024-01-11T09:53:11.22027Z","iopub.status.idle":"2024-01-11T09:53:12.01378Z","shell.execute_reply.started":"2024-01-11T09:53:11.220222Z","shell.execute_reply":"2024-01-11T09:53:12.012523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y8)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:14.059907Z","iopub.execute_input":"2024-01-11T09:53:14.060403Z","iopub.status.idle":"2024-01-11T09:53:14.892884Z","shell.execute_reply.started":"2024-01-11T09:53:14.060354Z","shell.execute_reply":"2024-01-11T09:53:14.89168Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y9)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:16.510303Z","iopub.execute_input":"2024-01-11T09:53:16.511094Z","iopub.status.idle":"2024-01-11T09:53:17.565405Z","shell.execute_reply.started":"2024-01-11T09:53:16.511054Z","shell.execute_reply":"2024-01-11T09:53:17.564545Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(y10)\nplt.ylabel(\"Amplitude\")\nplt.xlabel(\"Time\")","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:19.046738Z","iopub.execute_input":"2024-01-11T09:53:19.048138Z","iopub.status.idle":"2024-01-11T09:53:19.969826Z","shell.execute_reply.started":"2024-01-11T09:53:19.048099Z","shell.execute_reply":"2024-01-11T09:53:19.968387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y1, hop_length=256)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr1, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:21.511786Z","iopub.execute_input":"2024-01-11T09:53:21.512336Z","iopub.status.idle":"2024-01-11T09:53:24.165137Z","shell.execute_reply.started":"2024-01-11T09:53:21.51229Z","shell.execute_reply":"2024-01-11T09:53:24.164117Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y2, hop_length=256)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr2, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:26.000482Z","iopub.execute_input":"2024-01-11T09:53:26.002203Z","iopub.status.idle":"2024-01-11T09:53:28.896104Z","shell.execute_reply.started":"2024-01-11T09:53:26.002146Z","shell.execute_reply":"2024-01-11T09:53:28.894904Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y3, hop_length=256)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr3, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:30.896115Z","iopub.execute_input":"2024-01-11T09:53:30.897379Z","iopub.status.idle":"2024-01-11T09:53:33.982374Z","shell.execute_reply.started":"2024-01-11T09:53:30.897338Z","shell.execute_reply":"2024-01-11T09:53:33.980959Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y4, hop_length=256)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr4, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:35.915212Z","iopub.execute_input":"2024-01-11T09:53:35.915654Z","iopub.status.idle":"2024-01-11T09:53:40.599211Z","shell.execute_reply.started":"2024-01-11T09:53:35.915622Z","shell.execute_reply":"2024-01-11T09:53:40.597734Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y5, hop_length=256)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr5, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:42.454053Z","iopub.execute_input":"2024-01-11T09:53:42.454472Z","iopub.status.idle":"2024-01-11T09:53:44.140911Z","shell.execute_reply.started":"2024-01-11T09:53:42.454442Z","shell.execute_reply":"2024-01-11T09:53:44.139349Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y6, hop_length=256)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr6, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:46.403174Z","iopub.execute_input":"2024-01-11T09:53:46.403593Z","iopub.status.idle":"2024-01-11T09:53:48.385641Z","shell.execute_reply.started":"2024-01-11T09:53:46.403562Z","shell.execute_reply":"2024-01-11T09:53:48.384211Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y7, hop_length=512)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr7, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:50.512702Z","iopub.execute_input":"2024-01-11T09:53:50.513139Z","iopub.status.idle":"2024-01-11T09:53:52.605689Z","shell.execute_reply.started":"2024-01-11T09:53:50.513108Z","shell.execute_reply":"2024-01-11T09:53:52.604356Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y8, hop_length=512)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr8, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:53:56.009546Z","iopub.execute_input":"2024-01-11T09:53:56.010069Z","iopub.status.idle":"2024-01-11T09:53:58.731626Z","shell.execute_reply.started":"2024-01-11T09:53:56.010031Z","shell.execute_reply":"2024-01-11T09:53:58.730102Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y9, hop_length=512)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr9, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:00.588499Z","iopub.execute_input":"2024-01-11T09:54:00.588968Z","iopub.status.idle":"2024-01-11T09:54:03.822713Z","shell.execute_reply.started":"2024-01-11T09:54:00.588932Z","shell.execute_reply":"2024-01-11T09:54:03.821487Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"D = librosa.amplitude_to_db(np.abs(librosa.stft(y10, hop_length=512)), ref=np.max)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(D, sr=sr10, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('Spectrogram of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:06.194384Z","iopub.execute_input":"2024-01-11T09:54:06.19525Z","iopub.status.idle":"2024-01-11T09:54:09.296737Z","shell.execute_reply.started":"2024-01-11T09:54:06.195203Z","shell.execute_reply":"2024-01-11T09:54:09.295862Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y1, sr=sr1, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:11.285401Z","iopub.execute_input":"2024-01-11T09:54:11.287021Z","iopub.status.idle":"2024-01-11T09:54:15.539612Z","shell.execute_reply.started":"2024-01-11T09:54:11.286968Z","shell.execute_reply":"2024-01-11T09:54:15.538138Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y2, sr=sr2, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:17.759Z","iopub.execute_input":"2024-01-11T09:54:17.75944Z","iopub.status.idle":"2024-01-11T09:54:20.565306Z","shell.execute_reply.started":"2024-01-11T09:54:17.759404Z","shell.execute_reply":"2024-01-11T09:54:20.563842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y3, sr=sr3, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:22.497817Z","iopub.execute_input":"2024-01-11T09:54:22.498297Z","iopub.status.idle":"2024-01-11T09:54:25.835176Z","shell.execute_reply.started":"2024-01-11T09:54:22.498263Z","shell.execute_reply":"2024-01-11T09:54:25.833725Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y4, sr=sr4, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:27.641966Z","iopub.execute_input":"2024-01-11T09:54:27.642481Z","iopub.status.idle":"2024-01-11T09:54:32.48927Z","shell.execute_reply.started":"2024-01-11T09:54:27.642442Z","shell.execute_reply":"2024-01-11T09:54:32.488046Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y5, sr=sr5, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:34.305186Z","iopub.execute_input":"2024-01-11T09:54:34.306063Z","iopub.status.idle":"2024-01-11T09:54:36.156434Z","shell.execute_reply.started":"2024-01-11T09:54:34.306014Z","shell.execute_reply":"2024-01-11T09:54:36.155275Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y6, sr=sr6, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:38.382929Z","iopub.execute_input":"2024-01-11T09:54:38.383366Z","iopub.status.idle":"2024-01-11T09:54:40.400223Z","shell.execute_reply.started":"2024-01-11T09:54:38.383333Z","shell.execute_reply":"2024-01-11T09:54:40.399287Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y7, sr=sr7, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:42.095673Z","iopub.execute_input":"2024-01-11T09:54:42.097189Z","iopub.status.idle":"2024-01-11T09:54:46.124966Z","shell.execute_reply.started":"2024-01-11T09:54:42.097142Z","shell.execute_reply":"2024-01-11T09:54:46.124021Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y8, sr=sr8, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:47.797927Z","iopub.execute_input":"2024-01-11T09:54:47.798424Z","iopub.status.idle":"2024-01-11T09:54:52.429273Z","shell.execute_reply.started":"2024-01-11T09:54:47.798387Z","shell.execute_reply":"2024-01-11T09:54:52.428107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y9, sr=sr9, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:54:54.313688Z","iopub.execute_input":"2024-01-11T09:54:54.314233Z","iopub.status.idle":"2024-01-11T09:54:59.912947Z","shell.execute_reply.started":"2024-01-11T09:54:54.314195Z","shell.execute_reply":"2024-01-11T09:54:59.911555Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mel_signal = librosa.feature.melspectrogram(y=y10, sr=sr10, n_fft=1024, hop_length=64)\nmel_spect = librosa.power_to_db(np.abs(mel_signal), ref=np.max)\nplt.figure(figsize=(7, 6))\nlibrosa.display.specshow(mel_spect, y_axis='mel', fmax=8000, x_axis='time');\nplt.title('Mel Spectrogram');\nplt.colorbar(format='%+2.0f dB');","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:02.094151Z","iopub.execute_input":"2024-01-11T09:55:02.094646Z","iopub.status.idle":"2024-01-11T09:55:07.717418Z","shell.execute_reply.started":"2024-01-11T09:55:02.094608Z","shell.execute_reply":"2024-01-11T09:55:07.715681Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y1,sr=sr1)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr1, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:09.860093Z","iopub.execute_input":"2024-01-11T09:55:09.861711Z","iopub.status.idle":"2024-01-11T09:55:10.620811Z","shell.execute_reply.started":"2024-01-11T09:55:09.861655Z","shell.execute_reply":"2024-01-11T09:55:10.619597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y2,sr=sr2)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr2, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:12.186907Z","iopub.execute_input":"2024-01-11T09:55:12.188314Z","iopub.status.idle":"2024-01-11T09:55:12.945441Z","shell.execute_reply.started":"2024-01-11T09:55:12.18827Z","shell.execute_reply":"2024-01-11T09:55:12.944214Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y3,sr=sr3)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr3, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:14.527487Z","iopub.execute_input":"2024-01-11T09:55:14.52795Z","iopub.status.idle":"2024-01-11T09:55:15.305585Z","shell.execute_reply.started":"2024-01-11T09:55:14.527914Z","shell.execute_reply":"2024-01-11T09:55:15.304158Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y4,sr=sr4)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr4, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:16.876165Z","iopub.execute_input":"2024-01-11T09:55:16.876626Z","iopub.status.idle":"2024-01-11T09:55:17.750229Z","shell.execute_reply.started":"2024-01-11T09:55:16.876593Z","shell.execute_reply":"2024-01-11T09:55:17.74889Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y5,sr=sr5)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr5, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:19.448196Z","iopub.execute_input":"2024-01-11T09:55:19.448741Z","iopub.status.idle":"2024-01-11T09:55:20.123265Z","shell.execute_reply.started":"2024-01-11T09:55:19.448705Z","shell.execute_reply":"2024-01-11T09:55:20.12185Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y6,sr=sr6)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr6, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:21.651316Z","iopub.execute_input":"2024-01-11T09:55:21.651828Z","iopub.status.idle":"2024-01-11T09:55:22.335581Z","shell.execute_reply.started":"2024-01-11T09:55:21.651775Z","shell.execute_reply":"2024-01-11T09:55:22.334363Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y7,sr=sr7)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr7, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:24.272349Z","iopub.execute_input":"2024-01-11T09:55:24.272836Z","iopub.status.idle":"2024-01-11T09:55:25.060556Z","shell.execute_reply.started":"2024-01-11T09:55:24.272783Z","shell.execute_reply":"2024-01-11T09:55:25.059387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y8,sr=sr8)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr8, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:26.687169Z","iopub.execute_input":"2024-01-11T09:55:26.687924Z","iopub.status.idle":"2024-01-11T09:55:27.527863Z","shell.execute_reply.started":"2024-01-11T09:55:26.687888Z","shell.execute_reply":"2024-01-11T09:55:27.526582Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y9,sr=sr9)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr9, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:29.264027Z","iopub.execute_input":"2024-01-11T09:55:29.264439Z","iopub.status.idle":"2024-01-11T09:55:30.11792Z","shell.execute_reply.started":"2024-01-11T09:55:29.264407Z","shell.execute_reply":"2024-01-11T09:55:30.117049Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfcc = librosa.feature.mfcc(y=y10,sr=sr10)\nplt.figure(figsize=(8, 4))\nlibrosa.display.specshow(mfcc, sr=sr10, x_axis='time', y_axis='log')\nplt.colorbar(format='%+2.0f dB')\nplt.title('MFCC of the Audio Signal')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T09:55:31.865697Z","iopub.execute_input":"2024-01-11T09:55:31.866515Z","iopub.status.idle":"2024-01-11T09:55:32.730579Z","shell.execute_reply.started":"2024-01-11T09:55:31.866472Z","shell.execute_reply":"2024-01-11T09:55:32.7293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# By doing the feature extraction we see that mel-spectrogram and mfcc are both very good\n# for using in the model. I prefer to use mel-spectrogram.","metadata":{"execution":{"iopub.status.busy":"2024-01-09T17:44:26.711875Z","iopub.execute_input":"2024-01-09T17:44:26.71329Z","iopub.status.idle":"2024-01-09T17:44:26.71822Z","shell.execute_reply.started":"2024-01-09T17:44:26.713224Z","shell.execute_reply":"2024-01-09T17:44:26.717Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import cv2\nimport audioread\nimport logging\nimport os\nimport random\nimport time\nimport warnings\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.data as data\nfrom contextlib import contextmanager\nfrom pathlib import Path\nfrom typing import Optional\nfrom fastprogress import progress_bar\nfrom sklearn.metrics import f1_score\nfrom torchvision import models\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T10:12:42.127891Z","iopub.execute_input":"2024-01-11T10:12:42.128403Z","iopub.status.idle":"2024-01-11T10:12:42.135744Z","shell.execute_reply.started":"2024-01-11T10:12:42.128362Z","shell.execute_reply":"2024-01-11T10:12:42.134701Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def set_seed( seed: int=42):\n    random.seed(seed)\n    np.random.seed(seed)\n    os.environ[\"PYTHONHASHSEED\"] = str(seed)\n    torch.manual_seed(seed)\n    torch.cuda.manual_seed(seed)\n    torch.backends.cudnn.deterministic = True\n    torch.backendscudnn.benchmark\n    \ndef get_logger(out_file=None):\n    logger = logging.getLogger()\n    formatter = logging.Formatter(\"%(asctime)s - %(levelname)s - %(message)s\")\n    logger.handlers = []\n    logger.setLevel(logging.INFO)\n    handler = logging.StreamHandler()\n    handler.setFormatter(formatter)\n    handler.seLevel(logging.INFO)\n    logger.addHandler(handler)\n    \n    if out_file is not None:\n        fh = logging.FileHandler(out_file)\n        fh.setFormatter(formatter)\n        fh.setLevel(logging.INFO)\n        logger.addHandler(fh)\n    logger.info(\"logger set up\")\n    return logger\n\n@contextmanager\ndef timer(name: str, logger: Optional[logging.Logger] = None):\n    t0 = time.time()\n    msg = f\"[{name}] start\"\n    if logger is None:\n        print(msg)\n    else:\n        logger.info(msg)\n    yield\n    \n    msg = f\"[{name}] done in {time.time() - t0:.2f} s\"\n    if logger is None:\n        print(msg)\n    else:\n        logger.info(msg)\n        ","metadata":{"execution":{"iopub.status.busy":"2024-01-11T10:29:40.566297Z","iopub.execute_input":"2024-01-11T10:29:40.56708Z","iopub.status.idle":"2024-01-11T10:29:40.577783Z","shell.execute_reply.started":"2024-01-11T10:29:40.567042Z","shell.execute_reply":"2024-01-11T10:29:40.576914Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv(\"/kaggle/input/birdcall-check/test.csv\")\ntest_audio = \"/kaggle/input/birdcall-check/test_audio\"\ntest.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-11T10:58:10.073823Z","iopub.execute_input":"2024-01-11T10:58:10.075164Z","iopub.status.idle":"2024-01-11T10:58:10.10187Z","shell.execute_reply.started":"2024-01-11T10:58:10.075112Z","shell.execute_reply":"2024-01-11T10:58:10.100958Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class ResNet(nn.Module):\n    def __init__(self, base_model_name: str, pretrained=False,num_classes=264):\n        super().__init__()\n        base_model = models.__getattribute__(base_model_name)(pretrained=pretrained)\n        layers.append(nn.AdaptiveMaxPool2d(1))\n        seld.encoder = nn.sequential(*layers)\n        \n        in_features = base_model.fc.in_features\n        self.classifier = nn.Sequential(\n             nn.Linear(in_fetaures,1024, nn.ReLU(),nn.Dropout(p=0.2)),\n             nn.Linear(1024,1024), nn.ReLU(), nn.Dropout(p=02.),\n             nn.Linear(1024, num_classes))\n    def forward(self, x):\n        batch_size = x.size(0)\n        x = self.encoder(x).view(batch_size, -1)\n        x = self.classifier(x)\n        multiclass_proba = F.softmax(x, dim=1)\n        multilabel_proba = F.sigmoid(x)\n        return {\n            \"logits\": x,\n            \"multiclass_proba\": multiclass_proba,\n            \"multilabel_proba\": multilabel_proba,\n        }","metadata":{"execution":{"iopub.status.busy":"2024-01-11T10:58:13.833365Z","iopub.execute_input":"2024-01-11T10:58:13.833787Z","iopub.status.idle":"2024-01-11T10:58:13.845707Z","shell.execute_reply.started":"2024-01-11T10:58:13.833756Z","shell.execute_reply":"2024-01-11T10:58:13.844172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model_config = {\n    \"base_model_name\": \"resnet50\",\n    \"pretrained\": False,\n    \"num_classes\": 264,  \n}\nmelspectrogram_parameters = {\n    \"n_mels\": 128,\n    \"fmin\": 20,\n    \"fmax\":16000,\n}\nweights_path = \"/kaggle/input/birdcall-resnet50-init-weights/best.pth\"","metadata":{"execution":{"iopub.status.busy":"2024-01-11T11:05:02.549578Z","iopub.execute_input":"2024-01-11T11:05:02.550064Z","iopub.status.idle":"2024-01-11T11:05:02.556716Z","shell.execute_reply.started":"2024-01-11T11:05:02.55003Z","shell.execute_reply":"2024-01-11T11:05:02.555663Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/birdsong-recognition/train.csv\")\nunique = df['ebird_code'].unique()\nle = LabelEncoder()\nencoded_labels = le.fit_transform(unique)\nBIRD_CODE = dict(zip(unique, encoded_labels))\nINV_BIRD_CODE = {v :k for k , v in BIRD_CODE.items()}\n\n","metadata":{"execution":{"iopub.status.busy":"2024-01-11T11:13:33.606513Z","iopub.execute_input":"2024-01-11T11:13:33.606972Z","iopub.status.idle":"2024-01-11T11:13:33.954831Z","shell.execute_reply.started":"2024-01-11T11:13:33.606937Z","shell.execute_reply":"2024-01-11T11:13:33.953588Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def mono_to_color(X: np.ndarray,mean=None,std=None,norm_max=None,norm_min=None,eps=1e-6):\n    X = np.stack([X,X,X],axis=-1)\n    \n    mean = mean or X.mean()\n    X = X-mean\n    std = std or X.std()\n    Xstd = X/(std+eps)\n    _min, _max = Xstd.min(), Xstd.max()\n    norm_max = norm_max or max\n    norm_min = norm_min or min\n    \n    if((_max-_min) > eps):\n        V = Xstd\n        V[V< norm_min] = norm_min\n        V[V> norm_max] = norm_max\n        V = 255*(V-norm_min)/(norm_max-norm_min)\n        V = V.astype(np.uint8)\n    else:\n        V = np.zeros_like(Xstd, dtype=np.uitn8)\n    return V\n\nclass TestDataset(data.Daateset):\n    def __init__(self, df:pd.DataFrame, clip: np.ndarray,img_size=224,melspectrogram_parameters = {}):\n        self.df = df\n        self.clip = clip\n        self.img_size = img_size\n        self.melspectrogram_parameters = melspectrogram_parameters\n    def __len__(self):\n        return len(self.df)\n    def __getitem__(self, idx:int):\n        SR = 32000\n        sample = self.df.loc[idx,:]\n        site = sample.site\n        row_id = sample.row_id\n        \n        if site==\"site_3\":\n            y = self.clip.astype(np.float32)\n            len_y = len(y)\n            ","metadata":{"execution":{"iopub.status.busy":"2024-01-11T11:12:34.860468Z","iopub.execute_input":"2024-01-11T11:12:34.861851Z","iopub.status.idle":"2024-01-11T11:12:34.903069Z","shell.execute_reply.started":"2024-01-11T11:12:34.861774Z","shell.execute_reply":"2024-01-11T11:12:34.901216Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}