Week 9 Videos

Logistic regression decision boundary with 3 classes

import altair as alt
import seaborn as sns
df = sns.load_dataset("penguins").dropna()
df.columns
Index(['species', 'island', 'bill_length_mm', 'bill_depth_mm',
       'flipper_length_mm', 'body_mass_g', 'sex'],
      dtype='object')
cols = ['bill_length_mm', 'bill_depth_mm']
alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color="species"
)
from sklearn.linear_model import LogisticRegression
clf = LogisticRegression()
clf.fit(df[cols], df["species"])
LogisticRegression()
df["pred"] = clf.predict(df[cols])
alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color="pred"
)

A grid of points using NumPy

import numpy as np
import pandas as pd
x = np.arange(32, 60, 0.2)
y = np.arange(13, 22, 0.2)
pd.DataFrame({"x":x, "y":y})
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/var/folders/8j/gshrlmtn7dg4qtztj4d4t_w40000gn/T/ipykernel_12680/4035979450.py in <module>
----> 1 pd.DataFrame({"x":x, "y":y})

~/miniconda3/envs/math10s22/lib/python3.7/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
    612         elif isinstance(data, dict):
    613             # GH#38939 de facto copy defaults to False only in non-dict cases
--> 614             mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
    615         elif isinstance(data, ma.MaskedArray):
    616             import numpy.ma.mrecords as mrecords

~/miniconda3/envs/math10s22/lib/python3.7/site-packages/pandas/core/internals/construction.py in dict_to_mgr(data, index, columns, dtype, typ, copy)
    463 
    464     return arrays_to_mgr(
--> 465         arrays, data_names, index, columns, dtype=dtype, typ=typ, consolidate=copy
    466     )
    467 

~/miniconda3/envs/math10s22/lib/python3.7/site-packages/pandas/core/internals/construction.py in arrays_to_mgr(arrays, arr_names, index, columns, dtype, verify_integrity, typ, consolidate)
    117         # figure out the index, if necessary
    118         if index is None:
--> 119             index = _extract_index(arrays)
    120         else:
    121             index = ensure_index(index)

~/miniconda3/envs/math10s22/lib/python3.7/site-packages/pandas/core/internals/construction.py in _extract_index(data)
    633             lengths = list(set(raw_lengths))
    634             if len(lengths) > 1:
--> 635                 raise ValueError("All arrays must be of the same length")
    636 
    637             if have_dicts:

ValueError: All arrays must be of the same length
x
array([32. , 32.2, 32.4, 32.6, 32.8, 33. , 33.2, 33.4, 33.6, 33.8, 34. ,
       34.2, 34.4, 34.6, 34.8, 35. , 35.2, 35.4, 35.6, 35.8, 36. , 36.2,
       36.4, 36.6, 36.8, 37. , 37.2, 37.4, 37.6, 37.8, 38. , 38.2, 38.4,
       38.6, 38.8, 39. , 39.2, 39.4, 39.6, 39.8, 40. , 40.2, 40.4, 40.6,
       40.8, 41. , 41.2, 41.4, 41.6, 41.8, 42. , 42.2, 42.4, 42.6, 42.8,
       43. , 43.2, 43.4, 43.6, 43.8, 44. , 44.2, 44.4, 44.6, 44.8, 45. ,
       45.2, 45.4, 45.6, 45.8, 46. , 46.2, 46.4, 46.6, 46.8, 47. , 47.2,
       47.4, 47.6, 47.8, 48. , 48.2, 48.4, 48.6, 48.8, 49. , 49.2, 49.4,
       49.6, 49.8, 50. , 50.2, 50.4, 50.6, 50.8, 51. , 51.2, 51.4, 51.6,
       51.8, 52. , 52.2, 52.4, 52.6, 52.8, 53. , 53.2, 53.4, 53.6, 53.8,
       54. , 54.2, 54.4, 54.6, 54.8, 55. , 55.2, 55.4, 55.6, 55.8, 56. ,
       56.2, 56.4, 56.6, 56.8, 57. , 57.2, 57.4, 57.6, 57.8, 58. , 58.2,
       58.4, 58.6, 58.8, 59. , 59.2, 59.4, 59.6, 59.8])
y
array([13. , 13.2, 13.4, 13.6, 13.8, 14. , 14.2, 14.4, 14.6, 14.8, 15. ,
       15.2, 15.4, 15.6, 15.8, 16. , 16.2, 16.4, 16.6, 16.8, 17. , 17.2,
       17.4, 17.6, 17.8, 18. , 18.2, 18.4, 18.6, 18.8, 19. , 19.2, 19.4,
       19.6, 19.8, 20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6,
       21.8])
xx, yy = np.meshgrid(x,y)
xx
array([[32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8],
       [32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8],
       [32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8],
       ...,
       [32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8],
       [32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8],
       [32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8]])
yy
array([[13. , 13. , 13. , ..., 13. , 13. , 13. ],
       [13.2, 13.2, 13.2, ..., 13.2, 13.2, 13.2],
       [13.4, 13.4, 13.4, ..., 13.4, 13.4, 13.4],
       ...,
       [21.4, 21.4, 21.4, ..., 21.4, 21.4, 21.4],
       [21.6, 21.6, 21.6, ..., 21.6, 21.6, 21.6],
       [21.8, 21.8, 21.8, ..., 21.8, 21.8, 21.8]])
xx.shape
(45, 140)
x.size
140
y.size
45
xx.reshape(-1)
array([32. , 32.2, 32.4, ..., 59.4, 59.6, 59.8])
yy.reshape(-1)
array([13. , 13. , 13. , ..., 21.8, 21.8, 21.8])
xx.reshape(-1).size
6300
x.size*y.size
6300
df_sim = pd.DataFrame({"x":xx.reshape(-1), "y":yy.reshape(-1)})
df_sim
x y
0 32.0 13.0
1 32.2 13.0
2 32.4 13.0
3 32.6 13.0
4 32.8 13.0
... ... ...
6295 59.0 21.8
6296 59.2 21.8
6297 59.4 21.8
6298 59.6 21.8
6299 59.8 21.8

6300 rows × 2 columns

df_sim.tail()
x y
6295 59.0 21.8
6296 59.2 21.8
6297 59.4 21.8
6298 59.6 21.8
6299 59.8 21.8

A grid of points using itertools

from itertools import product
x
array([32. , 32.2, 32.4, 32.6, 32.8, 33. , 33.2, 33.4, 33.6, 33.8, 34. ,
       34.2, 34.4, 34.6, 34.8, 35. , 35.2, 35.4, 35.6, 35.8, 36. , 36.2,
       36.4, 36.6, 36.8, 37. , 37.2, 37.4, 37.6, 37.8, 38. , 38.2, 38.4,
       38.6, 38.8, 39. , 39.2, 39.4, 39.6, 39.8, 40. , 40.2, 40.4, 40.6,
       40.8, 41. , 41.2, 41.4, 41.6, 41.8, 42. , 42.2, 42.4, 42.6, 42.8,
       43. , 43.2, 43.4, 43.6, 43.8, 44. , 44.2, 44.4, 44.6, 44.8, 45. ,
       45.2, 45.4, 45.6, 45.8, 46. , 46.2, 46.4, 46.6, 46.8, 47. , 47.2,
       47.4, 47.6, 47.8, 48. , 48.2, 48.4, 48.6, 48.8, 49. , 49.2, 49.4,
       49.6, 49.8, 50. , 50.2, 50.4, 50.6, 50.8, 51. , 51.2, 51.4, 51.6,
       51.8, 52. , 52.2, 52.4, 52.6, 52.8, 53. , 53.2, 53.4, 53.6, 53.8,
       54. , 54.2, 54.4, 54.6, 54.8, 55. , 55.2, 55.4, 55.6, 55.8, 56. ,
       56.2, 56.4, 56.6, 56.8, 57. , 57.2, 57.4, 57.6, 57.8, 58. , 58.2,
       58.4, 58.6, 58.8, 59. , 59.2, 59.4, 59.6, 59.8])
