{ "cells": [ { "cell_type": "markdown", "id": "43a81660", "metadata": {}, "source": [ "# π EDA β AnΓ‘lisis Exploratorio de Datos\n", "## YouTube Hate Speech Detection\n", "\n", "**Objetivo:** Entender el dataset antes de modelar. Cada secciΓ³n termina con una conclusiΓ³n documentada.\n", "\n", "**Dataset:** YouTube Comments β 1000 filas Γ 15 columnas \n", "**Target principal:** `IsToxic` (binario) \n", "**Sublabels:** IsAbusive, IsProvocative, IsHatespeech, IsRacist, IsObscene\n", "\n", "---\n", "> **Regla de oro:** No se toca el preprocesamiento aquΓ. Solo se analiza y se documentan conclusiones.\n" ] }, { "cell_type": "markdown", "id": "2c4ccebd", "metadata": {}, "source": [ "## 0. Imports y configuraciΓ³n" ] }, { "cell_type": "code", "execution_count": 1, "id": "0369d363", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "β Imports correctos\n" ] } ], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import matplotlib.patches as mpatches\n", "import seaborn as sns\n", "from wordcloud import WordCloud\n", "import re\n", "import warnings\n", "warnings.filterwarnings('ignore')\n", "\n", "# Estilo global\n", "plt.rcParams['figure.figsize'] = (10, 5)\n", "plt.rcParams['font.size'] = 12\n", "plt.rcParams['axes.spines.top'] = False\n", "plt.rcParams['axes.spines.right'] = False\n", "sns.set_palette('husl')\n", "\n", "print(\"β Imports correctos\")\n" ] }, { "cell_type": "markdown", "id": "37f3ee45", "metadata": {}, "source": [ "## 1. Carga del dataset\n", "\n", "Cargamos el CSV y hacemos una primera inspecciΓ³n estructural.\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "5deac31b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "π Shape: (1000, 15)\n", "π Columnas: ['CommentId', 'VideoId', 'Text', 'IsToxic', 'IsAbusive', 'IsThreat', 'IsProvocative', 'IsObscene', 'IsHatespeech', 'IsRacist', 'IsNationalist', 'IsSexist', 'IsHomophobic', 'IsReligiousHate', 'IsRadicalism']\n", "\n" ] }, { "data": { "text/html": [ "
| \n", " | CommentId | \n", "VideoId | \n", "Text | \n", "IsToxic | \n", "IsAbusive | \n", "IsThreat | \n", "IsProvocative | \n", "IsObscene | \n", "IsHatespeech | \n", "IsRacist | \n", "IsNationalist | \n", "IsSexist | \n", "IsHomophobic | \n", "IsReligiousHate | \n", "IsRadicalism | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Ugg2KwwX0V8-aXgCoAEC | \n", "04kJtp6pVXI | \n", "If only people would just take a step back and... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
| 1 | \n", "Ugg2s5AzSPioEXgCoAEC | \n", "04kJtp6pVXI | \n", "Law enforcement is not trained to shoot to app... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
| 2 | \n", "Ugg3dWTOxryFfHgCoAEC | \n", "04kJtp6pVXI | \n", "\\nDont you reckon them 'black lives matter' ba... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "