{"cells":[{"cell_type":"markdown","source":"### Árbol de Decisión modelo de Clasificación en Scikit-Learn - Titanic","metadata":{"id":"-HLtE6c9Gz0O","cell_id":"afe7aa1375e5445da13f6c446d5cd529","deepnote_cell_type":"markdown"}},{"cell_type":"code","source":"from google.colab import drive\nimport os\ndrive.mount('/content/gdrive')\n# Establecer ruta de acceso en dr\nimport os\nprint(os.getcwd())\nos.chdir(\"/content/gdrive/My Drive\")","metadata":{"id":"_13vHnKbG2I0","colab":{"base_uri":"https://localhost:8080/"},"cell_id":"91fccf2bdd084d75a43e72a42349812d","outputId":"caba344c-2f29-4d98-bd5e-6d057edaec2e","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":3540,"user_tz":240,"timestamp":1650987494738},"deepnote_cell_type":"code"},"outputs":[{"output_type":"stream","name":"stdout","text":"Drive already mounted at /content/gdrive; to attempt to forcibly remount, call drive.mount(\"/content/gdrive\", force_remount=True).\n/content/gdrive/My Drive\n"}],"execution_count":3},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ntitanic = pd.read_csv(\"Titanic.csv\", sep = \",\")","metadata":{"id":"RUk74NsUGz0R","cell_id":"ed4a620e64144d8897ef59c375ee2a1b","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":999,"user_tz":240,"timestamp":1650987496358},"deepnote_cell_type":"code"},"outputs":[],"execution_count":4},{"cell_type":"code","source":"titanic","metadata":{"id":"aa0QLHSKJUhY","colab":{"height":424,"base_uri":"https://localhost:8080/"},"cell_id":"ead12a2c96dc49dcbaabf99fbc32c36d","outputId":"b957361e-26eb-472b-8815-e80dfa37c58d","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":15,"user_tz":240,"timestamp":1650987499662},"deepnote_cell_type":"code"},"outputs":[{"output_type":"execute_result","data":{"text/plain":" Survived Pclass Sex Age SibSp Parch\n0 0 3 0 22.0 1 0\n1 1 1 1 38.0 1 0\n2 1 3 1 26.0 0 0\n3 1 1 1 35.0 1 0\n4 0 3 0 35.0 0 0\n.. ... ... ... ... ... ...\n709 0 3 1 39.0 0 5\n710 0 2 0 27.0 0 0\n711 1 1 1 19.0 0 0\n712 1 1 0 26.0 0 0\n713 0 3 0 32.0 0 0\n\n[714 rows x 6 columns]","text/html":"\n
\n | Survived | \nPclass | \nSex | \nAge | \nSibSp | \nParch | \n
---|---|---|---|---|---|---|
0 | \n0 | \n3 | \n0 | \n22.0 | \n1 | \n0 | \n
1 | \n1 | \n1 | \n1 | \n38.0 | \n1 | \n0 | \n
2 | \n1 | \n3 | \n1 | \n26.0 | \n0 | \n0 | \n
3 | \n1 | \n1 | \n1 | \n35.0 | \n1 | \n0 | \n
4 | \n0 | \n3 | \n0 | \n35.0 | \n0 | \n0 | \n
... | \n... | \n... | \n... | \n... | \n... | \n... | \n
709 | \n0 | \n3 | \n1 | \n39.0 | \n0 | \n5 | \n
710 | \n0 | \n2 | \n0 | \n27.0 | \n0 | \n0 | \n
711 | \n1 | \n1 | \n1 | \n19.0 | \n0 | \n0 | \n
712 | \n1 | \n1 | \n0 | \n26.0 | \n0 | \n0 | \n
713 | \n0 | \n3 | \n0 | \n32.0 | \n0 | \n0 | \n
714 rows × 6 columns
\n