y
array([13. , 13.2, 13.4, 13.6, 13.8, 14. , 14.2, 14.4, 14.6, 14.8, 15. ,
       15.2, 15.4, 15.6, 15.8, 16. , 16.2, 16.4, 16.6, 16.8, 17. , 17.2,
       17.4, 17.6, 17.8, 18. , 18.2, 18.4, 18.6, 18.8, 19. , 19.2, 19.4,
       19.6, 19.8, 20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6,
       21.8])
g = product(x,y)
type(g)
itertools.product
list(g)
[(32.0, 13.0),
 (32.0, 13.2),
 (32.0, 13.399999999999999),
 (32.0, 13.599999999999998),
 (32.0, 13.799999999999997),
 (32.0, 13.999999999999996),
 (32.0, 14.199999999999996),
 (32.0, 14.399999999999995),
 (32.0, 14.599999999999994),
 (32.0, 14.799999999999994),
 (32.0, 14.999999999999993),
 (32.0, 15.199999999999992),
 (32.0, 15.399999999999991),
 (32.0, 15.59999999999999),
 (32.0, 15.79999999999999),
 (32.0, 15.99999999999999),
 (32.0, 16.19999999999999),
 (32.0, 16.399999999999988),
 (32.0, 16.599999999999987),
 (32.0, 16.799999999999986),
 (32.0, 16.999999999999986),
 (32.0, 17.199999999999985),
 (32.0, 17.399999999999984),
 (32.0, 17.599999999999984),
 (32.0, 17.799999999999983),
 (32.0, 17.999999999999982),
 (32.0, 18.19999999999998),
 (32.0, 18.39999999999998),
 (32.0, 18.59999999999998),
 (32.0, 18.79999999999998),
 (32.0, 18.99999999999998),
 (32.0, 19.199999999999978),
 (32.0, 19.399999999999977),
 (32.0, 19.599999999999977),
 (32.0, 19.799999999999976),
 (32.0, 19.999999999999975),
 (32.0, 20.199999999999974),
 (32.0, 20.399999999999974),
 (32.0, 20.599999999999973),
 (32.0, 20.799999999999972),
 (32.0, 20.99999999999997),
 (32.0, 21.19999999999997),
 (32.0, 21.39999999999997),
 (32.0, 21.59999999999997),
 (32.0, 21.79999999999997),
 (32.2, 13.0),
 (32.2, 13.2),
 (32.2, 13.399999999999999),
 (32.2, 13.599999999999998),
 (32.2, 13.799999999999997),
 (32.2, 13.999999999999996),
 (32.2, 14.199999999999996),
 (32.2, 14.399999999999995),
 (32.2, 14.599999999999994),
 (32.2, 14.799999999999994),
 (32.2, 14.999999999999993),
 (32.2, 15.199999999999992),
 (32.2, 15.399999999999991),
 (32.2, 15.59999999999999),
 (32.2, 15.79999999999999),
 (32.2, 15.99999999999999),
 (32.2, 16.19999999999999),
 (32.2, 16.399999999999988),
 (32.2, 16.599999999999987),
 (32.2, 16.799999999999986),
 (32.2, 16.999999999999986),
 (32.2, 17.199999999999985),
 (32.2, 17.399999999999984),
 (32.2, 17.599999999999984),
 (32.2, 17.799999999999983),
 (32.2, 17.999999999999982),
 (32.2, 18.19999999999998),
 (32.2, 18.39999999999998),
 (32.2, 18.59999999999998),
 (32.2, 18.79999999999998),
 (32.2, 18.99999999999998),
 (32.2, 19.199999999999978),
 (32.2, 19.399999999999977),
 (32.2, 19.599999999999977),
 (32.2, 19.799999999999976),
 (32.2, 19.999999999999975),
 (32.2, 20.199999999999974),
 (32.2, 20.399999999999974),
 (32.2, 20.599999999999973),
 (32.2, 20.799999999999972),
 (32.2, 20.99999999999997),
 (32.2, 21.19999999999997),
 (32.2, 21.39999999999997),
 (32.2, 21.59999999999997),
 (32.2, 21.79999999999997),
 (32.400000000000006, 13.0),
 (32.400000000000006, 13.2),
 (32.400000000000006, 13.399999999999999),
 (32.400000000000006, 13.599999999999998),
 (32.400000000000006, 13.799999999999997),
 (32.400000000000006, 13.999999999999996),
 (32.400000000000006, 14.199999999999996),
 (32.400000000000006, 14.399999999999995),
 (32.400000000000006, 14.599999999999994),
 (32.400000000000006, 14.799999999999994),
 (32.400000000000006, 14.999999999999993),
 (32.400000000000006, 15.199999999999992),
 (32.400000000000006, 15.399999999999991),
 (32.400000000000006, 15.59999999999999),
 (32.400000000000006, 15.79999999999999),
 (32.400000000000006, 15.99999999999999),
 (32.400000000000006, 16.19999999999999),
 (32.400000000000006, 16.399999999999988),
 (32.400000000000006, 16.599999999999987),
 (32.400000000000006, 16.799999999999986),
 (32.400000000000006, 16.999999999999986),
 (32.400000000000006, 17.199999999999985),
 (32.400000000000006, 17.399999999999984),
 (32.400000000000006, 17.599999999999984),
 (32.400000000000006, 17.799999999999983),
 (32.400000000000006, 17.999999999999982),
 (32.400000000000006, 18.19999999999998),
 (32.400000000000006, 18.39999999999998),
 (32.400000000000006, 18.59999999999998),
 (32.400000000000006, 18.79999999999998),
 (32.400000000000006, 18.99999999999998),
 (32.400000000000006, 19.199999999999978),
 (32.400000000000006, 19.399999999999977),
 (32.400000000000006, 19.599999999999977),
 (32.400000000000006, 19.799999999999976),
 (32.400000000000006, 19.999999999999975),
 (32.400000000000006, 20.199999999999974),
 (32.400000000000006, 20.399999999999974),
 (32.400000000000006, 20.599999999999973),
 (32.400000000000006, 20.799999999999972),
 (32.400000000000006, 20.99999999999997),
 (32.400000000000006, 21.19999999999997),
 (32.400000000000006, 21.39999999999997),
 (32.400000000000006, 21.59999999999997),
 (32.400000000000006, 21.79999999999997),
 (32.60000000000001, 13.0),
 (32.60000000000001, 13.2),
 (32.60000000000001, 13.399999999999999),
 (32.60000000000001, 13.599999999999998),
 (32.60000000000001, 13.799999999999997),
 (32.60000000000001, 13.999999999999996),
 (32.60000000000001, 14.199999999999996),
 (32.60000000000001, 14.399999999999995),
 (32.60000000000001, 14.599999999999994),
 (32.60000000000001, 14.799999999999994),
 (32.60000000000001, 14.999999999999993),
 (32.60000000000001, 15.199999999999992),
 (32.60000000000001, 15.399999999999991),
 (32.60000000000001, 15.59999999999999),
 (32.60000000000001, 15.79999999999999),
 (32.60000000000001, 15.99999999999999),
 (32.60000000000001, 16.19999999999999),
 (32.60000000000001, 16.399999999999988),
 (32.60000000000001, 16.599999999999987),
 (32.60000000000001, 16.799999999999986),
 (32.60000000000001, 16.999999999999986),
 (32.60000000000001, 17.199999999999985),
 (32.60000000000001, 17.399999999999984),
 (32.60000000000001, 17.599999999999984),
 (32.60000000000001, 17.799999999999983),
 (32.60000000000001, 17.999999999999982),
 (32.60000000000001, 18.19999999999998),
 (32.60000000000001, 18.39999999999998),
 (32.60000000000001, 18.59999999999998),
 (32.60000000000001, 18.79999999999998),
 (32.60000000000001, 18.99999999999998),
 (32.60000000000001, 19.199999999999978),
 (32.60000000000001, 19.399999999999977),
 (32.60000000000001, 19.599999999999977),
 (32.60000000000001, 19.799999999999976),
 (32.60000000000001, 19.999999999999975),
 (32.60000000000001, 20.199999999999974),
 (32.60000000000001, 20.399999999999974),
 (32.60000000000001, 20.599999999999973),
 (32.60000000000001, 20.799999999999972),
 (32.60000000000001, 20.99999999999997),
 (32.60000000000001, 21.19999999999997),
 (32.60000000000001, 21.39999999999997),
 (32.60000000000001, 21.59999999999997),
 (32.60000000000001, 21.79999999999997),
 (32.80000000000001, 13.0),
 (32.80000000000001, 13.2),
 (32.80000000000001, 13.399999999999999),
 (32.80000000000001, 13.599999999999998),
 (32.80000000000001, 13.799999999999997),
 (32.80000000000001, 13.999999999999996),
 (32.80000000000001, 14.199999999999996),
 (32.80000000000001, 14.399999999999995),
 (32.80000000000001, 14.599999999999994),
 (32.80000000000001, 14.799999999999994),
 (32.80000000000001, 14.999999999999993),
 (32.80000000000001, 15.199999999999992),
 (32.80000000000001, 15.399999999999991),
 (32.80000000000001, 15.59999999999999),
 (32.80000000000001, 15.79999999999999),
 (32.80000000000001, 15.99999999999999),
 (32.80000000000001, 16.19999999999999),
 (32.80000000000001, 16.399999999999988),
 (32.80000000000001, 16.599999999999987),
 (32.80000000000001, 16.799999999999986),
 (32.80000000000001, 16.999999999999986),
 (32.80000000000001, 17.199999999999985),
 (32.80000000000001, 17.399999999999984),
 (32.80000000000001, 17.599999999999984),
 (32.80000000000001, 17.799999999999983),
 (32.80000000000001, 17.999999999999982),
 (32.80000000000001, 18.19999999999998),
 (32.80000000000001, 18.39999999999998),
 (32.80000000000001, 18.59999999999998),
 (32.80000000000001, 18.79999999999998),
 (32.80000000000001, 18.99999999999998),
 (32.80000000000001, 19.199999999999978),
 (32.80000000000001, 19.399999999999977),
 (32.80000000000001, 19.599999999999977),
 (32.80000000000001, 19.799999999999976),
 (32.80000000000001, 19.999999999999975),
 (32.80000000000001, 20.199999999999974),
 (32.80000000000001, 20.399999999999974),
 (32.80000000000001, 20.599999999999973),
 (32.80000000000001, 20.799999999999972),
 (32.80000000000001, 20.99999999999997),
 (32.80000000000001, 21.19999999999997),
 (32.80000000000001, 21.39999999999997),
 (32.80000000000001, 21.59999999999997),
 (32.80000000000001, 21.79999999999997),
 (33.000000000000014, 13.0),
 (33.000000000000014, 13.2),
 (33.000000000000014, 13.399999999999999),
 (33.000000000000014, 13.599999999999998),
 (33.000000000000014, 13.799999999999997),
 (33.000000000000014, 13.999999999999996),
 (33.000000000000014, 14.199999999999996),
 (33.000000000000014, 14.399999999999995),
 (33.000000000000014, 14.599999999999994),
 (33.000000000000014, 14.799999999999994),
 (33.000000000000014, 14.999999999999993),
 (33.000000000000014, 15.199999999999992),
 (33.000000000000014, 15.399999999999991),
 (33.000000000000014, 15.59999999999999),
 (33.000000000000014, 15.79999999999999),
 (33.000000000000014, 15.99999999999999),
 (33.000000000000014, 16.19999999999999),
 (33.000000000000014, 16.399999999999988),
 (33.000000000000014, 16.599999999999987),
 (33.000000000000014, 16.799999999999986),
 (33.000000000000014, 16.999999999999986),
 (33.000000000000014, 17.199999999999985),
 (33.000000000000014, 17.399999999999984),
 (33.000000000000014, 17.599999999999984),
 (33.000000000000014, 17.799999999999983),
 (33.000000000000014, 17.999999999999982),
 (33.000000000000014, 18.19999999999998),
 (33.000000000000014, 18.39999999999998),
 (33.000000000000014, 18.59999999999998),
 (33.000000000000014, 18.79999999999998),
 (33.000000000000014, 18.99999999999998),
 (33.000000000000014, 19.199999999999978),
 (33.000000000000014, 19.399999999999977),
 (33.000000000000014, 19.599999999999977),
 (33.000000000000014, 19.799999999999976),
 (33.000000000000014, 19.999999999999975),
 (33.000000000000014, 20.199999999999974),
 (33.000000000000014, 20.399999999999974),
 (33.000000000000014, 20.599999999999973),
 (33.000000000000014, 20.799999999999972),
 (33.000000000000014, 20.99999999999997),
 (33.000000000000014, 21.19999999999997),
 (33.000000000000014, 21.39999999999997),
 (33.000000000000014, 21.59999999999997),
 (33.000000000000014, 21.79999999999997),
 (33.20000000000002, 13.0),
 (33.20000000000002, 13.2),
 (33.20000000000002, 13.399999999999999),
 (33.20000000000002, 13.599999999999998),
 (33.20000000000002, 13.799999999999997),
 (33.20000000000002, 13.999999999999996),
 (33.20000000000002, 14.199999999999996),
 (33.20000000000002, 14.399999999999995),
 (33.20000000000002, 14.599999999999994),
 (33.20000000000002, 14.799999999999994),
 (33.20000000000002, 14.999999999999993),
 (33.20000000000002, 15.199999999999992),
 (33.20000000000002, 15.399999999999991),
 (33.20000000000002, 15.59999999999999),
 (33.20000000000002, 15.79999999999999),
 (33.20000000000002, 15.99999999999999),
 (33.20000000000002, 16.19999999999999),
 (33.20000000000002, 16.399999999999988),
 (33.20000000000002, 16.599999999999987),
 (33.20000000000002, 16.799999999999986),
 (33.20000000000002, 16.999999999999986),
 (33.20000000000002, 17.199999999999985),
 (33.20000000000002, 17.399999999999984),
 (33.20000000000002, 17.599999999999984),
 (33.20000000000002, 17.799999999999983),
 (33.20000000000002, 17.999999999999982),
 (33.20000000000002, 18.19999999999998),
 (33.20000000000002, 18.39999999999998),
 (33.20000000000002, 18.59999999999998),
 (33.20000000000002, 18.79999999999998),
 (33.20000000000002, 18.99999999999998),
 (33.20000000000002, 19.199999999999978),
 (33.20000000000002, 19.399999999999977),
 (33.20000000000002, 19.599999999999977),
 (33.20000000000002, 19.799999999999976),
 (33.20000000000002, 19.999999999999975),
 (33.20000000000002, 20.199999999999974),
 (33.20000000000002, 20.399999999999974),
 (33.20000000000002, 20.599999999999973),
 (33.20000000000002, 20.799999999999972),
 (33.20000000000002, 20.99999999999997),
 (33.20000000000002, 21.19999999999997),
 (33.20000000000002, 21.39999999999997),
 (33.20000000000002, 21.59999999999997),
 (33.20000000000002, 21.79999999999997),
 (33.40000000000002, 13.0),
 (33.40000000000002, 13.2),
 (33.40000000000002, 13.399999999999999),
 (33.40000000000002, 13.599999999999998),
 (33.40000000000002, 13.799999999999997),
 (33.40000000000002, 13.999999999999996),
 (33.40000000000002, 14.199999999999996),
 (33.40000000000002, 14.399999999999995),
 (33.40000000000002, 14.599999999999994),
 (33.40000000000002, 14.799999999999994),
 (33.40000000000002, 14.999999999999993),
 (33.40000000000002, 15.199999999999992),
 (33.40000000000002, 15.399999999999991),
 (33.40000000000002, 15.59999999999999),
 (33.40000000000002, 15.79999999999999),
 (33.40000000000002, 15.99999999999999),
 (33.40000000000002, 16.19999999999999),
 (33.40000000000002, 16.399999999999988),
 (33.40000000000002, 16.599999999999987),
 (33.40000000000002, 16.799999999999986),
 (33.40000000000002, 16.999999999999986),
 (33.40000000000002, 17.199999999999985),
 (33.40000000000002, 17.399999999999984),
 (33.40000000000002, 17.599999999999984),
 (33.40000000000002, 17.799999999999983),
 (33.40000000000002, 17.999999999999982),
 (33.40000000000002, 18.19999999999998),
 (33.40000000000002, 18.39999999999998),
 (33.40000000000002, 18.59999999999998),
 (33.40000000000002, 18.79999999999998),
 (33.40000000000002, 18.99999999999998),
 (33.40000000000002, 19.199999999999978),
 (33.40000000000002, 19.399999999999977),
 (33.40000000000002, 19.599999999999977),
 (33.40000000000002, 19.799999999999976),
 (33.40000000000002, 19.999999999999975),
 (33.40000000000002, 20.199999999999974),
 (33.40000000000002, 20.399999999999974),
 (33.40000000000002, 20.599999999999973),
 (33.40000000000002, 20.799999999999972),
 (33.40000000000002, 20.99999999999997),
 (33.40000000000002, 21.19999999999997),
 (33.40000000000002, 21.39999999999997),
 (33.40000000000002, 21.59999999999997),
 (33.40000000000002, 21.79999999999997),
 (33.60000000000002, 13.0),
 (33.60000000000002, 13.2),
 (33.60000000000002, 13.399999999999999),
 (33.60000000000002, 13.599999999999998),
 (33.60000000000002, 13.799999999999997),
 (33.60000000000002, 13.999999999999996),
 (33.60000000000002, 14.199999999999996),
 (33.60000000000002, 14.399999999999995),
 (33.60000000000002, 14.599999999999994),
 (33.60000000000002, 14.799999999999994),
 (33.60000000000002, 14.999999999999993),
 (33.60000000000002, 15.199999999999992),
 (33.60000000000002, 15.399999999999991),
 (33.60000000000002, 15.59999999999999),
 (33.60000000000002, 15.79999999999999),
 (33.60000000000002, 15.99999999999999),
 (33.60000000000002, 16.19999999999999),
 (33.60000000000002, 16.399999999999988),
 (33.60000000000002, 16.599999999999987),
 (33.60000000000002, 16.799999999999986),
 (33.60000000000002, 16.999999999999986),
 (33.60000000000002, 17.199999999999985),
 (33.60000000000002, 17.399999999999984),
 (33.60000000000002, 17.599999999999984),
 (33.60000000000002, 17.799999999999983),
 (33.60000000000002, 17.999999999999982),
 (33.60000000000002, 18.19999999999998),
 (33.60000000000002, 18.39999999999998),
 (33.60000000000002, 18.59999999999998),
 (33.60000000000002, 18.79999999999998),
 (33.60000000000002, 18.99999999999998),
 (33.60000000000002, 19.199999999999978),
 (33.60000000000002, 19.399999999999977),
 (33.60000000000002, 19.599999999999977),
 (33.60000000000002, 19.799999999999976),
 (33.60000000000002, 19.999999999999975),
 (33.60000000000002, 20.199999999999974),
 (33.60000000000002, 20.399999999999974),
 (33.60000000000002, 20.599999999999973),
 (33.60000000000002, 20.799999999999972),
 (33.60000000000002, 20.99999999999997),
 (33.60000000000002, 21.19999999999997),
 (33.60000000000002, 21.39999999999997),
 (33.60000000000002, 21.59999999999997),
 (33.60000000000002, 21.79999999999997),
 (33.800000000000026, 13.0),
 (33.800000000000026, 13.2),
 (33.800000000000026, 13.399999999999999),
 (33.800000000000026, 13.599999999999998),
 (33.800000000000026, 13.799999999999997),
 (33.800000000000026, 13.999999999999996),
 (33.800000000000026, 14.199999999999996),
 (33.800000000000026, 14.399999999999995),
 (33.800000000000026, 14.599999999999994),
 (33.800000000000026, 14.799999999999994),
 (33.800000000000026, 14.999999999999993),
 (33.800000000000026, 15.199999999999992),
 (33.800000000000026, 15.399999999999991),
 (33.800000000000026, 15.59999999999999),
 (33.800000000000026, 15.79999999999999),
 (33.800000000000026, 15.99999999999999),
 (33.800000000000026, 16.19999999999999),
 (33.800000000000026, 16.399999999999988),
 (33.800000000000026, 16.599999999999987),
 (33.800000000000026, 16.799999999999986),
 (33.800000000000026, 16.999999999999986),
 (33.800000000000026, 17.199999999999985),
 (33.800000000000026, 17.399999999999984),
 (33.800000000000026, 17.599999999999984),
 (33.800000000000026, 17.799999999999983),
 (33.800000000000026, 17.999999999999982),
 (33.800000000000026, 18.19999999999998),
 (33.800000000000026, 18.39999999999998),
 (33.800000000000026, 18.59999999999998),
 (33.800000000000026, 18.79999999999998),
 (33.800000000000026, 18.99999999999998),
 (33.800000000000026, 19.199999999999978),
 (33.800000000000026, 19.399999999999977),
 (33.800000000000026, 19.599999999999977),
 (33.800000000000026, 19.799999999999976),
 (33.800000000000026, 19.999999999999975),
 (33.800000000000026, 20.199999999999974),
 (33.800000000000026, 20.399999999999974),
 (33.800000000000026, 20.599999999999973),
 (33.800000000000026, 20.799999999999972),
 (33.800000000000026, 20.99999999999997),
 (33.800000000000026, 21.19999999999997),
 (33.800000000000026, 21.39999999999997),
 (33.800000000000026, 21.59999999999997),
 (33.800000000000026, 21.79999999999997),
 (34.00000000000003, 13.0),
 (34.00000000000003, 13.2),
 (34.00000000000003, 13.399999999999999),
 (34.00000000000003, 13.599999999999998),
 (34.00000000000003, 13.799999999999997),
 (34.00000000000003, 13.999999999999996),
 (34.00000000000003, 14.199999999999996),
 (34.00000000000003, 14.399999999999995),
 (34.00000000000003, 14.599999999999994),
 (34.00000000000003, 14.799999999999994),
 (34.00000000000003, 14.999999999999993),
 (34.00000000000003, 15.199999999999992),
 (34.00000000000003, 15.399999999999991),
 (34.00000000000003, 15.59999999999999),
 (34.00000000000003, 15.79999999999999),
 (34.00000000000003, 15.99999999999999),
 (34.00000000000003, 16.19999999999999),
 (34.00000000000003, 16.399999999999988),
 (34.00000000000003, 16.599999999999987),
 (34.00000000000003, 16.799999999999986),
 (34.00000000000003, 16.999999999999986),
 (34.00000000000003, 17.199999999999985),
 (34.00000000000003, 17.399999999999984),
 (34.00000000000003, 17.599999999999984),
 (34.00000000000003, 17.799999999999983),
 (34.00000000000003, 17.999999999999982),
 (34.00000000000003, 18.19999999999998),
 (34.00000000000003, 18.39999999999998),
 (34.00000000000003, 18.59999999999998),
 (34.00000000000003, 18.79999999999998),
 (34.00000000000003, 18.99999999999998),
 (34.00000000000003, 19.199999999999978),
 (34.00000000000003, 19.399999999999977),
 (34.00000000000003, 19.599999999999977),
 (34.00000000000003, 19.799999999999976),
 (34.00000000000003, 19.999999999999975),
 (34.00000000000003, 20.199999999999974),
 (34.00000000000003, 20.399999999999974),
 (34.00000000000003, 20.599999999999973),
 (34.00000000000003, 20.799999999999972),
 (34.00000000000003, 20.99999999999997),
 (34.00000000000003, 21.19999999999997),
 (34.00000000000003, 21.39999999999997),
 (34.00000000000003, 21.59999999999997),
 (34.00000000000003, 21.79999999999997),
 (34.20000000000003, 13.0),
 (34.20000000000003, 13.2),
 (34.20000000000003, 13.399999999999999),
 (34.20000000000003, 13.599999999999998),
 (34.20000000000003, 13.799999999999997),
 (34.20000000000003, 13.999999999999996),
 (34.20000000000003, 14.199999999999996),
 (34.20000000000003, 14.399999999999995),
 (34.20000000000003, 14.599999999999994),
 (34.20000000000003, 14.799999999999994),
 (34.20000000000003, 14.999999999999993),
 (34.20000000000003, 15.199999999999992),
 (34.20000000000003, 15.399999999999991),
 (34.20000000000003, 15.59999999999999),
 (34.20000000000003, 15.79999999999999),
 (34.20000000000003, 15.99999999999999),
 (34.20000000000003, 16.19999999999999),
 (34.20000000000003, 16.399999999999988),
 (34.20000000000003, 16.599999999999987),
 (34.20000000000003, 16.799999999999986),
 (34.20000000000003, 16.999999999999986),
 (34.20000000000003, 17.199999999999985),
 (34.20000000000003, 17.399999999999984),
 (34.20000000000003, 17.599999999999984),
 (34.20000000000003, 17.799999999999983),
 (34.20000000000003, 17.999999999999982),
 (34.20000000000003, 18.19999999999998),
 (34.20000000000003, 18.39999999999998),
 (34.20000000000003, 18.59999999999998),
 (34.20000000000003, 18.79999999999998),
 (34.20000000000003, 18.99999999999998),
 (34.20000000000003, 19.199999999999978),
 (34.20000000000003, 19.399999999999977),
 (34.20000000000003, 19.599999999999977),
 (34.20000000000003, 19.799999999999976),
 (34.20000000000003, 19.999999999999975),
 (34.20000000000003, 20.199999999999974),
 (34.20000000000003, 20.399999999999974),
 (34.20000000000003, 20.599999999999973),
 (34.20000000000003, 20.799999999999972),
 (34.20000000000003, 20.99999999999997),
 (34.20000000000003, 21.19999999999997),
 (34.20000000000003, 21.39999999999997),
 (34.20000000000003, 21.59999999999997),
 (34.20000000000003, 21.79999999999997),
 (34.400000000000034, 13.0),
 (34.400000000000034, 13.2),
 (34.400000000000034, 13.399999999999999),
 (34.400000000000034, 13.599999999999998),
 (34.400000000000034, 13.799999999999997),
 (34.400000000000034, 13.999999999999996),
 (34.400000000000034, 14.199999999999996),
 (34.400000000000034, 14.399999999999995),
 (34.400000000000034, 14.599999999999994),
 (34.400000000000034, 14.799999999999994),
 (34.400000000000034, 14.999999999999993),
 (34.400000000000034, 15.199999999999992),
 (34.400000000000034, 15.399999999999991),
 (34.400000000000034, 15.59999999999999),
 (34.400000000000034, 15.79999999999999),
 (34.400000000000034, 15.99999999999999),
 (34.400000000000034, 16.19999999999999),
 (34.400000000000034, 16.399999999999988),
 (34.400000000000034, 16.599999999999987),
 (34.400000000000034, 16.799999999999986),
 (34.400000000000034, 16.999999999999986),
 (34.400000000000034, 17.199999999999985),
 (34.400000000000034, 17.399999999999984),
 (34.400000000000034, 17.599999999999984),
 (34.400000000000034, 17.799999999999983),
 (34.400000000000034, 17.999999999999982),
 (34.400000000000034, 18.19999999999998),
 (34.400000000000034, 18.39999999999998),
 (34.400000000000034, 18.59999999999998),
 (34.400000000000034, 18.79999999999998),
 (34.400000000000034, 18.99999999999998),
 (34.400000000000034, 19.199999999999978),
 (34.400000000000034, 19.399999999999977),
 (34.400000000000034, 19.599999999999977),
 (34.400000000000034, 19.799999999999976),
 (34.400000000000034, 19.999999999999975),
 (34.400000000000034, 20.199999999999974),
 (34.400000000000034, 20.399999999999974),
 (34.400000000000034, 20.599999999999973),
 (34.400000000000034, 20.799999999999972),
 (34.400000000000034, 20.99999999999997),
 (34.400000000000034, 21.19999999999997),
 (34.400000000000034, 21.39999999999997),
 (34.400000000000034, 21.59999999999997),
 (34.400000000000034, 21.79999999999997),
 (34.60000000000004, 13.0),
 (34.60000000000004, 13.2),
 (34.60000000000004, 13.399999999999999),
 (34.60000000000004, 13.599999999999998),
 (34.60000000000004, 13.799999999999997),
 (34.60000000000004, 13.999999999999996),
 (34.60000000000004, 14.199999999999996),
 (34.60000000000004, 14.399999999999995),
 (34.60000000000004, 14.599999999999994),
 (34.60000000000004, 14.799999999999994),
 (34.60000000000004, 14.999999999999993),
 (34.60000000000004, 15.199999999999992),
 (34.60000000000004, 15.399999999999991),
 (34.60000000000004, 15.59999999999999),
 (34.60000000000004, 15.79999999999999),
 (34.60000000000004, 15.99999999999999),
 (34.60000000000004, 16.19999999999999),
 (34.60000000000004, 16.399999999999988),
 (34.60000000000004, 16.599999999999987),
 (34.60000000000004, 16.799999999999986),
 (34.60000000000004, 16.999999999999986),
 (34.60000000000004, 17.199999999999985),
 (34.60000000000004, 17.399999999999984),
 (34.60000000000004, 17.599999999999984),
 (34.60000000000004, 17.799999999999983),
 (34.60000000000004, 17.999999999999982),
 (34.60000000000004, 18.19999999999998),
 (34.60000000000004, 18.39999999999998),
 (34.60000000000004, 18.59999999999998),
 (34.60000000000004, 18.79999999999998),
 (34.60000000000004, 18.99999999999998),
 (34.60000000000004, 19.199999999999978),
 (34.60000000000004, 19.399999999999977),
 (34.60000000000004, 19.599999999999977),
 (34.60000000000004, 19.799999999999976),
 (34.60000000000004, 19.999999999999975),
 (34.60000000000004, 20.199999999999974),
 (34.60000000000004, 20.399999999999974),
 (34.60000000000004, 20.599999999999973),
 (34.60000000000004, 20.799999999999972),
 (34.60000000000004, 20.99999999999997),
 (34.60000000000004, 21.19999999999997),
 (34.60000000000004, 21.39999999999997),
 (34.60000000000004, 21.59999999999997),
 (34.60000000000004, 21.79999999999997),
 (34.80000000000004, 13.0),
 (34.80000000000004, 13.2),
 (34.80000000000004, 13.399999999999999),
 (34.80000000000004, 13.599999999999998),
 (34.80000000000004, 13.799999999999997),
 (34.80000000000004, 13.999999999999996),
 (34.80000000000004, 14.199999999999996),
 (34.80000000000004, 14.399999999999995),
 (34.80000000000004, 14.599999999999994),
 (34.80000000000004, 14.799999999999994),
 (34.80000000000004, 14.999999999999993),
 (34.80000000000004, 15.199999999999992),
 (34.80000000000004, 15.399999999999991),
 (34.80000000000004, 15.59999999999999),
 (34.80000000000004, 15.79999999999999),
 (34.80000000000004, 15.99999999999999),
 (34.80000000000004, 16.19999999999999),
 (34.80000000000004, 16.399999999999988),
 (34.80000000000004, 16.599999999999987),
 (34.80000000000004, 16.799999999999986),
 (34.80000000000004, 16.999999999999986),
 (34.80000000000004, 17.199999999999985),
 (34.80000000000004, 17.399999999999984),
 (34.80000000000004, 17.599999999999984),
 (34.80000000000004, 17.799999999999983),
 (34.80000000000004, 17.999999999999982),
 (34.80000000000004, 18.19999999999998),
 (34.80000000000004, 18.39999999999998),
 (34.80000000000004, 18.59999999999998),
 (34.80000000000004, 18.79999999999998),
 (34.80000000000004, 18.99999999999998),
 (34.80000000000004, 19.199999999999978),
 (34.80000000000004, 19.399999999999977),
 (34.80000000000004, 19.599999999999977),
 (34.80000000000004, 19.799999999999976),
 (34.80000000000004, 19.999999999999975),
 (34.80000000000004, 20.199999999999974),
 (34.80000000000004, 20.399999999999974),
 (34.80000000000004, 20.599999999999973),
 (34.80000000000004, 20.799999999999972),
 (34.80000000000004, 20.99999999999997),
 (34.80000000000004, 21.19999999999997),
 (34.80000000000004, 21.39999999999997),
 (34.80000000000004, 21.59999999999997),
 (34.80000000000004, 21.79999999999997),
 (35.00000000000004, 13.0),
 (35.00000000000004, 13.2),
 (35.00000000000004, 13.399999999999999),
 (35.00000000000004, 13.599999999999998),
 (35.00000000000004, 13.799999999999997),
 (35.00000000000004, 13.999999999999996),
 (35.00000000000004, 14.199999999999996),
 (35.00000000000004, 14.399999999999995),
 (35.00000000000004, 14.599999999999994),
 (35.00000000000004, 14.799999999999994),
 (35.00000000000004, 14.999999999999993),
 (35.00000000000004, 15.199999999999992),
 (35.00000000000004, 15.399999999999991),
 (35.00000000000004, 15.59999999999999),
 (35.00000000000004, 15.79999999999999),
 (35.00000000000004, 15.99999999999999),
 (35.00000000000004, 16.19999999999999),
 (35.00000000000004, 16.399999999999988),
 (35.00000000000004, 16.599999999999987),
 (35.00000000000004, 16.799999999999986),
 (35.00000000000004, 16.999999999999986),
 (35.00000000000004, 17.199999999999985),
 (35.00000000000004, 17.399999999999984),
 (35.00000000000004, 17.599999999999984),
 (35.00000000000004, 17.799999999999983),
 (35.00000000000004, 17.999999999999982),
 (35.00000000000004, 18.19999999999998),
 (35.00000000000004, 18.39999999999998),
 (35.00000000000004, 18.59999999999998),
 (35.00000000000004, 18.79999999999998),
 (35.00000000000004, 18.99999999999998),
 (35.00000000000004, 19.199999999999978),
 (35.00000000000004, 19.399999999999977),
 (35.00000000000004, 19.599999999999977),
 (35.00000000000004, 19.799999999999976),
 (35.00000000000004, 19.999999999999975),
 (35.00000000000004, 20.199999999999974),
 (35.00000000000004, 20.399999999999974),
 (35.00000000000004, 20.599999999999973),
 (35.00000000000004, 20.799999999999972),
 (35.00000000000004, 20.99999999999997),
 (35.00000000000004, 21.19999999999997),
 (35.00000000000004, 21.39999999999997),
 (35.00000000000004, 21.59999999999997),
 (35.00000000000004, 21.79999999999997),
 (35.200000000000045, 13.0),
 (35.200000000000045, 13.2),
 (35.200000000000045, 13.399999999999999),
 (35.200000000000045, 13.599999999999998),
 (35.200000000000045, 13.799999999999997),
 (35.200000000000045, 13.999999999999996),
 (35.200000000000045, 14.199999999999996),
 (35.200000000000045, 14.399999999999995),
 (35.200000000000045, 14.599999999999994),
 (35.200000000000045, 14.799999999999994),
 (35.200000000000045, 14.999999999999993),
 (35.200000000000045, 15.199999999999992),
 (35.200000000000045, 15.399999999999991),
 (35.200000000000045, 15.59999999999999),
 (35.200000000000045, 15.79999999999999),
 (35.200000000000045, 15.99999999999999),
 (35.200000000000045, 16.19999999999999),
 (35.200000000000045, 16.399999999999988),
 (35.200000000000045, 16.599999999999987),
 (35.200000000000045, 16.799999999999986),
 (35.200000000000045, 16.999999999999986),
 (35.200000000000045, 17.199999999999985),
 (35.200000000000045, 17.399999999999984),
 (35.200000000000045, 17.599999999999984),
 (35.200000000000045, 17.799999999999983),
 (35.200000000000045, 17.999999999999982),
 (35.200000000000045, 18.19999999999998),
 (35.200000000000045, 18.39999999999998),
 (35.200000000000045, 18.59999999999998),
 (35.200000000000045, 18.79999999999998),
 (35.200000000000045, 18.99999999999998),
 (35.200000000000045, 19.199999999999978),
 (35.200000000000045, 19.399999999999977),
 (35.200000000000045, 19.599999999999977),
 (35.200000000000045, 19.799999999999976),
 (35.200000000000045, 19.999999999999975),
 (35.200000000000045, 20.199999999999974),
 (35.200000000000045, 20.399999999999974),
 (35.200000000000045, 20.599999999999973),
 (35.200000000000045, 20.799999999999972),
 (35.200000000000045, 20.99999999999997),
 (35.200000000000045, 21.19999999999997),
 (35.200000000000045, 21.39999999999997),
 (35.200000000000045, 21.59999999999997),
 (35.200000000000045, 21.79999999999997),
 (35.40000000000005, 13.0),
 (35.40000000000005, 13.2),
 (35.40000000000005, 13.399999999999999),
 (35.40000000000005, 13.599999999999998),
 (35.40000000000005, 13.799999999999997),
 (35.40000000000005, 13.999999999999996),
 (35.40000000000005, 14.199999999999996),
 (35.40000000000005, 14.399999999999995),
 (35.40000000000005, 14.599999999999994),
 (35.40000000000005, 14.799999999999994),
 (35.40000000000005, 14.999999999999993),
 (35.40000000000005, 15.199999999999992),
 (35.40000000000005, 15.399999999999991),
 (35.40000000000005, 15.59999999999999),
 (35.40000000000005, 15.79999999999999),
 (35.40000000000005, 15.99999999999999),
 (35.40000000000005, 16.19999999999999),
 (35.40000000000005, 16.399999999999988),
 (35.40000000000005, 16.599999999999987),
 (35.40000000000005, 16.799999999999986),
 (35.40000000000005, 16.999999999999986),
 (35.40000000000005, 17.199999999999985),
 (35.40000000000005, 17.399999999999984),
 (35.40000000000005, 17.599999999999984),
 (35.40000000000005, 17.799999999999983),
 (35.40000000000005, 17.999999999999982),
 (35.40000000000005, 18.19999999999998),
 (35.40000000000005, 18.39999999999998),
 (35.40000000000005, 18.59999999999998),
 (35.40000000000005, 18.79999999999998),
 (35.40000000000005, 18.99999999999998),
 (35.40000000000005, 19.199999999999978),
 (35.40000000000005, 19.399999999999977),
 (35.40000000000005, 19.599999999999977),
 (35.40000000000005, 19.799999999999976),
 (35.40000000000005, 19.999999999999975),
 (35.40000000000005, 20.199999999999974),
 (35.40000000000005, 20.399999999999974),
 (35.40000000000005, 20.599999999999973),
 (35.40000000000005, 20.799999999999972),
 (35.40000000000005, 20.99999999999997),
 (35.40000000000005, 21.19999999999997),
 (35.40000000000005, 21.39999999999997),
 (35.40000000000005, 21.59999999999997),
 (35.40000000000005, 21.79999999999997),
 (35.60000000000005, 13.0),
 (35.60000000000005, 13.2),
 (35.60000000000005, 13.399999999999999),
 (35.60000000000005, 13.599999999999998),
 (35.60000000000005, 13.799999999999997),
 (35.60000000000005, 13.999999999999996),
 (35.60000000000005, 14.199999999999996),
 (35.60000000000005, 14.399999999999995),
 (35.60000000000005, 14.599999999999994),
 (35.60000000000005, 14.799999999999994),
 (35.60000000000005, 14.999999999999993),
 (35.60000000000005, 15.199999999999992),
 (35.60000000000005, 15.399999999999991),
 (35.60000000000005, 15.59999999999999),
 (35.60000000000005, 15.79999999999999),
 (35.60000000000005, 15.99999999999999),
 (35.60000000000005, 16.19999999999999),
 (35.60000000000005, 16.399999999999988),
 (35.60000000000005, 16.599999999999987),
 (35.60000000000005, 16.799999999999986),
 (35.60000000000005, 16.999999999999986),
 (35.60000000000005, 17.199999999999985),
 (35.60000000000005, 17.399999999999984),
 (35.60000000000005, 17.599999999999984),
 (35.60000000000005, 17.799999999999983),
 (35.60000000000005, 17.999999999999982),
 (35.60000000000005, 18.19999999999998),
 (35.60000000000005, 18.39999999999998),
 (35.60000000000005, 18.59999999999998),
 (35.60000000000005, 18.79999999999998),
 (35.60000000000005, 18.99999999999998),
 (35.60000000000005, 19.199999999999978),
 (35.60000000000005, 19.399999999999977),
 (35.60000000000005, 19.599999999999977),
 (35.60000000000005, 19.799999999999976),
 (35.60000000000005, 19.999999999999975),
 (35.60000000000005, 20.199999999999974),
 (35.60000000000005, 20.399999999999974),
 (35.60000000000005, 20.599999999999973),
 (35.60000000000005, 20.799999999999972),
 (35.60000000000005, 20.99999999999997),
 (35.60000000000005, 21.19999999999997),
 (35.60000000000005, 21.39999999999997),
 (35.60000000000005, 21.59999999999997),
 (35.60000000000005, 21.79999999999997),
 (35.800000000000054, 13.0),
 (35.800000000000054, 13.2),
 (35.800000000000054, 13.399999999999999),
 (35.800000000000054, 13.599999999999998),
 (35.800000000000054, 13.799999999999997),
 (35.800000000000054, 13.999999999999996),
 (35.800000000000054, 14.199999999999996),
 (35.800000000000054, 14.399999999999995),
 (35.800000000000054, 14.599999999999994),
 (35.800000000000054, 14.799999999999994),
 (35.800000000000054, 14.999999999999993),
 (35.800000000000054, 15.199999999999992),
 (35.800000000000054, 15.399999999999991),
 (35.800000000000054, 15.59999999999999),
 (35.800000000000054, 15.79999999999999),
 (35.800000000000054, 15.99999999999999),
 (35.800000000000054, 16.19999999999999),
 (35.800000000000054, 16.399999999999988),
 (35.800000000000054, 16.599999999999987),
 (35.800000000000054, 16.799999999999986),
 (35.800000000000054, 16.999999999999986),
 (35.800000000000054, 17.199999999999985),
 (35.800000000000054, 17.399999999999984),
 (35.800000000000054, 17.599999999999984),
 (35.800000000000054, 17.799999999999983),
 (35.800000000000054, 17.999999999999982),
 (35.800000000000054, 18.19999999999998),
 (35.800000000000054, 18.39999999999998),
 (35.800000000000054, 18.59999999999998),
 (35.800000000000054, 18.79999999999998),
 (35.800000000000054, 18.99999999999998),
 (35.800000000000054, 19.199999999999978),
 (35.800000000000054, 19.399999999999977),
 (35.800000000000054, 19.599999999999977),
 (35.800000000000054, 19.799999999999976),
 (35.800000000000054, 19.999999999999975),
 (35.800000000000054, 20.199999999999974),
 (35.800000000000054, 20.399999999999974),
 (35.800000000000054, 20.599999999999973),
 (35.800000000000054, 20.799999999999972),
 (35.800000000000054, 20.99999999999997),
 (35.800000000000054, 21.19999999999997),
 (35.800000000000054, 21.39999999999997),
 (35.800000000000054, 21.59999999999997),
 (35.800000000000054, 21.79999999999997),
 (36.00000000000006, 13.0),
 (36.00000000000006, 13.2),
 (36.00000000000006, 13.399999999999999),
 (36.00000000000006, 13.599999999999998),
 (36.00000000000006, 13.799999999999997),
 (36.00000000000006, 13.999999999999996),
 (36.00000000000006, 14.199999999999996),
 (36.00000000000006, 14.399999999999995),
 (36.00000000000006, 14.599999999999994),
 (36.00000000000006, 14.799999999999994),
 (36.00000000000006, 14.999999999999993),
 (36.00000000000006, 15.199999999999992),
 (36.00000000000006, 15.399999999999991),
 (36.00000000000006, 15.59999999999999),
 (36.00000000000006, 15.79999999999999),
 (36.00000000000006, 15.99999999999999),
 (36.00000000000006, 16.19999999999999),
 (36.00000000000006, 16.399999999999988),
 (36.00000000000006, 16.599999999999987),
 (36.00000000000006, 16.799999999999986),
 (36.00000000000006, 16.999999999999986),
 (36.00000000000006, 17.199999999999985),
 (36.00000000000006, 17.399999999999984),
 (36.00000000000006, 17.599999999999984),
 (36.00000000000006, 17.799999999999983),
 (36.00000000000006, 17.999999999999982),
 (36.00000000000006, 18.19999999999998),
 (36.00000000000006, 18.39999999999998),
 (36.00000000000006, 18.59999999999998),
 (36.00000000000006, 18.79999999999998),
 (36.00000000000006, 18.99999999999998),
 (36.00000000000006, 19.199999999999978),
 (36.00000000000006, 19.399999999999977),
 (36.00000000000006, 19.599999999999977),
 (36.00000000000006, 19.799999999999976),
 (36.00000000000006, 19.999999999999975),
 (36.00000000000006, 20.199999999999974),
 (36.00000000000006, 20.399999999999974),
 (36.00000000000006, 20.599999999999973),
 (36.00000000000006, 20.799999999999972),
 (36.00000000000006, 20.99999999999997),
 (36.00000000000006, 21.19999999999997),
 (36.00000000000006, 21.39999999999997),
 (36.00000000000006, 21.59999999999997),
 (36.00000000000006, 21.79999999999997),
 (36.20000000000006, 13.0),
 (36.20000000000006, 13.2),
 (36.20000000000006, 13.399999999999999),
 (36.20000000000006, 13.599999999999998),
 (36.20000000000006, 13.799999999999997),
 (36.20000000000006, 13.999999999999996),
 (36.20000000000006, 14.199999999999996),
 (36.20000000000006, 14.399999999999995),
 (36.20000000000006, 14.599999999999994),
 (36.20000000000006, 14.799999999999994),
 (36.20000000000006, 14.999999999999993),
 (36.20000000000006, 15.199999999999992),
 (36.20000000000006, 15.399999999999991),
 (36.20000000000006, 15.59999999999999),
 (36.20000000000006, 15.79999999999999),
 (36.20000000000006, 15.99999999999999),
 (36.20000000000006, 16.19999999999999),
 (36.20000000000006, 16.399999999999988),
 (36.20000000000006, 16.599999999999987),
 (36.20000000000006, 16.799999999999986),
 (36.20000000000006, 16.999999999999986),
 (36.20000000000006, 17.199999999999985),
 (36.20000000000006, 17.399999999999984),
 (36.20000000000006, 17.599999999999984),
 (36.20000000000006, 17.799999999999983),
 (36.20000000000006, 17.999999999999982),
 (36.20000000000006, 18.19999999999998),
 (36.20000000000006, 18.39999999999998),
 (36.20000000000006, 18.59999999999998),
 (36.20000000000006, 18.79999999999998),
 (36.20000000000006, 18.99999999999998),
 (36.20000000000006, 19.199999999999978),
 (36.20000000000006, 19.399999999999977),
 (36.20000000000006, 19.599999999999977),
 (36.20000000000006, 19.799999999999976),
 (36.20000000000006, 19.999999999999975),
 (36.20000000000006, 20.199999999999974),
 (36.20000000000006, 20.399999999999974),
 (36.20000000000006, 20.599999999999973),
 (36.20000000000006, 20.799999999999972),
 (36.20000000000006, 20.99999999999997),
 (36.20000000000006, 21.19999999999997),
 (36.20000000000006, 21.39999999999997),
 (36.20000000000006, 21.59999999999997),
 (36.20000000000006, 21.79999999999997),
 (36.40000000000006, 13.0),
 (36.40000000000006, 13.2),
 (36.40000000000006, 13.399999999999999),
 (36.40000000000006, 13.599999999999998),
 (36.40000000000006, 13.799999999999997),
 (36.40000000000006, 13.999999999999996),
 (36.40000000000006, 14.199999999999996),
 (36.40000000000006, 14.399999999999995),
 (36.40000000000006, 14.599999999999994),
 (36.40000000000006, 14.799999999999994),
 ...]
