Essays.club - Ensayos gratis, notas de cursos, notas de libros, tareas, monografías y trabajos de investigación
Buscar

Modelo ML Reconocimiento Digitos

Enviado por   •  13 de Octubre de 2023  •  Tarea  •  8.765 Palabras (36 Páginas)  •  188 Visitas

Página 1 de 36

{

"cells": [

{

"cell_type": "code",

"execution_count": null,

"metadata": {},

"outputs": [],

"source": [

"from IPython.core.display import HTML\n",

"HTML(\"\\n\".join(open('mioti_style.css', 'r').readlines()))"

]

},

{

"cell_type": "markdown",

"metadata": {},

"source": [

"<img src=\"mioti.png\" style=\"height: 100px\">\n",

"<center style=\"color:#888\">Módulo Data Science in IoT<br/>Asignatura Machine Learning</center>\n",

"# Challenge S2: Reconocimiento de dígitos"

]

},

{

"cell_type": "markdown",

"metadata": {},

"source": [

"## Objetivo\n",

"\n",

"Implementar un reconocedor de dígitos manuscritos."

]

},

{

"cell_type": "markdown",

"metadata": {},

"source": [

"## Configuración del entorno"

]

},

{

"cell_type": "code",

"execution_count": 1,

"metadata": {},

"outputs": [],

"source": [

"%matplotlib inline\n",

"\n",

"import warnings\n",

"warnings.filterwarnings(\"ignore\")\n",

"\n",

"import numpy as np\n",

"import pandas as pd\n",

"import matplotlib.pyplot as plt\n",

"\n",

"from sklearn.metrics import confusion_matrix"

]

},

{

"cell_type": "markdown",

"metadata": {

"collapsed": true

},

"source": [

"## Carga de datos\n",

"\n",

"En esta ocasión vamos a utilizar una dataset denominado 'digits' que contiene imágenes de números manuscritos.\n",

"\n",

"Este dataset está disponible dentro de los datasets de `sklearn` y podemos cargarlo en memoria de la siguiente manera:"

]

},

{

"cell_type": "code",

"execution_count": 2,

"metadata": {},

"outputs": [],

"source": [

"from sklearn.datasets import load_digits\n",

"digits = load_digits()"

]

},

{

"cell_type": "code",

"execution_count": 3,

"metadata": {},

"outputs": [

{

"name": "stdout",

"output_type": "stream",

"text": [

"{'data': array([[ 0., 0., 5., ..., 0., 0., 0.],\n",

" [ 0., 0., 0., ..., 10., 0., 0.],\n",

" [ 0., 0., 0., ..., 16., 9., 0.],\n",

" ...,\n",

" [ 0., 0., 1., ..., 6., 0., 0.],\n",

" [ 0., 0., 2., ..., 12., 0., 0.],\n",

" [ 0., 0., 10., ..., 12., 1., 0.]]), 'target': array([0, 1, 2, ..., 8, 9, 8]), 'target_names': array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), 'images': array([[[ 0., 0., 5., ..., 1., 0., 0.],\n",

" [ 0., 0., 13., ..., 15., 5., 0.],\n",

" [ 0., 3., 15., ..., 11., 8., 0.],\n",

...

Descargar como  txt (162.8 Kb)   pdf (334.9 Kb)   docx (128.9 Kb)  
Leer 35 páginas más »
Disponible sólo en Essays.club