<p>Note: there are many notions of "non-iid-ness" that may be interesting to explore.</p>

<ul>
<li><p><em>Label non-iid</em>: you might want to make the distribution of labels very unbalanced across clients. Evenly distributing the number of examples, we can still get non-iid distribution such as <code>[(35, 35), (10, 60), (50, 20), (45, 25)]</code>. The <a href="https://arxiv.org/abs/1602.05629" rel="nofollow noreferrer">McMahan 2016</a> paper takes a similar approach, but takes a problem with 10 classes and gives most clients only two classes (the exact method is on Page 5 of the paper).</p></li>
<li><p><em>Amount of data</em>: you might want to give some clients more data than others. With 280 examples, perhaps the split is <code>(180, 80, 10, 10)</code> examples (ignores how the labels are distributed). The StackOverflow dataset in TensorFlow Federated also exhibits this, as some cleints have tens of thousands of examples, while others only have 100.</p></li>
<li><p><em>Feature non-iid</em>: If there are patterns in the feature space, it maybe useful to restrict certain patterns to certain users. For example in an image recognition task, perhaps some camera had a different white balance, rotation, or color saturation than others (even though they have most or all labels). Instead of shuffling these randomly across synthetic clients, grouping the similar feature patterns into a single client can give a different form of non-iid.</p></li>
</ul>
TFF: How create a Non-IID dataset
<p>I have 2 classes and every class has 140 examples, and I have 4 clients, I would like to create a non-iid dataset like the paper of McMahan, how divide examples into fragments ? </p>