list(g)[-5:]
[]
g2 = product(x,y)
list(g2)[-5:]
[(59.800000000000395, 20.99999999999997),
 (59.800000000000395, 21.19999999999997),
 (59.800000000000395, 21.39999999999997),
 (59.800000000000395, 21.59999999999997),
 (59.800000000000395, 21.79999999999997)]
g = product(x,y)
pd.DataFrame(g)
0 1
0 32.0 13.0
1 32.0 13.2
2 32.0 13.4
3 32.0 13.6
4 32.0 13.8
... ... ...
6295 59.8 21.0
6296 59.8 21.2
6297 59.8 21.4
6298 59.8 21.6
6299 59.8 21.8

6300 rows × 2 columns

cols
['bill_length_mm', 'bill_depth_mm']
pd.DataFrame(g, columns=cols)
bill_length_mm bill_depth_mm
df_sim2 = pd.DataFrame(product(x,y), columns=cols)
df_sim2
bill_length_mm bill_depth_mm
0 32.0 13.0
1 32.0 13.2
2 32.0 13.4
3 32.0 13.6
4 32.0 13.8
... ... ...
6295 59.8 21.0
6296 59.8 21.2
6297 59.8 21.4
6298 59.8 21.6
6299 59.8 21.8

6300 rows × 2 columns

