Answers.Body: <p>It's true that your original dataset can contain duplicates, so it should not be called a <a href="https://en.wikipedia.org/wiki/Set_(mathematics)" rel="nofollow noreferrer"><em>set</em></a>, in order to be consistent with the mathematical definition of a <em>set</em>. There are mathematical objects known as <a href="https://en.wikipedia.org/wiki/Multiset" rel="nofollow noreferrer"><em>multi-sets</em></a> that can contain duplicates, but the order of the elements is still not relevant. There are also <a href="https://en.wikipedia.org/wiki/Tuple" rel="nofollow noreferrer">tuples</a> and <a href="https://en.wikipedia.org/wiki/Sequence" rel="nofollow noreferrer">sequences</a>, where the order of the elements matters.</p>
  <p>If you want to get rid of the duplicate elements in your dataset, you could perform a <a href="https://en.wikipedia.org/wiki/Data_pre-processing" rel="nofollow noreferrer">pre-processing step</a> where you remove them. Even if you do that, it is often the case that, if you are learning with mini-batches (i.e. using <a href="https://ai.stackexchange.com/a/11675/2444">mini-batch stochastic gradient descent</a>), these mini-batches could contain the same elements, because you may sample the same element in different batches or even in the same batch (this is known as <a href="https://stattrek.com/statistics/dictionary.aspx?definition=sampling_without_replacement" rel="nofollow noreferrer"><em>sampling with replacement</em></a>). Of course, this depends on how you sample your training dataset to build the batches (or mini-batches). So, if you do not want duplicates even in the mini-batches, you need to perform <a href="https://stattrek.com/statistics/dictionary.aspx?definition=sampling_without_replacement" rel="nofollow noreferrer"><em>sampling without replacement</em></a>.</p>
  <p>Moreover, there are datasets that contain elements whose order in the dataset can be relevant for the predictions, such as datasets of <a href="https://en.wikipedia.org/wiki/Time_series" rel="nofollow noreferrer">time-series data</a>, while, in mathematical sets and multi-sets, the order of the elements does not matter.</p>
  <p>So, yes, it is often called a <em>dataset</em> (or <em>data set</em>), but it is not necessarily a set in a mathematical sense. In general, it should just be interpreted as a <em>collection of data</em>. In scenarios where the order of the elements or the existence of duplicates in the dataset (or any other information or property of your collection of data) is relevant, you should probably emphasize/note it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-28T18:12:44.097Z
Answers.LastActivityDate: 2020-11-28T20:10:29.840Z
Answers.LastEditDate: 2020-11-28T20:10:29.840Z
Answers.UserDisplayName: nbro
Body: <p>A dataset is a collection of data points. It is known that the data points in the dataset can repeat. And the repetition does matter for building AI models.</p>
  <p>So, why does the word <em>dataset</em> contain the word <em>set</em>? Does it have any relation with the mathematical set, where order and repetition do not matter?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-29T05:22:04.517Z
Comments.Text: [page:#9](https://www.deeplearningbook.org/contents/ml.html)
Comments.UserDisplayName: hanugm
Tags: <datasets><math><definitions>
Title: Is it okay to think of any dataset in artificial intelligence as a mathematical set?
UserDisplayName: hanugm
ThreadText: # Is it okay to think of any dataset in artificial intelligence as a mathematical set?
  
  (Asked by: username_0 on 2020-11-28)
  
  A dataset is a collection of data points. It is known that the data points in the dataset can repeat. And the repetition does matter for building AI models.
  
  So, why does the word *dataset* contain the word *set*? Does it have any relation with the mathematical set, where order and repetition do not matter?
  
  **Tags:** datasets, math, definitions
  
  > **Comments:**
  > **username_0**: [page:#9](https://www.deeplearningbook.org/contents/ml.html)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-28. Score: 3 | Accepted answer
  
  It's true that your original dataset can contain duplicates, so it should not be called a [*set*](https://en.wikipedia.org/wiki/Set_(mathematics)), in order to be consistent with the mathematical definition of a *set*. There are mathematical objects known as [*multi-sets*](https://en.wikipedia.org/wiki/Multiset) that can contain duplicates, but the order of the elements is still not relevant. There are also [tuples](https://en.wikipedia.org/wiki/Tuple) and [sequences](https://en.wikipedia.org/wiki/Sequence), where the order of the elements matters.
  
  If you want to get rid of the duplicate elements in your dataset, you could perform a [pre-processing step](https://en.wikipedia.org/wiki/Data_pre-processing) where you remove them. Even if you do that, it is often the case that, if you are learning with mini-batches (i.e. using [mini-batch stochastic gradient descent](https://ai.stackexchange.com/a/11675/2444)), these mini-batches could contain the same elements, because you may sample the same element in different batches or even in the same batch (this is known as [*sampling with replacement*](https://stattrek.com/statistics/dictionary.aspx?definition=sampling_without_replacement)). Of course, this depends on how you sample your training dataset to build the batches (or mini-batches). So, if you do not want duplicates even in the mini-batches, you need to perform [*sampling without replacement*](https://stattrek.com/statistics/dictionary.aspx?definition=sampling_without_replacement).
  
  Moreover, there are datasets that contain elements whose order in the dataset can be relevant for the predictions, such as datasets of [time-series data](https://en.wikipedia.org/wiki/Time_series), while, in mathematical sets and multi-sets, the order of the elements does not matter.
  
  So, yes, it is often called a *dataset* (or *data set*), but it is not necessarily a set in a mathematical sense. In general, it should just be interpreted as a *collection of data*. In scenarios where the order of the elements or the existence of duplicates in the dataset (or any other information or property of your collection of data) is relevant, you should probably emphasize/note it.
  
  
  ---
  
  