1

Lab Description

so we got this for our lab, I just need help understanding number 2. When it say generate data in 2D plane is it telling us to only generate input with just 2 characteristics(X and Y co-ord)? Or can can the Input be of N characteristics (X,Y,Z,etc) but somehow we would display that on a 2D plane?

I am new to Machine Learning and I get PLA in theory we are given an X input with N amount of characteristics and their output (+1 or -1) and reverse engineer to find the perfect weight vector that separates the +1 and -1 perfectly, correct me if my understanding is wrong.

So far my way of approaching this is to generate N random inputs with only two characteristics (X and Y coord) and then distinguish them with a function so which is +1 and -1 and then use PLA to find the weight vector. But I am just not sure on the part if I am to generate input with only 2 characteristics or can be any number?

nbro
  • 42,615
  • 12
  • 119
  • 217

1 Answers1

3

Your understanding of the perceptron is correct (although there might be variations of the definitions).

For the perceptron, we have this equation

$$f(x) = h(x \cdot w + b)$$

where $x$ and $w$ are vectors, but they could also be scalars, and $h$ is a function that transforms the number into a class/label (e.g. tasty or not tasty). $b$ is also a parameter (like $w$), but it's a scalar parameter and it's called the bias.

So, in general, $x$ is a vector of features (or characteristics) and $w$ is the vector of weights (also called parameters), which you want to find. Sometimes $x$ is called a feature vector.

My interpretation of your exercise is that $x$ is a vector of 2 numbers/features, i.e. $x \in \mathbb{R}^2 = [x_1, x_2]$. So, you need to generate vectors of 2 numbers, then you can color them with 2 different colors, depending on their label. Consequently, $w$ also needs to be a vector in $\mathbb{R}^2$, i.e. $w = [w_1, w_2]$, so that you can perform a dot product, $x \cdot w = x_1 * w_1 + x_2 * w_2$. However, if I were you, I'd ask your professor for clarifications.

Btw, I'd not use the letter $y$ to refer to a characteristic or feature, as this letter is often used to denote a label or class, i.e. $f(x) = y$. I'd rather use $x = [x_1, x_2, \dots, x_n]$.

nbro
  • 42,615
  • 12
  • 119
  • 217