Using the grid of points to visualize the decision boundary

alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color="pred"
)
df_sim2["pred"] = clf.predict(df_sim2)
len(df_sim2)
6300
df_sim2_sub = df_sim2.sample(5000)
df_sim2_sub
bill_length_mm bill_depth_mm pred
1626 39.2 14.2 Gentoo
5656 57.0 19.2 Chinstrap
4517 52.0 16.4 Gentoo
2949 45.0 17.8 Chinstrap
2213 41.8 14.6 Gentoo
... ... ... ...
5562 56.6 18.4 Chinstrap
2103 41.2 19.6 Adelie
1903 40.4 15.6 Gentoo
1551 38.8 17.2 Adelie
687 35.0 15.4 Adelie

5000 rows × 3 columns

len(df_sim2_sub)
5000
alt.Chart(df_sim2_sub).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color="pred"
)

What penguins were misclassified?

df_sim2
bill_length_mm bill_depth_mm pred
0 32.0 13.0 Adelie
1 32.0 13.2 Adelie
2 32.0 13.4 Adelie
3 32.0 13.6 Adelie
4 32.0 13.8 Adelie
... ... ... ...
6295 59.8 21.0 Chinstrap
6296 59.8 21.2 Chinstrap
6297 59.8 21.4 Chinstrap
6298 59.8 21.6 Chinstrap
6299 59.8 21.8 Chinstrap

