{"cells":[{"cell_type":"code","source":"#Carga de las librerías\nimport urllib.request\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.tree import DecisionTreeClassifier","metadata":{"id":"15ZZJw9xZfE_","cell_id":"d4f8ffcb37524f32b5d7992b90a08eca","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":1663,"user_tz":240,"timestamp":1650987551421},"deepnote_cell_type":"code"},"outputs":[],"execution_count":1},{"cell_type":"code","source":"#Descargamos los datos desde internet!\nfile_name = 'dataR2.csv'\n\ndef download_file(file_name):\n print('Descargando el dataset')\n url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/00451/dataR2.csv'\n urllib.request.urlretrieve(url, file_name)\n\n\ndownload_file(file_name)","metadata":{"id":"ejBtmT-zZfFM","colab":{"base_uri":"https://localhost:8080/"},"cell_id":"966b84e6a40b4772919a7da5d924d556","outputId":"daa51b3a-b89f-42fe-8410-61de2eb9a6d1","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":824,"user_tz":240,"timestamp":1650987552235},"deepnote_cell_type":"code"},"outputs":[{"output_type":"stream","name":"stdout","text":"Descargando el dataset\n"}],"execution_count":2},{"cell_type":"code","source":"#Ahora si cargamos los datos en jupyter!\ndata = pd.read_csv(file_name)\ndata.head()","metadata":{"id":"SLcy82TpZfFO","colab":{"height":207,"base_uri":"https://localhost:8080/"},"cell_id":"102076d742e240268c7082bc273ac310","outputId":"3a6804be-2269-455a-b7dd-a32d412e930a","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":17,"user_tz":240,"timestamp":1650987552237},"deepnote_cell_type":"code"},"outputs":[{"output_type":"execute_result","data":{"text/plain":" Age BMI Glucose Insulin HOMA Leptin Adiponectin Resistin \\\n0 48 23.500000 70 2.707 0.467409 8.8071 9.702400 7.99585 \n1 83 20.690495 92 3.115 0.706897 8.8438 5.429285 4.06405 \n2 82 23.124670 91 4.498 1.009651 17.9393 22.432040 9.27715 \n3 68 21.367521 77 3.226 0.612725 9.8827 7.169560 12.76600 \n4 86 21.111111 92 3.549 0.805386 6.6994 4.819240 10.57635 \n\n MCP.1 Classification \n0 417.114 1 \n1 468.786 1 \n2 554.697 1 \n3 928.220 1 \n4 773.920 1 ","text/html":"\n
\n | Age | \nBMI | \nGlucose | \nInsulin | \nHOMA | \nLeptin | \nAdiponectin | \nResistin | \nMCP.1 | \nClassification | \n
---|---|---|---|---|---|---|---|---|---|---|
0 | \n48 | \n23.500000 | \n70 | \n2.707 | \n0.467409 | \n8.8071 | \n9.702400 | \n7.99585 | \n417.114 | \n1 | \n
1 | \n83 | \n20.690495 | \n92 | \n3.115 | \n0.706897 | \n8.8438 | \n5.429285 | \n4.06405 | \n468.786 | \n1 | \n
2 | \n82 | \n23.124670 | \n91 | \n4.498 | \n1.009651 | \n17.9393 | \n22.432040 | \n9.27715 | \n554.697 | \n1 | \n
3 | \n68 | \n21.367521 | \n77 | \n3.226 | \n0.612725 | \n9.8827 | \n7.169560 | \n12.76600 | \n928.220 | \n1 | \n
4 | \n86 | \n21.111111 | \n92 | \n3.549 | \n0.805386 | \n6.6994 | \n4.819240 | \n10.57635 | \n773.920 | \n1 | \n