# Nonlinear Decision Boundaries
Load the data in `data.csv` as a data frame.


```python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline

dat = pd.read_csv("data.csv")
```

Plot the data with matplotlib as a 2D scatter plot, using different colors for the different classes. 


```python

```

Which non-linear transformation $\phi$ will lead linearly separable data in the $\phi$-space? Compute this transformation, and plot the transformed data.


```python

```

# Kernel Density Estimators

In the lecture, you got to know kernel density estimatiors as a non-parametric method for representing a distribution. They represent the distribution of values $x$ as follows:

\begin{equation}
p(t) = \frac{1}{n \, h} \sum_{i=1}^n \varphi\left(\frac{t-x_i}{h}\right)
\end{equation}
Here,  $\varphi$ is a windowing function, e.g. the Gauss window:
\begin{equation}
\varphi(u) = \frac{1}{\sqrt{2\pi}} e^{-u^2/2}
\end{equation}

## Exercise 1
Implement the function `kde(t,h,x)` that estimates the kernel density estimate $p(t)$, given a point $t$, a window size $h$ and an array of training samples $x$.


```python

```

## Exercise 2

Implement the function `classify_kde(xnew,x,classes)` that performs a classification with a kernel density estimator. Specifically, this is a Bayes classifier where the likelihood is represented by a kernel density estimator.


```python

```

30e9c76d0a3e3d6b29903566980ec1398f3a8440
ipynb
Jupyter Notebook
.ipynb_checkpoints/05-kernel-density-estimation-checkpoint.ipynb
stefanluedtke/WS19AI2Exercises
ee9af2abdbaa7d425ca4ee268eeaf21ddb4abe38
MIT
.ipynb_checkpoints/05-kernel-density-estimation-checkpoint.ipynb
stefanluedtke/WS19AI2Exercises
ee9af2abdbaa7d425ca4ee268eeaf21ddb4abe38
MIT
.ipynb_checkpoints/05-kernel-density-estimation-checkpoint.ipynb
stefanluedtke/WS19AI2Exercises
ee9af2abdbaa7d425ca4ee268eeaf21ddb4abe38
MIT
Qwen/Qwen-72B
1. YES
2. YES

