What does "make_blobs" and "discrete_scatter" means?

Viewed 485
from sklearn.datasets import make_blobs
import mglearn
X, y = make_blobs(random_state=42) // make_blobs???
mglearn.discrete_scatter(X[:, 0], X[:, 1], y) // discrete_scatter??
plt.xlabel("Feature 0")
plt.ylabel("Feature 1")
plt.legend(["Class 0", "Class 1", "Class 2"])

I don't know what does that mean?

1 Answers

I am new to this as well so do not cite me on any of this. Anyway, this is how I understood it:

make_blobs is used to generate synthetic 2-dimensional data. Think of it like a randomly generated dataframe.

discrete_scatter works like scatter from matplotlib as far as I can tell. It is used to create (well, visualise, actually) scatterplots. If you need help on the entire topic I can recommend this video: https://www.youtube.com/watch?v=EItlUEPCIzM

Hope this helped!

Related