How to interpret $x \in \mathbb{R}^n$? I see  $$ x \in \mathbb{R} ^n$$ in texts a lot for machine learning.  Can someone give me a good interpretation of it?  Specifically, is $n$ equal to the number of observations or number of predictors?  And also, does it suggest that all values within $x$ are real?
 A: In mathematics, a set of notations is used to condense and formalize statements and demonstrations. These notations have gradually emerged throughout the history of mathematics and the emergence of concepts associated with them.
In order to understand $x \in \mathbb{R}^n$, we need to understand the elements involved here. Let's start with the sets.
A set represents a collection of objects. The objects in the collection are the elements of the set. Here is a non-exhaustive list of some sets that you will find regularly:


*

*$\mathbb{N}$, the set of natural integers.

*$\mathbb {Z}$, the set of relative integers.

*$ \mathbb {D}$, the set of decimal numbers.

*$ \mathbb {Q}$, the set of rationals.

*$ \mathbb {R}$, the set of real numbers.

*$ \mathbb {R}^{+}$, the set of positive or zero real numbers.

*$ \mathbb {R}^{-}$, the set of negative or zero real numbers.

*$ \mathbb {C} $, the set of complex numbers.
So for example $2$ belongs to $\mathbb{N}$ as it is an integer, but also to $\mathbb{R}$.
Among the relations on the sets there is the notion of membership: $\in$ means "is an element of". Here are some examples:


*

*$x \in \mathbb{N}$ means $x$ is an integer

*$x \in \mathbb{Q}$ means $x$ is a rational

*$x \in \mathbb{R}$ means $x$ is a real number


Now for the last part, $\mathbb{R}^n$. Here are some examples to understand it:


*

*$(15) \in \mathbb{N^1}$

*$(15, 8) \in \mathbb{N^2}$

*$(0.75, 22.6, 12.3, 56.4, 102.5) \in \mathbb{R^5}$
Finally, a formal definition is that $\mathbb{R}^n$ consists of all column vectors with $n$ components, all real numbers.
A: $x$ is a vector of length $n$, all its elements are real numbers. Example of an element of $\mathbb{R}^4$ is $(-1, 0, 3, 2)$.
In general, the notation $x \in A^n$, means $x$ is a vector of length $n$, all its elements are from the set $A$.
For example if $4$ is the number of features and $x$ is a feature vector. We can write $x \in \mathbb{R}^4$.
A: In the notation of $x \in \mathbb{R}^n$, $n$ usually means number of 'predictors' or 'features' in machine learning context*. For example, in IRIS data set, we have 4 features, so, we can say, each data point is a 4 dimensional point, and we can write $x \in \mathbb{R}^4$.
*well, this is not completely true, because usually we add 1 intercept column to data.

The reason we need such notation is that, in many cases, say linear model, we will learn a parameter/weights $\beta$ also in (or related to) $w \in \mathbb{R}^n$. 
For example, if we want build a linear model without intercept on IRIS data, the data matrix $X_{m \times n}$ can be $150 \times 4$, where we have 150 points, and 4 features. And the weights we are fitting is $4 \times 1$.
The model is $X\beta$, and the output will be $150\times 1$.

Note that, people also use $X_{n\times p}$ to represent data matrix, in that case, $n$ will be number of data and $p$ will be number of features.
