{"cells":[{"cell_type":"code","source":"# librerias\nfrom numpy import mean\nfrom numpy import std\nfrom pandas import read_csv\nfrom sklearn.model_selection import LeaveOneOut\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.ensemble import RandomForestClassifier","metadata":{"id":"kO15uZdopvtz","cell_id":"82e0d29c90624ac693a187c6ef7ea1ec","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":1586,"user_tz":240,"timestamp":1652617056366},"deepnote_cell_type":"code"},"outputs":[],"execution_count":7},{"cell_type":"markdown","source":"**Descripcion de datos**\nhttps://raw.githubusercontent.com/jbrownlee/Datasets/master/housing.names\n\n**Enlace con datos**\nhttps://raw.githubusercontent.com/jbrownlee/Datasets/master/housing.csv\n\n1. CRIM per capita crime rate by town\n2. ZN proportion of residential land zoned for lots over 25,000 sq.ft.\n3. INDUS proportion of non-retail business acres per town\n4. CHAS Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)\n5. NOX nitric oxides concentration (parts per 10 million)\n6. RM average number of rooms per dwelling\n7. AGE proportion of owner-occupied units built prior to 1940\n8. DIS weighted distances to five Boston employment centres\n9. RAD index of accessibility to radial highways\n10. TAX full-value property-tax rate per 10,000\n11. PTRATIO pupil teacher ratio by town\n12. B 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town\n13. LSTAT % lower status of the population\n14. MEDV Median value of owner-occupied homes in $1000's","metadata":{"id":"_mKNx3NeYutA","cell_id":"b5f263f1954c4799a28130c4a27608a0","deepnote_cell_type":"markdown"}},{"cell_type":"code","source":"# librerias\nfrom pandas import read_csv\n# cargar datos\nurl = 'https://raw.githubusercontent.com/jbrownlee/Datasets/master/housing.csv'\ndataframe = read_csv(url, header=None)\n# shape\nprint(dataframe.shape)","metadata":{"id":"u_0oIqz5ZVZb","colab":{"base_uri":"https://localhost:8080/"},"cell_id":"b8193cbf10e849f1b0030671e5b5ec8b","outputId":"a040a7d8-314b-4e1e-8dea-71a81c436dcc","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":968,"user_tz":240,"timestamp":1652616992857},"deepnote_cell_type":"code"},"outputs":[{"output_type":"stream","name":"stdout","text":"(506, 14)\n"}],"execution_count":1},{"cell_type":"code","source":"dataframe","metadata":{"id":"LE0y7f4PZdHk","colab":{"height":423,"base_uri":"https://localhost:8080/"},"cell_id":"d3cf352430c7496d9b77fedfaca0458b","outputId":"d19bf9d4-f4fd-4206-86ed-07f98e5173fe","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":355,"user_tz":240,"timestamp":1652616994831},"deepnote_cell_type":"code"},"outputs":[{"output_type":"execute_result","data":{"text/plain":" 0 1 2 3 4 5 6 7 8 9 10 \\\n0 0.00632 18.0 2.31 0 0.538 6.575 65.2 4.0900 1 296.0 15.3 \n1 0.02731 0.0 7.07 0 0.469 6.421 78.9 4.9671 2 242.0 17.8 \n2 0.02729 0.0 7.07 0 0.469 7.185 61.1 4.9671 2 242.0 17.8 \n3 0.03237 0.0 2.18 0 0.458 6.998 45.8 6.0622 3 222.0 18.7 \n4 0.06905 0.0 2.18 0 0.458 7.147 54.2 6.0622 3 222.0 18.7 \n.. ... ... ... .. ... ... ... ... .. ... ... \n501 0.06263 0.0 11.93 0 0.573 6.593 69.1 2.4786 1 273.0 21.0 \n502 0.04527 0.0 11.93 0 0.573 6.120 76.7 2.2875 1 273.0 21.0 \n503 0.06076 0.0 11.93 0 0.573 6.976 91.0 2.1675 1 273.0 21.0 \n504 0.10959 0.0 11.93 0 0.573 6.794 89.3 2.3889 1 273.0 21.0 \n505 0.04741 0.0 11.93 0 0.573 6.030 80.8 2.5050 1 273.0 21.0 \n\n 11 12 13 \n0 396.90 4.98 24.0 \n1 396.90 9.14 21.6 \n2 392.83 4.03 34.7 \n3 394.63 2.94 33.4 \n4 396.90 5.33 36.2 \n.. ... ... ... \n501 391.99 9.67 22.4 \n502 396.90 9.08 20.6 \n503 396.90 5.64 23.9 \n504 393.45 6.48 22.0 \n505 396.90 7.88 11.9 \n\n[506 rows x 14 columns]","text/html":"\n
\n | 0 | \n1 | \n2 | \n3 | \n4 | \n5 | \n6 | \n7 | \n8 | \n9 | \n10 | \n11 | \n12 | \n13 | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n0.00632 | \n18.0 | \n2.31 | \n0 | \n0.538 | \n6.575 | \n65.2 | \n4.0900 | \n1 | \n296.0 | \n15.3 | \n396.90 | \n4.98 | \n24.0 | \n
1 | \n0.02731 | \n0.0 | \n7.07 | \n0 | \n0.469 | \n6.421 | \n78.9 | \n4.9671 | \n2 | \n242.0 | \n17.8 | \n396.90 | \n9.14 | \n21.6 | \n
2 | \n0.02729 | \n0.0 | \n7.07 | \n0 | \n0.469 | \n7.185 | \n61.1 | \n4.9671 | \n2 | \n242.0 | \n17.8 | \n392.83 | \n4.03 | \n34.7 | \n
3 | \n0.03237 | \n0.0 | \n2.18 | \n0 | \n0.458 | \n6.998 | \n45.8 | \n6.0622 | \n3 | \n222.0 | \n18.7 | \n394.63 | \n2.94 | \n33.4 | \n
4 | \n0.06905 | \n0.0 | \n2.18 | \n0 | \n0.458 | \n7.147 | \n54.2 | \n6.0622 | \n3 | \n222.0 | \n18.7 | \n396.90 | \n5.33 | \n36.2 | \n
... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n
501 | \n0.06263 | \n0.0 | \n11.93 | \n0 | \n0.573 | \n6.593 | \n69.1 | \n2.4786 | \n1 | \n273.0 | \n21.0 | \n391.99 | \n9.67 | \n22.4 | \n
502 | \n0.04527 | \n0.0 | \n11.93 | \n0 | \n0.573 | \n6.120 | \n76.7 | \n2.2875 | \n1 | \n273.0 | \n21.0 | \n396.90 | \n9.08 | \n20.6 | \n
503 | \n0.06076 | \n0.0 | \n11.93 | \n0 | \n0.573 | \n6.976 | \n91.0 | \n2.1675 | \n1 | \n273.0 | \n21.0 | \n396.90 | \n5.64 | \n23.9 | \n
504 | \n0.10959 | \n0.0 | \n11.93 | \n0 | \n0.573 | \n6.794 | \n89.3 | \n2.3889 | \n1 | \n273.0 | \n21.0 | \n393.45 | \n6.48 | \n22.0 | \n
505 | \n0.04741 | \n0.0 | \n11.93 | \n0 | \n0.573 | \n6.030 | \n80.8 | \n2.5050 | \n1 | \n273.0 | \n21.0 | \n396.90 | \n7.88 | \n11.9 | \n
506 rows × 14 columns
\n