Data represents the core of Machine Learning (ML). Every ML algorithm requires input information to extract and learn concepts.
Data is usually presented in the form of a dataset, that, as the name says, is a collection of information that has been synthetically generated or measured in the real world. There is not a univocal definition of dataset, however, for the time being, you can consider it as a matrix.
Taxonomy of data
In the following some definitions are introduced:
Observation/data point: commonly, it is the row of a dataset, that represents the set of information collected through a single analysis. Examples: data collected from a person through a survey, study of one of many blocks of cement (for example, for a robustness analysis).
Variable: commonly, it is the column of a dataset, that represents a feature collected in all (if possible) the carried analyses. Examples: age of a person, number of owned cars, hair colour, sex.
Quantitative variable: variable that assumes numerical values. Examples: age of a person, height of a patient, average daily temperature.
- Continuous: quantitative variable that assumes numerical values in a continuous set. Examples: average daily temperature, heigh of a patient.
- Discrete: quantitative variable that assumes numerical values in a discrete set. Examples: age, number of owned cars.
Categorical variable: variable that assumes values within a predefined set of categories. Examples: hair colour, sex, degree.
- Nominal: categorical variable that assumes values whose order is not
important. Examples: employed/unemployed, hair colour (dark, brown, …),
country (Italy, France, …).
- Binary: nominal variable that assumes two values, tipically 0/1. Examples: employed/unemployed.
- Ordinal: categorical variable that assumes values whose order counts. Examples: answers of a survey (0 - don’t like, 1 - like, 2 - love), degree (0 - without, 1 - with).
- Nominal: categorical variable that assumes values whose order is not
important. Examples: employed/unemployed, hair colour (dark, brown, …),
country (Italy, France, …).
| Quantitative variable | Categorical variable |
|---|---|
| Continuous, Discrete | Nominal (binary), Ordinal |
In addition, in ML, the variables are classified in:
- Predicted variable: variable of interest to be predicted in output with an ML model. Usually, the predicted variable of an observation $i$ is named $y_i$.
- Predictor: variable used as input to train an ML model for outputting a correct prediction. Usually, the predictor $j$ of observation $i$ is named $x_{ij}$ (and the entire observation is named $x_i$).
So, more formally, a dataset is a set of observations defined as a matrix $n \times m$
$$ \vec{X} = \begin{pmatrix} \vec{x}_1\\ \vdots\\ \vec{x}_n \end{pmatrix} = \begin{pmatrix} x_{11} & \dots & x_{1m}\\ \vdots & \ddots & \vdots\\ x_{n1} & \dots & x_{nm}\\ \end{pmatrix} $$