{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Aprendizaje Supervisado\n", "\n", "- Vecinos mas cercanos.\n", "- Regularizacion: Lasso, Ridge. \n", "- Arboles de decision\n", "- SVM\n", "- Redes Neuronales" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Vecinos más cercanos\n", "Importamos las librerías necesarias y los datos" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "#%matplotlib notebook\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "from sklearn.model_selection import train_test_split\n", "\n", "\n", "fruits = pd.read_table('Data/fruit_data_with_colors.txt')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | fruit_label | \n", "fruit_name | \n", "fruit_subtype | \n", "mass | \n", "width | \n", "height | \n", "color_score | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "apple | \n", "granny_smith | \n", "192 | \n", "8.4 | \n", "7.3 | \n", "0.55 | \n", "
1 | \n", "1 | \n", "apple | \n", "granny_smith | \n", "180 | \n", "8.0 | \n", "6.8 | \n", "0.59 | \n", "
2 | \n", "1 | \n", "apple | \n", "granny_smith | \n", "176 | \n", "7.4 | \n", "7.2 | \n", "0.60 | \n", "
3 | \n", "2 | \n", "mandarin | \n", "mandarin | \n", "86 | \n", "6.2 | \n", "4.7 | \n", "0.80 | \n", "
4 | \n", "2 | \n", "mandarin | \n", "mandarin | \n", "84 | \n", "6.0 | \n", "4.6 | \n", "0.79 | \n", "
KNeighborsClassifier()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
KNeighborsClassifier()