{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "VNUnhmXWe9qz" }, "source": [ "# Notebook for data preparation\n", "\n", "A.A. 2022-2023 - HUMAN DATA ANALYTICS\n", "\n", "Authors:\n", "* Mattia Brocco\n", "* Brenda Eloisa Tellez Juarez\n", "\n", "In the following notebook the pipeline for data import, preprocessing and storage (using `.parquet` format) is presented." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2023-02-12T22:43:39.436355Z", "start_time": "2023-02-12T22:43:39.418449Z" }, "colab": { "base_uri": "https://localhost:8080/", "height": 915 }, "id": "pz7MotpCfCUR", "outputId": "fc916ed3-03d2-41ee-87db-237d79979cf0" }, "outputs": [], "source": [ "from google.colab import drive\n", "drive.mount(\"/content/drive\")\n", "\n", "#%cd /content/drive/MyDrive/Environmental-sounds-UNIPD-2022" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "6YEmW9n_fOB8" }, "outputs": [], "source": [ "import os\n", "import sys\n", "import torch\n", "import librosa\n", "import matplotlib\n", "import numpy as np\n", "import pandas as pd\n", "import seaborn as sns\n", "import tensorflow as tf\n", "from librosa import display\n", "from scipy.io import wavfile\n", "from tensorflow import keras\n", "import IPython.display as ipd\n", "import matplotlib.pyplot as plt\n", "\n", "from sklearn.metrics import confusion_matrix\n", "from sklearn.metrics import classification_report\n", "\n", "import evaluation\n", "import CNN_support as cnns\n", "from gng import GrowingNeuralGas\n", "\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "execution": { "iopub.execute_input": "2023-01-14T19:51:27.903698Z", "iopub.status.busy": "2023-01-14T19:51:27.903426Z", "iopub.status.idle": "2023-01-14T19:51:27.930731Z", "shell.execute_reply": "2023-01-14T19:51:27.929790Z", "shell.execute_reply.started": "2023-01-14T19:51:27.903668Z" }, "id": "ZjdASAl2emSc", "outputId": "a209c1ff-299b-4e8d-c79a-911fc9fab8ca" }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " | filename | \n", "fold | \n", "target | \n", "category | \n", "esc10 | \n", "src_file | \n", "take | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "1-100032-A-0.wav | \n", "1 | \n", "0 | \n", "dog | \n", "True | \n", "100032 | \n", "A | \n", "
1 | \n", "1-100038-A-14.wav | \n", "1 | \n", "14 | \n", "chirping_birds | \n", "False | \n", "100038 | \n", "A | \n", "
2 | \n", "1-100210-A-36.wav | \n", "1 | \n", "36 | \n", "vacuum_cleaner | \n", "False | \n", "100210 | \n", "A | \n", "
3 | \n", "1-100210-B-36.wav | \n", "1 | \n", "36 | \n", "vacuum_cleaner | \n", "False | \n", "100210 | \n", "B | \n", "
4 | \n", "1-101296-A-19.wav | \n", "1 | \n", "19 | \n", "thunderstorm | \n", "False | \n", "101296 | \n", "A | \n", "