{"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":"4wZI6qHSWbo9","cell_id":"94c1b3785dc54b428bce57ffff71e057","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":2218,"user_tz":240,"timestamp":1652614617495},"deepnote_cell_type":"code"},"outputs":[],"execution_count":2},{"cell_type":"markdown","source":"**Descripcion de datos**\nhttps://raw.githubusercontent.com/jbrownlee/Datasets/master/sonar.names\n\n**Enlace con datos**\nhttps://raw.githubusercontent.com/jbrownlee/Datasets/master/sonar.csv\n\nEl archivo \"sonar.mines\" contiene 111 patrones obtenidos al hacer rebotar señales de sonar en un cilindro de metal en varios ángulos y bajo diversas condiciones. El archivo \"sonar.rocks\" contiene 97 patrones obtenidos de rocas en condiciones similares. La señal del sonar transmitida es un chirrido de frecuencia modulada, aumentando en frecuencia. El conjunto de datos contiene señales obtenidas desde una variedad de ángulos de aspecto diferentes, que abarcan 90 grados para el cilindro y 180 grados para la roca.\n\nCada patrón es un conjunto de 60 números en el rango de 0,0 a 1,0. Cada número representa la energía dentro de una banda de frecuencia particular, integrada durante un cierto período de tiempo. La apertura de integración para frecuencias más altas ocurre más tarde, ya que estas frecuencias se transmiten más tarde durante el chirrido.\n\nLa etiqueta asociada a cada registro contiene la letra \"R\" si el objeto es una roca y \"M\" si es una mina (cilindro de metal). Los números en las etiquetas están en orden creciente de ángulo de aspecto, pero no codifican el ángulo directamente.","metadata":{"id":"c-uqzdzEWsyS","cell_id":"9e450f6e356341febbfd6ad47ef161d5","deepnote_cell_type":"markdown"}},{"cell_type":"code","source":"# datos\nurl = 'https://raw.githubusercontent.com/jbrownlee/Datasets/master/sonar.csv'\ndataframe = read_csv(url, header=None)\ndata = dataframe.values\ndataframe.head()","metadata":{"id":"HJveRtrNWfyH","colab":{"height":235,"base_uri":"https://localhost:8080/"},"cell_id":"7553e690416747d7ad17c0771af5a393","outputId":"fe18027d-9ca3-446b-e30d-925e98575666","executionInfo":{"user":{"userId":"09471607480253994520","displayName":"David Francisco Bustos Usta"},"status":"ok","elapsed":382,"user_tz":240,"timestamp":1652614618542},"deepnote_cell_type":"code"},"outputs":[{"output_type":"execute_result","data":{"text/plain":" 0 1 2 3 4 5 6 7 8 \\\n0 0.0200 0.0371 0.0428 0.0207 0.0954 0.0986 0.1539 0.1601 0.3109 \n1 0.0453 0.0523 0.0843 0.0689 0.1183 0.2583 0.2156 0.3481 0.3337 \n2 0.0262 0.0582 0.1099 0.1083 0.0974 0.2280 0.2431 0.3771 0.5598 \n3 0.0100 0.0171 0.0623 0.0205 0.0205 0.0368 0.1098 0.1276 0.0598 \n4 0.0762 0.0666 0.0481 0.0394 0.0590 0.0649 0.1209 0.2467 0.3564 \n\n 9 ... 51 52 53 54 55 56 57 \\\n0 0.2111 ... 0.0027 0.0065 0.0159 0.0072 0.0167 0.0180 0.0084 \n1 0.2872 ... 0.0084 0.0089 0.0048 0.0094 0.0191 0.0140 0.0049 \n2 0.6194 ... 0.0232 0.0166 0.0095 0.0180 0.0244 0.0316 0.0164 \n3 0.1264 ... 0.0121 0.0036 0.0150 0.0085 0.0073 0.0050 0.0044 \n4 0.4459 ... 0.0031 0.0054 0.0105 0.0110 0.0015 0.0072 0.0048 \n\n 58 59 60 \n0 0.0090 0.0032 R \n1 0.0052 0.0044 R \n2 0.0095 0.0078 R \n3 0.0040 0.0117 R \n4 0.0107 0.0094 R \n\n[5 rows x 61 columns]","text/html":"\n
\n | 0 | \n1 | \n2 | \n3 | \n4 | \n5 | \n6 | \n7 | \n8 | \n9 | \n... | \n51 | \n52 | \n53 | \n54 | \n55 | \n56 | \n57 | \n58 | \n59 | \n60 | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n0.0200 | \n0.0371 | \n0.0428 | \n0.0207 | \n0.0954 | \n0.0986 | \n0.1539 | \n0.1601 | \n0.3109 | \n0.2111 | \n... | \n0.0027 | \n0.0065 | \n0.0159 | \n0.0072 | \n0.0167 | \n0.0180 | \n0.0084 | \n0.0090 | \n0.0032 | \nR | \n
1 | \n0.0453 | \n0.0523 | \n0.0843 | \n0.0689 | \n0.1183 | \n0.2583 | \n0.2156 | \n0.3481 | \n0.3337 | \n0.2872 | \n... | \n0.0084 | \n0.0089 | \n0.0048 | \n0.0094 | \n0.0191 | \n0.0140 | \n0.0049 | \n0.0052 | \n0.0044 | \nR | \n
2 | \n0.0262 | \n0.0582 | \n0.1099 | \n0.1083 | \n0.0974 | \n0.2280 | \n0.2431 | \n0.3771 | \n0.5598 | \n0.6194 | \n... | \n0.0232 | \n0.0166 | \n0.0095 | \n0.0180 | \n0.0244 | \n0.0316 | \n0.0164 | \n0.0095 | \n0.0078 | \nR | \n
3 | \n0.0100 | \n0.0171 | \n0.0623 | \n0.0205 | \n0.0205 | \n0.0368 | \n0.1098 | \n0.1276 | \n0.0598 | \n0.1264 | \n... | \n0.0121 | \n0.0036 | \n0.0150 | \n0.0085 | \n0.0073 | \n0.0050 | \n0.0044 | \n0.0040 | \n0.0117 | \nR | \n
4 | \n0.0762 | \n0.0666 | \n0.0481 | \n0.0394 | \n0.0590 | \n0.0649 | \n0.1209 | \n0.2467 | \n0.3564 | \n0.4459 | \n... | \n0.0031 | \n0.0054 | \n0.0105 | \n0.0110 | \n0.0015 | \n0.0072 | \n0.0048 | \n0.0107 | \n0.0094 | \nR | \n
5 rows × 61 columns
\n