{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Plus proches voisins - évaluation\n", "\n", "\n", "Comment évaluer la pertinence d'un modèle des plus proches voisins." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from teachpyx.datasets import load_wines_dataset\n", "\n", "df = load_wines_dataset()\n", "X = df.drop([\"quality\", \"color\"], axis=1)\n", "y = df[\"quality\"]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
KNeighborsRegressor(n_neighbors=1)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
KNeighborsRegressor(n_neighbors=1)
NearestNeighbors(n_neighbors=2)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
NearestNeighbors(n_neighbors=2)