Machine Learning – Difference Between Vector of Features and Feature Space

classificationmachine learning

What is the difference between vector (x) of features and feature space (X)? I always though that big X was ALL the features and little x was about a specific feature.

enter image description here

enter image description here

Best Answer

The big $\mathcal X$ is the space of all possible values the features, and the little $x$ is a point in that space.

This is no different from saying $x\in\mathbb R^n$, though $\mathcal X$ is more general (could have categorical features, for instance).

$\mathcal X = \mathbb R \times \mathbb R \times \{\text{dog}, \text{cat}, \text{horse}\}$ is a perfectly acceptable $\mathcal X$ and would represent two features that can take any real number and a third feature that is categorical (with levels of $\text{dog}$, $\text{cat}$, and $\text{horse}$).

(One might argue that the feature space should encode the categorical feature in $0$s and $1$s (e.g., one-hot encoding categories), though that is a separate issue.)