6300 rows × 3 columns

df
species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g sex pred
0 Adelie Torgersen 39.1 18.7 181.0 3750.0 Male Adelie
1 Adelie Torgersen 39.5 17.4 186.0 3800.0 Female Adelie
2 Adelie Torgersen 40.3 18.0 195.0 3250.0 Female Adelie
4 Adelie Torgersen 36.7 19.3 193.0 3450.0 Female Adelie
5 Adelie Torgersen 39.3 20.6 190.0 3650.0 Male Adelie
... ... ... ... ... ... ... ... ...
338 Gentoo Biscoe 47.2 13.7 214.0 4925.0 Female Gentoo
340 Gentoo Biscoe 46.8 14.3 215.0 4850.0 Female Gentoo
341 Gentoo Biscoe 50.4 15.7 222.0 5750.0 Male Gentoo
342 Gentoo Biscoe 45.2 14.8 212.0 5200.0 Female Gentoo
343 Gentoo Biscoe 49.9 16.1 213.0 5400.0 Male Gentoo

333 rows × 8 columns

df["species"] == df["pred"]
0      True
1      True
2      True
4      True
5      True
       ... 
338    True
340    True
341    True
342    True
343    True
Length: 333, dtype: bool
df["correct"] = (df["species"] == df["pred"])
alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color="pred"
)
alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color="correct"
)
alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color=alt.condition(alt.datum.correct, alt.value("black"), alt.value("red"))
)
df.correct.unique()
array([ True, False])
alt.Chart(df).mark_circle().encode(
    x=alt.X(cols[0], scale=alt.Scale(zero=False)),
    y=alt.Y(cols[1], scale=alt.Scale(zero=False)),
    color=alt.Color("correct", scale=alt.Scale(domain=[True, False], range=["black", "red"]))
)