September 2019
Intermediate to advanced
420 pages
10h 29m
English
The function I'm referring to resides within scikit-learn's datasets module. Let's create 100 data points, each belonging to one of two possible classes, and group them into two Gaussian blobs. To make the experiment reproducible, we specify an integer to pick a seed for random_state. You can again pick whatever number you prefer. Here, I went with Thomas Bayes' year of birth (just for kicks):
In [1]: from sklearn import datasets... X, y = datasets.make_blobs(100, 2, centers=2, random_state=1701, cluster_std=2)
Let's have a look at the dataset we just created using our trusty friend, Matplotlib:
In [2]: import matplotlib.pyplot as plt... plt.style.use('ggplot')... %matplotlib inlineIn [3]: plt.scatter(X[:, 0], X[:, ...Read now
Unlock full access