Artificial Intelligence Fundamentals Advanced 12 minutes

Data and Algorithms

How data becomes a model: types of data, its quality, and the role of the algorithm in learning.

Your progress in the track0%

From data to model

In machine learning we collect data (examples), and choose a learning algorithm, which produces a model that can make predictions on new examples.

Types of data

  • Structured (tables): ages, prices, categories.
  • Unstructured: images, text, audio, video.
  • Labelled data contains the correct answer, andunlabelled.

Data quality first

  • Representativeness: does the data represent the classes and cases the model will face?
  • Accuracy: labelling errors mislead the model.
  • Balance: a very rare class may be ignored by the model (class imbalance).
  • Recency: old data may not reflect current reality.

Splitting the data

We usually split the data into training ,validation to tune the settings, andtest to estimate the final performance once.

Beware of data leakage: any processing whose statistics are computed (such as the mean for normalization) must be computed on the training data only and then applied to validation and test.

Lesson terms

The algorithm
A defined, organized sequence of steps for solving a problem or carrying out a task.
data leakage
Information from the test data or from the future reaching the training process, so performance looks better than it really is.
Training set
The part of the data from which the model learns its parameters.

Abstract

Model = learning algorithm + training data. The quality of the data (accuracy, representativeness, adequate size, and absence of leakage) affects the results as much as the choice of algorithm. The data is usually split into training, validation and test sets to estimate performance on new data.

Review questions

  1. Why do we separate the test data from the training data?

    To estimate the model's performance on data it has not seen before.

  2. Give an example of data leakage.

    Normalizing the data with statistics computed on the whole dataset before splitting it.

Sources and references

  1. James, Witten, Hastie & Tibshirani — An Introduction to Statistical Learning
  2. scikit-learn — Common pitfalls and recommended practices

Complete the lesson