{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Uczenie maszynowe UMZ 2017/2018\n", "# 3. Naiwny klasyfikator bayesowski, drzewa decyzyjne\n", "### Część 2" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## 3.2. Drzewa decyzyjne" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Drzewa decyzyjne – przykład" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "slideshow": { "slide_type": "notes" } }, "outputs": [], "source": [ "# Przydatne importy\n", "\n", "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas\n", "\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | Day | \n", "Outlook | \n", "Humidity | \n", "Wind | \n", "Play | \n", "
---|---|---|---|---|---|
0 | \n", "1 | \n", "Sunny | \n", "High | \n", "Weak | \n", "No | \n", "
1 | \n", "2 | \n", "Sunny | \n", "High | \n", "Strong | \n", "No | \n", "
2 | \n", "3 | \n", "Overcast | \n", "High | \n", "Weak | \n", "Yes | \n", "
3 | \n", "4 | \n", "Rain | \n", "High | \n", "Weak | \n", "Yes | \n", "
4 | \n", "5 | \n", "Rain | \n", "Normal | \n", "Weak | \n", "Yes | \n", "
5 | \n", "6 | \n", "Rain | \n", "Normal | \n", "Strong | \n", "No | \n", "
6 | \n", "7 | \n", "Overcast | \n", "Normal | \n", "Strong | \n", "Yes | \n", "
7 | \n", "8 | \n", "Sunny | \n", "High | \n", "Weak | \n", "No | \n", "
8 | \n", "9 | \n", "Sunny | \n", "Normal | \n", "Weak | \n", "Yes | \n", "
9 | \n", "10 | \n", "Rain | \n", "Normal | \n", "Weak | \n", "Yes | \n", "
10 | \n", "11 | \n", "Sunny | \n", "Normal | \n", "Strong | \n", "Yes | \n", "
11 | \n", "12 | \n", "Overcast | \n", "High | \n", "Strong | \n", "Yes | \n", "
12 | \n", "13 | \n", "Overcast | \n", "Normal | \n", "Weak | \n", "Yes | \n", "
13 | \n", "14 | \n", "Rain | \n", "High | \n", "Strong | \n", "No | \n", "